[PL][tests] Don't compile source->binary directly in Native KLIB ABI tests

Avoid using source+KLIB+cache?->binary compilations in KLIB ABI tests. Such compilations are not supported by Native K2 and thus will block migrating ABI tests to K2.
This commit is contained in:
Dmitriy Dolovov
2023-03-28 13:00:17 +02:00
committed by Space Team
parent 639b0cc525
commit 8147aa7dd6
3 changed files with 143 additions and 78 deletions
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
import org.jetbrains.kotlin.cli.js.klib.generateIrForKlibSerialization
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.codegen.ProjectInfo
import org.jetbrains.kotlin.config.CommonConfigurationKeys
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
@@ -120,8 +119,8 @@ abstract class AbstractJsKLibABITestCase : KtUsefulTestCase() {
environment.project,
ktFiles,
config,
dependencies.regularDependencies.map { it.path },
dependencies.friendDependencies.map { it.path },
dependencies.regularDependencies.map { it.libraryFile.path },
dependencies.friendDependencies.map { it.libraryFile.path },
AnalyzerWithCompilerReport(config)
)
@@ -182,7 +181,7 @@ abstract class AbstractJsKLibABITestCase : KtUsefulTestCase() {
// TODO: what about friend dependencies?
val cacheUpdater = CacheUpdater(
mainModule = mainModuleKlibFile.absolutePath,
allModules = allDependencies.regularDependencies.map { it.path },
allModules = allDependencies.regularDependencies.map { it.libraryFile.path },
mainModuleFriends = emptyList(),
cacheDir = buildDir.resolve("libs-cache").absolutePath,
compilerConfiguration = configuration,
@@ -216,8 +215,8 @@ abstract class AbstractJsKLibABITestCase : KtUsefulTestCase() {
environment.project,
klib,
configuration,
allDependencies.regularDependencies.map { it.path },
allDependencies.friendDependencies.map { it.path }
allDependencies.regularDependencies.map { it.libraryFile.path },
allDependencies.friendDependencies.map { it.libraryFile.path }
)
val ir = compile(