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
This commit is contained in:
committed by
Space Team
parent
957d3c5610
commit
e5ae32c37a
@@ -4999,7 +4999,6 @@ Task frameworkTest(String name, Closure<FrameworkTest> 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"]
|
||||
}
|
||||
|
||||
@@ -36,9 +36,6 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable {
|
||||
@Input
|
||||
lateinit var frameworks: MutableList<Framework>
|
||||
|
||||
@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<String> = emptyList(),
|
||||
var bitcode: Boolean = false,
|
||||
var isStatic: Boolean = false,
|
||||
var artifact: String = name,
|
||||
var libraries: List<String> = 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
|
||||
|
||||
@@ -286,7 +286,7 @@ fun Task.dependsOnKonanBuildingTask(artifact: String, target: KonanTarget) {
|
||||
@JvmOverloads
|
||||
fun compileSwift(
|
||||
project: Project, target: KonanTarget, sources: List<String>, options: List<String>,
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user