Skip to content

Commit a55561e

Browse files
AYastrebovSpace Team
authored andcommitted
[Gradle] Remove cacheKind from IT
^KT-80715
1 parent b3be6b9 commit a55561e

File tree

10 files changed

+8
-112
lines changed

10 files changed

+8
-112
lines changed

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/KotlinNativeLinkIT.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ internal class KotlinNativeLinkIT : KGPBaseTest() {
7474
buildCacheEnabled = true,
7575
freeArgs = defaultBuildOptions.freeArgs + "--rerun-tasks",
7676
nativeOptions = defaultBuildOptions.nativeOptions.copy(
77-
cacheKind = NativeCacheKind.STATIC,
7877
// Required as this only reproduces from CacheBuilder.
7978
cacheOrchestration = "gradle"
8079
)

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativeDownloadAndPlatformLibsIT.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,7 @@ class NativeDownloadAndPlatformLibsIT : KGPBaseTest() {
8080
environmentVariables = EnvironmentalVariables(Pair("KONAN_DATA_DIR", anotherKonanDataDir.absolutePathString()))
8181
) {
8282
build(
83-
"linkDebugExecutableNative",
84-
buildOptions = defaultBuildOptions.copy(
85-
nativeOptions = defaultBuildOptions.nativeOptions.copy(
86-
cacheKind = null
87-
)
88-
)
83+
"linkDebugExecutableNative"
8984
) {
9085
assertOutputDoesNotContain("w: Failed to build cache")
9186
assertTasksExecuted(":linkDebugExecutableNative")

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativeIncrementalCompilationIT.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class NativeIncrementalCompilationIT : KGPBaseTest() {
2626

2727
override val defaultBuildOptions = super.defaultBuildOptions.copy(
2828
nativeOptions = BuildOptions.NativeOptions(
29-
cacheKind = NativeCacheKind.STATIC,
3029
incremental = true
3130
)
3231
)

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativeIrLinkerIssuesIT.kt

Lines changed: 6 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.gradle.native
88
import org.gradle.api.logging.LogLevel
99
import org.gradle.util.GradleVersion
1010
import org.jetbrains.kotlin.gradle.KOTLIN_VERSION
11-
import org.jetbrains.kotlin.gradle.dsl.NativeCacheKind
1211
import org.jetbrains.kotlin.gradle.testbase.*
1312
import org.jetbrains.kotlin.konan.library.KONAN_PLATFORM_LIBS_NAME_PREFIX
1413
import org.junit.jupiter.api.Disabled
@@ -18,7 +17,6 @@ import org.junit.jupiter.api.condition.OS
1817
import org.junit.jupiter.api.io.TempDir
1918
import java.nio.file.Path
2019
import kotlin.test.assertEquals
21-
import kotlin.test.assertNotNull
2220

2321
@DisplayName("Tests for K/N builds with ir linker issues")
2422
@NativeGradlePluginTests
@@ -35,17 +33,16 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
3533
OS.MAC,
3634
architectures = ["aarch64"],
3735
disabledReason =
38-
"Run this test only on macOS x64," +
39-
" arm64 requires newer ktor (>=1.6.5) and coroutines (>=1.5.2-native-mt) " +
40-
"that compatible to each other and don't fail this way."
36+
"Run this test only on macOS x64," +
37+
" arm64 requires newer ktor (>=1.6.5) and coroutines (>=1.5.2-native-mt) " +
38+
"that compatible to each other and don't fail this way."
4139
)
4240
fun shouldBuildKtorAndCoroutines(gradleVersion: GradleVersion) {
4341

4442
buildApplicationAndFail(
4543
directoryPrefix = null,
4644
projectName = "native-ir-linker-issues-ktor-and-coroutines",
4745
localRepo = null,
48-
nativeCacheKind = NativeCacheKind.STATIC,
4946
gradleVersion = gradleVersion
5047
) {
5148
"""
@@ -106,7 +103,6 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
106103

107104
buildConflictingLibrariesAndApplication(
108105
directoryPrefix = "native-ir-linker-issues-gone-declaration",
109-
nativeCacheKind = NativeCacheKind.STATIC,
110106
gradleVersion = gradleVersion,
111107
localRepo = tempDir
112108
) {
@@ -132,41 +128,6 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
132128
}
133129
}
134130

135-
@Disabled("Under investigation via KT-72935")
136-
@DisplayName("KT-41378: declaration that is gone - without cache")
137-
@GradleTest
138-
fun shouldBuildIrLinkerWithoutCache(
139-
gradleVersion: GradleVersion,
140-
@TempDir tempDir: Path,
141-
) {
142-
buildConflictingLibrariesAndApplication(
143-
directoryPrefix = "native-ir-linker-issues-gone-declaration",
144-
nativeCacheKind = NativeCacheKind.NONE,
145-
gradleVersion = gradleVersion,
146-
localRepo = tempDir
147-
) {
148-
"""
149-
e: Module "org.sample:libb (org.sample:libb-native)" has a reference to symbol sample.liba/C|null[0]. Neither the module itself nor its dependencies contain such declaration.
150-
151-
This could happen if the required dependency is missing in the project. Or if there is a dependency of "org.sample:libb (org.sample:libb-native)" that has a different version in the project than the version that "org.sample:libb (org.sample:libb-native): 1.0" was initially compiled with. Please check that the project configuration is correct and has consistent versions of all required dependencies.
152-
153-
The list of "org.sample:libb (org.sample:libb-native): 1.0" dependencies that may lead to conflicts:
154-
1. "org.sample:liba (org.sample:liba-native): 2.0" (was initially compiled with "org.sample:liba (org.sample:liba-native): 1.0")
155-
156-
Project dependencies:
157-
+--- org.sample:liba (org.sample:liba-native): 2.0
158-
| \--- org.jetbrains.kotlin:kotlin-stdlib: $KOTLIN_VERSION
159-
+--- org.sample:libb (org.sample:libb-native): 1.0
160-
| ^^^ This module requires symbol sample.liba/C|null[0].
161-
| +--- org.sample:liba (org.sample:liba-native): 1.0 -> 2.0 (*)
162-
| \--- org.jetbrains.kotlin:kotlin-stdlib: $KOTLIN_VERSION
163-
\--- org.jetbrains.kotlin:kotlin-stdlib: $KOTLIN_VERSION
164-
165-
(*) - dependencies omitted (listed previously)
166-
""".trimIndent()
167-
}
168-
}
169-
170131
@DisplayName("KT-47285: symbol type mismatch - with cache")
171132
@GradleTest
172133
@OsCondition(supportedOn = [OS.MAC, OS.LINUX], enabledOnCI = [OS.LINUX])
@@ -177,7 +138,6 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
177138
) {
178139
buildConflictingLibrariesAndApplication(
179140
directoryPrefix = "native-ir-linker-issues-symbol-mismatch",
180-
nativeCacheKind = NativeCacheKind.STATIC,
181141
gradleVersion = gradleVersion,
182142
localRepo = tempDir
183143
) {
@@ -204,44 +164,8 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
204164
}
205165
}
206166

207-
@DisplayName("KT-47285: symbol type mismatch - without cache")
208-
@GradleTest
209-
fun shouldBuildIrLinkerSymbolTypeMismatchWithoutCache(
210-
gradleVersion: GradleVersion,
211-
@TempDir tempDir: Path,
212-
) {
213-
buildConflictingLibrariesAndApplication(
214-
directoryPrefix = "native-ir-linker-issues-symbol-mismatch",
215-
nativeCacheKind = NativeCacheKind.NONE,
216-
gradleVersion = gradleVersion,
217-
localRepo = tempDir
218-
) {
219-
"""
220-
e: The symbol of unexpected type encountered during IR deserialization: IrClassSymbolImpl, sample.liba/B|null[0]. IrTypeAliasSymbol is expected.
221-
222-
This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.
223-
224-
The list of libraries that depend on "org.sample:liba (org.sample:liba-native)" and may lead to conflicts:
225-
1. "org.sample:libb (org.sample:libb-native): 1.0" (was compiled against "org.sample:liba (org.sample:liba-native): 1.0" but "org.sample:liba (org.sample:liba-native): 2.0" is used in the project)
226-
227-
Project dependencies:
228-
+--- org.sample:liba (org.sample:liba-native): 2.0
229-
| ^^^ This module contains symbol sample.liba/B|null[0] that is the cause of the conflict.
230-
| \--- org.jetbrains.kotlin:kotlin-stdlib: $KOTLIN_VERSION
231-
+--- org.sample:libb (org.sample:libb-native): 1.0
232-
| +--- org.sample:liba (org.sample:liba-native): 1.0 -> 2.0 (*)
233-
| | ^^^ This module contains symbol sample.liba/B|null[0] that is the cause of the conflict.
234-
| \--- org.jetbrains.kotlin:kotlin-stdlib: $KOTLIN_VERSION
235-
\--- org.jetbrains.kotlin:kotlin-stdlib: ${KOTLIN_VERSION}
236-
237-
(*) - dependencies omitted (listed previously)
238-
""".trimIndent()
239-
}
240-
}
241-
242167
private fun buildConflictingLibrariesAndApplication(
243168
directoryPrefix: String,
244-
nativeCacheKind: NativeCacheKind,
245169
gradleVersion: GradleVersion,
246170
localRepo: Path,
247171
expectedErrorMessage: () -> String,
@@ -254,7 +178,6 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
254178
directoryPrefix = directoryPrefix,
255179
projectName = "app",
256180
localRepo = localRepo,
257-
nativeCacheKind = nativeCacheKind,
258181
gradleVersion = gradleVersion,
259182
expectedErrorMessage = expectedErrorMessage
260183
)
@@ -264,11 +187,10 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
264187
directoryPrefix: String?,
265188
projectName: String,
266189
localRepo: Path?,
267-
nativeCacheKind: NativeCacheKind,
268190
gradleVersion: GradleVersion,
269191
expectedErrorMessage: () -> String,
270192
) {
271-
prepareProject(directoryPrefix, projectName, localRepo, nativeCacheKind, gradleVersion) {
193+
prepareProject(directoryPrefix, projectName, localRepo, gradleVersion) {
272194
buildAndFail("linkDebugExecutableNative", buildOptions = this.buildOptions.copy(logLevel = LogLevel.DEBUG)) {
273195

274196
val errorMessage = ERROR_LINE_REGEX.findAll(getOutputForTask(":linkDebugExecutableNative"))
@@ -289,7 +211,7 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
289211
private fun buildAndPublishLibrary(
290212
directoryPrefix: String, projectName: String, localRepo: Path, gradleVersion: GradleVersion,
291213
) {
292-
prepareProject(directoryPrefix, projectName, localRepo, nativeCacheKind = NativeCacheKind.STATIC, gradleVersion) {
214+
prepareProject(directoryPrefix, projectName, localRepo, gradleVersion) {
293215
build("publish")
294216
}
295217
}
@@ -298,15 +220,12 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
298220
directoryPrefix: String?,
299221
projectName: String,
300222
localRepo: Path?,
301-
nativeCacheKind: NativeCacheKind,
302223
gradleVersion: GradleVersion,
303224
block: TestProject.() -> Unit,
304225
) {
305226
nativeProject(
306-
directoryPrefix + "/" + projectName,
227+
"$directoryPrefix/$projectName",
307228
gradleVersion = gradleVersion,
308-
buildOptions = defaultBuildOptions.copy(
309-
nativeOptions = defaultBuildOptions.nativeOptions.copy(cacheKind = nativeCacheKind)),
310229
localRepoDir = localRepo
311230
) {
312231
block()
@@ -318,9 +237,5 @@ internal class NativeIrLinkerIssuesIT : KGPBaseTest() {
318237
private val KONAN_PLATFORM_LIB_DEPENDENCY_REGEX =
319238
".*${KONAN_PLATFORM_LIBS_NAME_PREFIX.replace(".", "\\.")}.*".toRegex()
320239

321-
private fun findKotlinNativeCompilerVersion(output: String): String? = findParameterInOutput(
322-
"for_test_kotlin_native_compiler_version",
323-
output
324-
)
325240
}
326241
}

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/testbase/BuildOptions.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import org.gradle.api.logging.configuration.WarningMode
1010
import org.gradle.internal.logging.LoggingConfigurationBuildOptions.StacktraceOption
1111
import org.gradle.util.GradleVersion
1212
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
13-
import org.jetbrains.kotlin.gradle.dsl.NativeCacheKind
1413
import org.jetbrains.kotlin.gradle.plugin.mpp.KmpIsolatedProjectsSupport
1514
import org.jetbrains.kotlin.gradle.report.BuildReportType
1615
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilerExecutionStrategy
@@ -158,7 +157,6 @@ data class BuildOptions(
158157
)
159158

160159
data class NativeOptions(
161-
val cacheKind: NativeCacheKind? = NativeCacheKind.NONE,
162160
val cocoapodsGenerateWrapper: Boolean? = null,
163161
val cocoapodsPlatform: String? = null,
164162
val cocoapodsConfiguration: String? = null,
@@ -344,11 +342,6 @@ data class BuildOptions(
344342
private fun addNativeOptionsToArguments(
345343
arguments: MutableList<String>,
346344
) {
347-
348-
nativeOptions.cacheKind?.let {
349-
arguments.add("-Pkotlin.native.cacheKind=${nativeOptions.cacheKind.name.lowercase()}")
350-
}
351-
352345
nativeOptions.cocoapodsGenerateWrapper?.let {
353346
arguments.add("-Pkotlin.native.cocoapods.generate.wrapper=${it}")
354347
}

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-cocoapods-multiple/kotlin-library/gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-cocoapods-multiple/second-library/gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
kotlin.mpp.enableCInteropCommonization=true
2-
kotlin.native.cacheKind=static
1+
kotlin.mpp.enableCInteropCommonization=true

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-download-maven/gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-platform-libraries/gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)