Always emit Java 8 bytecode on 2.12, regardless of -release; deprecate -target#10109
Always emit Java 8 bytecode on 2.12, regardless of -release; deprecate -target#10109lrytz merged 1 commit intoscala:2.12.xfrom
-release; deprecate -target#10109Conversation
|
Why isn't I almost wrote 'exoplanetary". That is for messages from aliens. |
0ae79da to
9648941
Compare
|
👍 good suggestion, I added that |
som-snytt
left a comment
There was a problem hiding this comment.
That .withPreSetHook(normalizeTarget) really shines when you just want to value.toInt.
| } else if (setting.value.toInt < MinSupportedTargetVersion) { | ||
| 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.
Is the comment falsified? I see L73 as why it doesn't loop.
There was a problem hiding this comment.
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.
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 <yangjie01@baidu.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
### 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 <yangjie01@baidu.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Unlike Scala 2.13, Scala 2.12 cannot emit valid class files for target bytecode versions newer than 8. Thus, this PR deprecates
-targeton 2.12.Regardless, you may still use
-releaseto 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.