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

Support Scala 3 -Yscala-output-version flag #1762

Closed
lolgab opened this issue Mar 4, 2022 · 3 comments
Closed

Support Scala 3 -Yscala-output-version flag #1762

lolgab opened this issue Mar 4, 2022 · 3 comments

Comments

@lolgab
Copy link
Member

lolgab commented Mar 4, 2022

The new -Yscala-release requires special build tool support.

This is a problem Sbt is also facing: sbt/sbt#6814
Scala community discussion: https://contributors.scala-lang.org/t/improving-scala-3-forward-compatibility/5298/22

Possible solution in ScalaModule (inspired by the discussion in the Sbt Issue):

def scalaOutputVersion: T[String] = T { scalaVersion() }
def scalaVersion: T[String]
def mandatoryScalacOptions: T[Seq[String]] = T {
  if(scalaBinaryVersion(scalaVersion()) != scalaBinaryVersion(scalaOutputVersion())) Seq("-Yscala-release", scalaBinaryVersion(scalaOutputVersion()))
  else Seq.empty[String]
}
@lefou
Copy link
Member

lefou commented Mar 4, 2022

Sounds reasonable to me.

@prolativ
Copy link

prolativ commented Mar 4, 2022

The flag will be renamed to -scala-output-version starting from 3.1.2-RC2.
I seem to have a working implementation #1764 but it needs to wait for the release of 3.1.2-RC2 and I would like to align it with the implementation for sbt to make sure the behaviour of the setting are possibly the same no matter what build tool a user chooses but it seems not so easy to achieve exactly the same semantics in sbt regarding which version of the standard library gets used at runtime.

@lefou lefou changed the title Support Scala 3 -Yscala-release flag Support Scala 3 -Yscala-output-version flag Mar 6, 2022
@lefou lefou linked a pull request Apr 4, 2022 that will close this issue
@lolgab
Copy link
Member Author

lolgab commented Jun 17, 2022

Since the compiler team decided to drop the -scala-output-version flag we don't need to support it anymore.
scala/scala3#15146

@lolgab lolgab closed this as completed Jun 17, 2022
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.

3 participants