From c13c917a8a94a07e909d97e43d7e78226ea1313f Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Thu, 2 Nov 2023 13:22:36 +0100 Subject: [PATCH] [Native] Don't use KLIB repositories in K/N build infra Don't pass KLIB repositories via '-repo' or '-r' compiler parameters. ^KT-61098 --- .../gradle/plugin/konan/KonanLibrariesSpec.kt | 19 ------------------- .../plugin/konan/tasks/KonanCompileTask.kt | 2 -- .../plugin/konan/tasks/KonanInteropTask.kt | 2 -- .../KotlinVsSwift/ring/build.gradle.kts | 3 +-- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanLibrariesSpec.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanLibrariesSpec.kt index 1e81b4e9650..13ac48a6255 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanLibrariesSpec.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanLibrariesSpec.kt @@ -30,18 +30,6 @@ open class KonanLibrariesSpec( val artifactFiles: List @InputFiles @PathSensitive(PathSensitivity.RELATIVE) get() = artifacts.map { it.artifact } - @Internal val explicitRepos = mutableSetOf() - - val repos: Set - @Input get() = mutableSetOf().apply { - addAll(explicitRepos) - add(task.destinationDir) // TODO: Check if task is a library - create a Library interface - add(task.destinationDir) // TODO: Check if task is a library - create a Library interface - add(task.project.konanLibsBaseDir.targetSubdir(target)) - addAll(artifacts.flatMap { it.libraries.repos }) - addAll(task.platformConfiguration.files.map { it.parentFile }) - } - val target: KonanTarget @Internal get() = task.konanTarget @@ -118,13 +106,6 @@ open class KonanLibrariesSpec( it is KonanInteropLibrary } - /** Add repo for library search */ - fun useRepo(directory: Any) = explicitRepos.add(project.file(directory)) - /** Add repos for library search */ - fun useRepos(vararg directories: Any) = directories.forEach { useRepo(it) } - /** Add repos for library search */ - fun useRepos(directories: Iterable) = directories.forEach { useRepo(it) } - private fun Project.evaluationDependsOn(another: Project) { if (this != another) { evaluationDependsOn(another.path) } } diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt index 7452d140b36..db6627b96ca 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt @@ -175,8 +175,6 @@ abstract class KonanCompileTask: KonanBuildingTask(), KonanCompileSpec { /** Args passed to the compiler at both stages of the two-stage compilation and during the singe-stage compilation. */ protected open fun buildCommonArgs() = mutableListOf().apply { - addArgs("-repo", libraries.repos.map { it.canonicalPath }) - if (platformConfiguration.files.isNotEmpty()) { platformConfiguration.files.filter { it.name.endsWith(".klib") }.forEach { // The library's directory is added in libraries.repos. diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanInteropTask.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanInteropTask.kt index a25209df2ab..40ee9036bb4 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanInteropTask.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanInteropTask.kt @@ -98,8 +98,6 @@ open class KonanInteropTask @Inject constructor(@Internal val workerExecutor: Wo addArgs("-compiler-option", includeDirs.allHeadersDirs.map { "-I${it.absolutePath}" }) addArgs("-headerFilterAdditionalSearchPrefix", includeDirs.headerFilterDirs.map { it.absolutePath }) - addArgs("-repo", libraries.repos.map { it.canonicalPath }) - addFileArgs("-library", libraries.klibFiles) addArgs("-library", libraries.artifacts.map { it.artifact.canonicalPath }) diff --git a/kotlin-native/performance/KotlinVsSwift/ring/build.gradle.kts b/kotlin-native/performance/KotlinVsSwift/ring/build.gradle.kts index 952d5a6ee2e..0de650bc54b 100644 --- a/kotlin-native/performance/KotlinVsSwift/ring/build.gradle.kts +++ b/kotlin-native/performance/KotlinVsSwift/ring/build.gradle.kts @@ -25,6 +25,5 @@ swiftBenchmark { tasks.named("compileKotlinNative") { dependsOn(gradle.includedBuild("benchmarksAnalyzer").task(":cinteropLibcurlMacos")) - kotlinOptions.freeCompilerArgs = listOf("-repo", project.file("$toolsPath/benchmarksAnalyzer/build/classes/kotlin/macos/main").absolutePath, - "-l", "benchmarksAnalyzer-cinterop-libcurl") + kotlinOptions.freeCompilerArgs = listOf("-l", project.file("$toolsPath/benchmarksAnalyzer/build/classes/kotlin/macos/main/benchmarksAnalyzer-cinterop-libcurl").absolutePath) } \ No newline at end of file