Skip to content

Setting java boot classpath so that scala 2.10 works on gradle 7.2 #1800

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

Merged
merged 2 commits into from
Nov 8, 2021

Conversation

masseyke
Copy link
Member

@masseyke masseyke commented Nov 5, 2021

Building scala 2.10 code stopped working when I upgraded to gradle 7.2 (scala 2.11 and 2.12 continued working
fine). I still don't fully understand it, but the problem seems to be that the java boot classpath jars are no longer
getting into the scala boot classpath. I found that I had to set it in two ways: (1) I have to explicitly set it in
scalaCompileOptions.additionalParameters or the build fails and (2) I have to set it in options.bootstrapClasspath
or I get warnings from javac that its boot classpath is incompatible with the source version. The two commands
I've been using to test this out are:

./gradlew :elasticsearch-spark:compileSpark13scala210Scala

and

./gradlew :elasticsearch-spark:test

@masseyke masseyke requested a review from jbaiera November 5, 2021 22:22
@masseyke masseyke marked this pull request as ready for review November 8, 2021 19:42
Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Weird that it disappeared in 7.2

@masseyke masseyke merged commit 2b1a503 into elastic:master Nov 8, 2021
@masseyke masseyke deleted the fix/support-gradle-7.2 branch November 8, 2021 21:18
mark-vieira pushed a commit that referenced this pull request Dec 2, 2021
…1800)

Gradle 7.2 broke scala 2.10 compilation. The problem seems to be that the java boot classpath jars are
no longer getting into the scala boot classpath. This commit sets it in two ways: (1) it is explicitly set it
in scalaCompileOptions.additionalParameters (to prevent the build from failing) and (2) it is set in options.bootstrapClasspath to prevent warnings from javac that its boot classpath is incompatible with
the source version.
masseyke added a commit to masseyke/elasticsearch-hadoop that referenced this pull request Feb 23, 2022
…lastic#1800)

Gradle 7.2 broke scala 2.10 compilation. The problem seems to be that the java boot classpath jars are
no longer getting into the scala boot classpath. This commit sets it in two ways: (1) it is explicitly set it
in scalaCompileOptions.additionalParameters (to prevent the build from failing) and (2) it is set in options.bootstrapClasspath to prevent warnings from javac that its boot classpath is incompatible with
the source version.
masseyke added a commit that referenced this pull request Feb 23, 2022
* Setting java boot classpath so that scala 2.10 works on gradle 7.2 (#1800)

Gradle 7.2 broke scala 2.10 compilation. The problem seems to be that the java boot classpath jars are
no longer getting into the scala boot classpath. This commit sets it in two ways: (1) it is explicitly set it
in scalaCompileOptions.additionalParameters (to prevent the build from failing) and (2) it is set in options.bootstrapClasspath to prevent warnings from javac that its boot classpath is incompatible with
the source version.

* Update Gradle wrapper to 7.3 (#1809)

Co-authored-by: Mark Vieira <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants