Embed DefaultErrorMessages extension list (KT-57102)

Normally, 'DefaultErrorMessages' extensions should only be loaded
from the main compiler JAR. However, in the in-process JPS build,
there are two versions of the compiler classes in the process, and
'ClassLoader's there are not fully isolated.

'ServiceManager' loads extensions from both 'META-INF' locations. If
the JPS plugin bundles newer compiler components, newly appeared
'DefaultErrorMessages' extensions will be loaded from the JPS (parent)
'ClassLoader', causing an exception.

Such a problem appeared with 'DefaultErrorMessagesWasm':

- - - - -
java.util.ServiceConfigurationError:
org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages$Extension: org.jetbrains.kotlin.wasm.resolve.diagnostics.DefaultErrorMessagesWasm not a subtype
- - - - -
This commit is contained in:
Yan Zhulanow
2023-03-04 02:08:18 +09:00
committed by Space Team
parent f40278c036
commit c604577132
2 changed files with 31 additions and 10 deletions
@@ -1,5 +0,0 @@
# Note that this file is also present in idea/src/META-INF/services
org.jetbrains.kotlin.resolve.jvm.diagnostics.DefaultErrorMessagesJvm
org.jetbrains.kotlin.js.resolve.diagnostics.DefaultErrorMessagesJs
org.jetbrains.kotlin.resolve.konan.diagnostics.DefaultErrorMessagesNative
org.jetbrains.kotlin.wasm.resolve.diagnostics.DefaultErrorMessagesWasm