From 32a390ea18e8f9393323542da44097860c39e5f1 Mon Sep 17 00:00:00 2001 From: Vladimir Sukharev Date: Sun, 25 Jun 2023 16:21:34 +0200 Subject: [PATCH] [K/N] K1/MPP: Enable splitting 1-stage to two CLI invocations ^KT-59245 Fixed --- .../cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt | 5 +++-- .../blackboxtest/support/group/ExtTestCaseGroupProvider.kt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kotlin-native/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt b/kotlin-native/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt index 5a259313814..bc717d095fe 100644 --- a/kotlin-native/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt +++ b/kotlin-native/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt @@ -75,11 +75,12 @@ class K2Native : CLICompiler() { // In this implementation, 'arguments' is not changed accordingly to changes in `firstStageConfiguration` and `configuration`, // since values of fields `produce`, `output`, `freeArgs`, `includes` does not seem to matter downstream in prepareEnvironment() - if (configuration.get(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS) + if (configuration.getBoolean(CommonConfigurationKeys.USE_FIR) && + configuration.get(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS) ?.getFeatureSupport(LanguageFeature.MultiPlatformProjects) == LanguageFeature.State.ENABLED) messageCollector.report(ERROR, """ - Producing a multiplatform library directly from sources is not allowed. + Producing a multiplatform library directly from sources is not allowed since language version 2.0. If you use the command-line compiler, then first compile the sources to a KLIB with the `-p library` compiler flag. Then, use '-Xinclude=' to pass the KLIB to diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt index 31a1d7873bc..39fc24b6045 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt @@ -146,6 +146,7 @@ private class ExtTestDataFile( && structure.directives[API_VERSION_DIRECTIVE] !in INCOMPATIBLE_API_VERSIONS && structure.directives[LANGUAGE_VERSION_DIRECTIVE] !in INCOMPATIBLE_LANGUAGE_VERSIONS && !(testDataFileSettings.languageSettings.contains("+${LanguageFeature.MultiPlatformProjects.name}") + && pipelineType == PipelineType.K2 && testMode == TestMode.ONE_STAGE_MULTI_MODULE) private fun isIgnoredTarget(pipelineType: PipelineType, testDataFile: File, backend: TargetBackend): Boolean {