Skip to content
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

Explain why to use -target -release etc #2308

Closed
som-snytt opened this issue Feb 3, 2022 · 6 comments · Fixed by #2364
Closed

Explain why to use -target -release etc #2308

som-snytt opened this issue Feb 3, 2022 · 6 comments · Fixed by #2364

Comments

@som-snytt
Copy link
Contributor

reproduction steps

It comes up all the time. Is there a plugin I can use to automate my expectations? sbt-seth?

https://discord.com/channels/632150470000902164/632150470000902166/938864015545880626

problem

https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html should probably explain option selection.

@SethTisue SethTisue transferred this issue from scala/bug Feb 3, 2022
@SethTisue
Copy link
Member

SethTisue commented Feb 3, 2022

really good doc on this would note the Scala 2 vs 3 differences on these flags, too

it came up just the other day in some comment @smarter made over the in the Dotty repo, but I wasn't able to find it just now when I searched. (it was something like "Scala 2 should be changed to match the Scala 3 behavior")

Plus the absence of this is exacerbated by #1711 😕

@Jasper-M
Copy link
Member

Jasper-M commented Feb 3, 2022

There you go https://contributors.scala-lang.org/t/improving-scala-3-forward-compatibility/5298/13?u=jasper-m

@mrdziuban
Copy link

This may go beyond the scope of documentation changes, but I was also thrown off that each option needed to be set differently in my build.sbt -- -release needs to be followed by a space then the version, while -target needs a colon then the version

// correct
scalacOptions ++= Seq("-release", "17", "-target:17")
// incorrect -- "'-release' does not accept multiple arguments"
scalacOptions ++= Seq("-release:17", "-target:17")
// incorrect -- "Usage: -target:<target> where <target> choices are 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 (default: 8)"
scalacOptions ++= Seq("-release", "17", "-target", "17")

@SethTisue
Copy link
Member

SethTisue commented Feb 3, 2022

Everyone should keep piling on with bits of info for the eventual doc addition! 👍

@som-snytt
Copy link
Contributor Author

som-snytt commented Mar 31, 2022

@mrdziuban that is fixed by a recent PR so that colon is handled but if absent it takes the next arg.

@dalbani
Copy link

dalbani commented Sep 30, 2022

For the record:

@mrdziuban that is fixed by a recent PR so that colon is handled but if absent it takes the next arg.

Looks like it was scala/scala#9982.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants