-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
THRIFT-5775 Kotlin build failed for broken toolchain in docker #3043
base: master
Are you sure you want to change the base?
Changes from 3 commits
f505b0a
218fc71
b21f431
c4720e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,8 @@ | |||||
* specific language governing permissions and limitations | ||||||
* under the License. | ||||||
*/ | ||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||||||
|
||||||
plugins { | ||||||
kotlin("jvm") | ||||||
|
@@ -34,15 +36,15 @@ dependencies { | |||||
testImplementation(kotlin("test")) | ||||||
} | ||||||
|
||||||
kotlin { | ||||||
jvmToolchain { | ||||||
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8)) | ||||||
} | ||||||
java { | ||||||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||||||
targetCompatibility = JavaVersion.VERSION_1_8 | ||||||
} | ||||||
|
||||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||||||
tasks.withType<KotlinCompile> { | ||||||
compilerOptions { | ||||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 | ||||||
jvmTarget = JvmTarget.JVM_1_8 | ||||||
freeCompilerArgs = listOf("-Xjdk-release=1.8") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docs say that setting So, I think this part is okay. But the examples I saw appended to the list:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added it for extra clarification, I dont mind removing it either, let me know. As for the |
||||||
} | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,12 +48,6 @@ dependencies { | |
testImplementation("org.jetbrains.kotlin:kotlin-test-junit") | ||
} | ||
|
||
kotlin { | ||
jvmToolchain { | ||
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8)) | ||
} | ||
} | ||
|
||
Comment on lines
-51
to
-56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the cross-test-client and cross-test-server build.gradle.kts files inheriting from config from lib/kotlin/build.gradle.kts ? It's not obvious to me why nothing is needed in these files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not, so removing the If you prefer this to also have a |
||
tasks { | ||
application { | ||
applicationName = "TestServer" | ||
|
@@ -68,7 +62,7 @@ tasks { | |
|
||
task<Exec>("compileThrift") { | ||
val thriftBin = if (hasProperty("thrift.compiler")) { | ||
file(property("thrift.compiler")) | ||
file(property("thrift.compiler")!!) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this change do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not really a relevant change, |
||
} else { | ||
project.rootDir.resolve("../../compiler/cpp/thrift") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still want to set the toolchain for now, to make sure that an appropriate JDK is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, seems with the current configuration i can set the toolchain to 17 and all targets to 8 👍