-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-45144][BUILD] Downgrade scala-maven-plugin to 4.7.1
#42899
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
Conversation
|
I am writing the PR description, will be updated later |
|
updated |
dongjoon-hyun
left a comment
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.
+1, LGTM.
|
Is the idea that we can update this again, along with Scala to 2.13.11, after we drop Java 8 support? |
|
@srowen After this downgrade, we can upgrade to Scala 2.13.11 again without waiting for dropping Java 8, because the lower version of the plugin will not automatically adding the |
|
OK that's useful if so. |
|
Ya, I agree with @LuciferYang and hope we can have Scala 2.13.11 back after this PR. |
|
The UT failure is irrelevant one which is tracked here (#42908). |
|
Thanks @dongjoon-hyun @HyukjinKwon @srowen , I will re-upgrade Scala 2.13.11 later |
What changes were proposed in this pull request?
This pr downgrade
scala-maven-pluginto version 4.7.1 to avoid it automatically adding the-releaseoption as a Scala compilation argument.Why are the changes needed?
The
scala-maven-pluginversions 4.7.2 and later will try to automatically append the-releaseoption as a Scala compilation argument when it is not specified by the user:-releaseoption for Scala versions 2.13.9 and higher.-releaseoption for Scala versions 2.12.x/2.13.x/3.1.1, and append-java-output-versionfor Scala 3.1.2.The addition of the
-releaseoption has caused issues mentioned in SPARK-44376 | #41943 and #40442 (comment). This is because the-releaseoption has stronger compilation restrictions than-target, ensuring not only bytecode format, but also that the API used in the code is compatible with the specified version of Java. However, many APIs in thesun.*package are notexportsin Java 11, 17, and 21, such assun.nio.ch.DirectBuffer,sun.util.calendar.ZoneInfo, andsun.nio.cs.StreamDecoder, making them invisible when compiling across different versions.For discussions within the Scala community, see scala/bug#12643, scala/bug#12824, scala/bug#12866, but this is not a bug.
I have also submitted an issue to the
scala-maven-plugincommunity to discuss the possibility of adding additional settings to control the addition of the-releaseoption: davidB/scala-maven-plugin#722.For Apache Spark 4.0, in the short term, I suggest downgrading
scala-maven-pluginto version 4.7.1 to avoid it automatic adding the-releaseoption as a Scala compilation argument. In the long term, we should reduce use of APIs that are notexportsfor compatibility with the-releasecompilation option due to-targetalready deprecated after Scala 2.13.9.Does this PR introduce any user-facing change?
No
How was this patch tested?
run
git revert 656bf36363c466b60d00452399994ccaaa654ed8to revert to using Scala 2.13.11 and rundev/change-scala-version.sh 2.13to change Scala to 2.13build/mvn clean install -DskipTests -Pscala-2.13 -Xto check the Scala compilation arguments.Before
After
After downgrading the version, the
-releaseoption should no longer appear in the compilation arguments.Was this patch authored or co-authored using generative AI tooling?
No