-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Always emit Java 8 bytecode on 2.12, regardless of -release
; deprecate -target
#10109
Conversation
Why isn't I almost wrote 'exoplanetary". That is for messages from aliens. |
0ae79da
to
9648941
Compare
👍 good suggestion, I added that |
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.
That .withPreSetHook(normalizeTarget)
really shines when you just want to value.toInt
.
setting.withDeprecationMessage(s"${setting.name}:${setting.value} is deprecated, forcing use of $DefaultTargetVersion") | ||
setting.value = DefaultTargetVersion // triggers this hook | ||
setting.value = DefaultTargetVersion |
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.
Is the comment falsified? I see L73 as why it doesn't loop.
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.
Ah, no, I think I just found it distracting...
} | ||
} | ||
.withAbbreviation("--target") | ||
def targetValue: String = releaseValue.getOrElse(target.value) | ||
// Unlike 2.13, don't use `releaseValue.getOrElse(target.value)`, because 2.12 doesn't have a fix for scala-dev#408 | ||
def targetValue: String = target.value |
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.
If they use just -release
then they get default target 8. If they -release 8 -target 6
they will get the existing deprecation and target 8. If they are building on JDK 8, they can only use -release 8
or use -target
. The changed behavior is -release 11
where they get target 8 as a limitation with no warning to fail a build. Only explicit -target 9
would warn.
-release
; deprecate -target
-release
; deprecate -target
-release
; deprecate -target
-release
; deprecate -target
-release
; deprecate -target
-release
; deprecate -target
-release
; deprecate -target
on 2.12
-release
; deprecate -target
on 2.12-release
; deprecate -target
### What changes were proposed in this pull request? This PR aims to upgrade Scala to 2.12.17 - https://www.scala-lang.org/news/2.12.17 ### Why are the changes needed? The main [change](https://github.com/scala/scala/pulls?q=is%3Apr+sort%3Aupdated-desc+milestone%3A2.12.17+is%3Amerged+label%3Arelease-notes) fo this version as follows: - scala/scala#10109 - scala/scala#10075 - scala/scala#10108 - scala/scala#10045 - scala/scala#10063 - scala/scala#10042 - scala/scala#10040 - scala/scala#10095 ### Does this PR introduce _any_ user-facing change? Yes, this is a Scala version change. ### How was this patch tested? Existing Test Closes #37892 from LuciferYang/SPARK-40436. Authored-by: yangjie01 <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
### What changes were proposed in this pull request? This PR aims to upgrade Scala to 2.12.17 - https://www.scala-lang.org/news/2.12.17 ### Why are the changes needed? The main [change](https://github.com/scala/scala/pulls?q=is%3Apr+sort%3Aupdated-desc+milestone%3A2.12.17+is%3Amerged+label%3Arelease-notes) fo this version as follows: - scala/scala#10109 - scala/scala#10075 - scala/scala#10108 - scala/scala#10045 - scala/scala#10063 - scala/scala#10042 - scala/scala#10040 - scala/scala#10095 ### Does this PR introduce _any_ user-facing change? Yes, this is a Scala version change. ### How was this patch tested? Existing Test Closes apache#37892 from LuciferYang/SPARK-40436. Authored-by: yangjie01 <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
Unlike Scala 2.13, Scala 2.12 cannot emit valid class files for target bytecode versions newer than 8. Thus, this PR deprecates
-target
on 2.12.Regardless, you may still use
-release
to compile against a specific platform API version.For more information on
-release
, see the Scala 2.13 PR #9982. This PR, taken together with #10089, effectively backports 9982 to 2.12, with the exception that on 2.12, bytecode version 8 is always emitted.