Unify functions from `JsEnvironmentConfigurator` and
`WasmEnvironmentConfigurator` that do the same logic. Make this logic
also be available for `NativeEnvironmentConfigurator`:
- get*ArtifactSimpleName()
- get*KlibArtifactPath()
- get*KlibOutputDir()
- getAllRecursiveLibrariesFor()
- getAllRecursiveDependenciesFor()
- getAllDependenciesMappingFor()
- getKlibDependencies()
This would allow to have the same logic in one place, and also
reuse it in `IrBackendFacade`s to be implemented for Native.
^KT-65117
Duplicated messages in testdata appeared because default renderer
renders diagnostic spans ambiguously. It shows only start position.
In fact, there are 3 failures, 2 of them distinguish only by the
diagnostic end offset. See youtrack for more information.
The issue about inconvenient rendering is KT-64989.
#KT-64608
Pass the metadata serializer instance instead. This allows to further
reduce code duplication by introducing the common interface
`KlibSingleFileMetadataSerializer` for abstracting away K1 and K2
representation of a source file, as well as reusing
`Fir2KlibMetadataSerializer` across different backends.
KT-64392
Now, we detect clashing signatures during serialization to KLIB and
report a compiler error if two or more declarations have the same
`IdSignature`
For example, for the following code:
```kotlin
@Deprecated("", level = DeprecationLevel.HIDDEN)
fun foo(): String = ""
fun foo(): Int = 0
```
the compiler will produce this diagnostic:
```
e: main.kt:1:1 Platform declaration clash: The following declarations
have the same KLIB signature (/foo|foo(){}[0]):
fun foo(): String defined in root package
fun foo(): Int defined in root package
e: main.kt:4:1 Platform declaration clash: The following declarations
have the same KLIB signature (/foo|foo(){}[0]):
fun foo(): String defined in root package
fun foo(): Int defined in root package
```
Note that we report this diagnostic during serialization and not earlier
(e.g., in fir2ir) for more robustness, so ensure that we check
exactly the signatures that will be written to a KLIB.
If we later introduce some annotation for customizing a declaration's
signature (e.g., for preserving binary compatibility), this
diagnostic will continue to work as expected.
^KT-63670 Fixed
- The incremental configuration for JS recompilation tests creates its
own test root disposable. It needs to be properly handled to avoid
disposable leaks.
- The incremental configuration's disposable is registered with the
parent configuration's disposable because it lives in its scope and
should thus not be a root disposable. It's also disposed at the end of
`transform` because the incremental configuration's lifetime ends
there.
^KT-64099 fixed
- `testDisposable` is already managed by `KtUsefulTestCase`, so disposal
support comes for free. This replaces the previous `TestDisposable`,
which was never disposed properly.
^KT-64099
- This helps to track down disposables which are never disposed, and
reduces confusion when printing disposables in general (the names will
now be meaningful, instead of endless lists of "newDisposable" and
"TestDisposable").
^KT-64099
The reason of this change is to make messages (especially warnings)
that are reported by the KLIB resolver become visible to the end user.
This can be achieved to forwarding such messages to the appropriate
compiler's components such as
`org.jetbrains.kotlin.cli.common.messages.MessageCollector` and
`org.jetbrains.kotlin.ir.util.IrMessageLogger`.
Also: The default `DummyLogger` should be used as minimal as possible.
Because it just forwards messages to the standard output (console)
where they can remain unattended. When the compiler is executed
from the Gradle plugin such messages appear only in DEBUG Gradle's log.
^KT-63573
Fir2Ir conversion consists of multiple steps with complex logic (like
conversion of each module, actualization, plugins application, constant
evaluation), and to ensure that they all are executed correctly it's
convenient to have the single entry point for all this machinery
`fir2IrComponents`, `irActualizerResult` and `dependentIrModuleFragments`
were used in `IrActualizerAndPluginsFacade`, which was removed in the
previous commit
IR actualization and IR plugins will be moved into base Fir2Ir facades
in the following commits, so this facade is not needed anymore
It was easier and cleanlier to remove this facade first and only after
that modify base facades