Disable -Werror if test.progressive.mode is enabled

The reason is that when advancing language version, for example from 1.5
to 1.6, there is a brief period between bootstraps where the
bootstrapped compiler has latest stable language version 1.6, yet the
project is still built with 1.5. That leads to a (correct) warning that
progressive mode makes no sense unless the latest language version is
used, which fails the build because of Werror.

When testing bootstrap in progressive mode, we don't actually care about
these warnings, so disable Werror in this case.

The only case where this could matter would be if we were introducing
_warnings_ in progressive mode and checking that there are no new
warnings on Kotlin would be important for us, but so far progressive
mode has only been used to turn already existing warnings to errors.
This commit is contained in:
Alexander Udalov
2021-07-21 18:58:20 +02:00
parent 60458214a5
commit a383d45534
4 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -481,7 +481,7 @@ allprojects {
}
}
if (!kotlinBuildProperties.isInJpsBuildIdeaSync && !kotlinBuildProperties.useFir && !kotlinBuildProperties.disableWerror) {
if (!kotlinBuildProperties.disableWerror) {
// For compiler and stdlib, allWarningsAsErrors is configured in the corresponding "root" projects
// (compiler/build.gradle.kts and libraries/commonConfiguration.gradle).
val projectsWithWarningsAsErrors = listOf("core", "plugins").map { File(it).absoluteFile }
@@ -19,7 +19,8 @@ val KotlinBuildProperties.jarCompression: Boolean get() = getBoolean("kotlin.bui
val KotlinBuildProperties.ignoreTestFailures: Boolean get() = getBoolean("ignoreTestFailures", isTeamcityBuild)
val KotlinBuildProperties.disableWerror: Boolean get() = getBoolean("kotlin.build.disable.werror", false)
val KotlinBuildProperties.disableWerror: Boolean
get() = getBoolean("kotlin.build.disable.werror") || useFir || isInJpsBuildIdeaSync || getBoolean("test.progressive.mode")
val KotlinBuildProperties.isObsoleteJdkOverrideEnabled: Boolean
get() = getBoolean("kotlin.build.isObsoleteJdkOverrideEnabled", false)
+2 -2
View File
@@ -61,7 +61,7 @@ private class Java9AdditionalArgumentsProvider(
}
fun Project.disableDeprecatedJvmTargetWarning() {
if (!kotlinBuildProperties.useFir && !kotlinBuildProperties.disableWerror) {
if (!kotlinBuildProperties.disableWerror) {
val tasksWithWarnings: List<String> by rootProject.extra
tasks.withType<KotlinCompile>().configureEach {
if (!tasksWithWarnings.contains(path)) {
@@ -72,4 +72,4 @@ fun Project.disableDeprecatedJvmTargetWarning() {
}
}
}
}
}
+3 -1
View File
@@ -85,7 +85,9 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
idea {
this.module.generatedSourceDirs.add(generationRoot)
}
} else if (!kotlinBuildProperties.useFir && !kotlinBuildProperties.disableWerror) {
}
if (!kotlinBuildProperties.disableWerror) {
allprojects {
tasks.withType<KotlinCompile<*>> {
if (path !in tasksWithWarnings) {