-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[backport] Make -target
support JDK 8 through 19 (and deprecate 5 through 7)
#9916
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
Is this a backport from 2.13? |
Just the test |
I agree that it's fine to pretend 9,10,12,13,14,15,16 don't exist. It seems peculiar to me to require the new "jvm-11" style for the new flags, but then not to also support "jvm-8". If "jvm-8" actually works, could you test that in Have you verified that the bytecode version actually gets set as expected? |
a6c3e8e
to
9e1b0ef
Compare
Backported support for all jvm versions as are in The bytecode version was not set, I missed that in the code, thanks. And it's verified but just locally as I haven't found test for that. $ for v in `seq 5 18`; do scalac -deprecation -target:$v Test.scala; file Test.class; done
warning: -target is deprecated: -target:5 is deprecated, forcing use of 8
one warning found
Test.class: compiled Java class data, version 52.0 (Java 1.8)
warning: -target is deprecated: -target:6 is deprecated, forcing use of 8
one warning found
Test.class: compiled Java class data, version 52.0 (Java 1.8)
warning: -target is deprecated: -target:7 is deprecated, forcing use of 8
one warning found
Test.class: compiled Java class data, version 52.0 (Java 1.8)
Test.class: compiled Java class data, version 52.0 (Java 1.8)
Test.class: compiled Java class data, version 53.0 (Java SE 9)
Test.class: compiled Java class data, version 54.0 (Java SE 10)
Test.class: compiled Java class data, version 55.0 (Java SE 11)
Test.class: compiled Java class data, version 56.0 (Java SE 12)
Test.class: compiled Java class data, version 57.0 (Java SE 13)
Test.class: compiled Java class data, version 58.0 (Java SE 14)
Test.class: compiled Java class data, version 59.0
Test.class: compiled Java class data, version 60.0
Test.class: compiled Java class data, version 61.0
Test.class: compiled Java class data, version 62.0 |
9e1b0ef
to
f2ecf90
Compare
Hi @SethTisue is there anything else I should update? |
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.
lgtm... maybe @som-snytt would like to have a look?
project/ScalaOptionParser.scala
Outdated
@@ -126,4 +126,5 @@ object ScalaOptionParser { | |||
private def scaladocPathSettingNames = List("-doc-root-content", "-diagrams-dot-path") | |||
private def scaladocMultiStringSettingNames = List("-doc-external-doc") | |||
|
|||
private val targetSettingNames = (5 to 18).map(_.toString).flatMap(v => v :: s"jvm-1.$v" :: s"jvm-$v" :: s"1.$v" :: Nil).toList |
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.
private val targetSettingNames = (5 to 18).map(_.toString).flatMap(v => v :: s"jvm-1.$v" :: s"jvm-$v" :: s"1.$v" :: Nil).toList | |
private val targetSettingNames = (5 to 18).flatMap(v => s"$v" :: s"jvm-1.$v" :: s"jvm-$v" :: s"1.$v" :: Nil).toList |
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.
updated
f2ecf90
to
018d404
Compare
@som-snytt @SethTisue do you want to review it again or could it be merged? |
I was like what's a LGTM within an approximation. (Noting "wants to merge ... into OK, just read the PR on 2.13 #8060 I would have said the preHook was jumping the shark. I sense a peter pan pun. Oh that was an alligator not a shark. Or a crocodile. I was aware that Footnote: I would have gone with just listing the variants, |
#10000 extends this to JDK 19. |
-target
support JDK 8 through 19, with deprecation warning for 5 through 7
-target
support JDK 8 through 19, with deprecation warning for 5 through 7-target
support JDK 8 through 19 (and deprecate 5 through 7)
Even though scala >= 2.12.15 supports jvm >=8. It is not possible to use it as a target. This adds
jvm-11
,jvm-17
andjvm-18
alongsidejvm-1.8
as supported target values.