From e5ae32c37a89c1a803bc8ae28ebb79748acb7a89 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Thu, 23 Nov 2023 18:36:59 +0000 Subject: [PATCH] Native: remove bitcode embedding from tests Xcode 14 deprecates bitcode embedding, and Xcode 15 removes support for it. Therefore, testing bitcode embedding in Kotlin doesn't make much sense. This commit removes most of test code that enables bitcode. ^KT-61875 --- kotlin-native/backend.native/tests/build.gradle | 8 -------- .../src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt | 7 +------ .../src/main/kotlin/org/jetbrains/kotlin/Utils.kt | 5 ++--- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 6dd07b704b3..fcf349789ee 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -4999,7 +4999,6 @@ Task frameworkTest(String name, Closure configurator) { UtilsKt.dependsOnKonanBuildingTask(task, library, target) } - extraOpts fr.bitcode ? "-Xembed-bitcode" : "-Xembed-bitcode-marker" if (fr.isStatic) extraOpts "-Xstatic-framework" extraOpts fr.opts extraOpts project.globalTestArgs @@ -5096,7 +5095,6 @@ Task objcExportTest( sources = ['objcexport'] libraries = [libraryName, noEnumEntriesLibraryName] artifact = 'Kt' - bitcode = !isStaticFramework isStatic = isStaticFramework if (needLazyHeaderCheck) { opts += "-Xemit-lazy-objc-header=$lazyHeader" @@ -5187,9 +5185,7 @@ if (isAppleTarget(project)) { frameworkTest("testStdlibFramework") { framework('Stdlib') { sources = ['framework/stdlib'] - bitcode = true } - if (cacheTesting == null) fullBitcode = true swiftSources = ['framework/stdlib/'] } @@ -5198,11 +5194,9 @@ if (isAppleTarget(project)) { } else frameworkTest("testMultipleFrameworks") { framework('First') { sources = ['framework/multiple/framework1', 'framework/multiple/shared'] - bitcode = true } framework('Second') { sources = ['framework/multiple/framework2', 'framework/multiple/shared'] - bitcode = true } swiftSources = ['framework/multiple'] } @@ -5217,14 +5211,12 @@ if (isAppleTarget(project)) { framework('FirstStatic') { artifact = 'First' sources = ['framework/multiple/framework1', 'framework/multiple/shared'] - bitcode = true isStatic = true opts = ['-Xstatic-framework', "-Xpre-link-caches=enable"] } framework('SecondStatic') { artifact = 'Second' sources = ['framework/multiple/framework2', 'framework/multiple/shared'] - bitcode = true isStatic = true opts = ['-Xstatic-framework', "-Xpre-link-caches=enable"] } diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt index b3f2c7bc318..6eb7cef2785 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt @@ -36,9 +36,6 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable { @Input lateinit var frameworks: MutableList - @Input - var fullBitcode: Boolean = false - @Input var codesign: Boolean = true @@ -53,7 +50,6 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable { * * @param name is the framework name, * @param sources framework sources, - * @param bitcode bitcode embedding in the framework, * @param isStatic determines that framework is static * @param artifact the name of the resulting artifact, * @param library list of library dependency names, @@ -62,7 +58,6 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable { class Framework( val name: String, var sources: List = emptyList(), - var bitcode: Boolean = false, var isStatic: Boolean = false, var artifact: String = name, var libraries: List = emptyList(), @@ -176,7 +171,7 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable { } else { emptyList() } - compileSwift(project, project.testTarget, sources, options + simulatorHack + swiftExtraOpts, Paths.get(executable), fullBitcode) + compileSwift(project, project.testTarget, sources, options + simulatorHack + swiftExtraOpts, Paths.get(executable)) } @TaskAction diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/Utils.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/Utils.kt index f98a10de0eb..4e600873166 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/Utils.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/Utils.kt @@ -286,7 +286,7 @@ fun Task.dependsOnKonanBuildingTask(artifact: String, target: KonanTarget) { @JvmOverloads fun compileSwift( project: Project, target: KonanTarget, sources: List, options: List, - output: Path, fullBitcode: Boolean = false + output: Path ) { val platform = project.platformManager.platform(target) assert(platform.configurables is AppleConfigurables) @@ -300,8 +300,7 @@ fun compileSwift( val swiftTarget = configs.targetTriple.withOSVersion(configs.osVersionMin).toString() val args = listOf("-sdk", configs.absoluteTargetSysRoot, "-target", swiftTarget) + - options + "-o" + output.toString() + sources + - if (fullBitcode) listOf("-embed-bitcode", "-Xlinker", "-bitcode_verify") else listOf("-embed-bitcode-marker") + options + "-o" + output.toString() + sources val (stdOut, stdErr, exitCode) = runProcess( executor = localExecutor(project), executable = compiler, args = args,