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

scalac:3.x does not support -print-tasty flag #148

Open
bishabosha opened this issue Apr 1, 2022 · 3 comments
Open

scalac:3.x does not support -print-tasty flag #148

bishabosha opened this issue Apr 1, 2022 · 3 comments

Comments

@bishabosha
Copy link
Contributor

bishabosha commented Apr 1, 2022

The official GitHub hosted Scala 3 scalac script for versions 3.0.0 and higher scans the flags to pick which main class to run, for example:

  • scalac -print-tasty is meant to run dotty.tools.dotc.config.TastyPrinter,
  • scalac -decompile is meant to run dotty.tools.dotc.decompiler.Main,
  • by default run dotty.tools.dotc.Main.

This means that the scalac bootstrap launcher installed by cs does not have feature parity as it always runs dotty.tools.dotc.Main.

this impacts the doc page at https://docs.scala-lang.org/scala3/guides/tasty-overview.html#what-is-tasty which recommends to use

$ scalac -print-tasty hello.tasty
$ scalac -decompile hello.tasty

So the solutions are either

  1. to publish somewhere a jar with a main class that replicates the scalac script
  2. to bundle the original bash/bat scripts for the 3.x series. This requires versionOverrides to support using prebuilt for one version, and jvm launcher for another

another mitigation is to add the tasty-printer main class to apps

@bishabosha bishabosha changed the title scalac:3.1.1 does not support -print-tasty flag scalac:3.x does not support -print-tasty flag Apr 1, 2022
@bishabosha
Copy link
Contributor Author

bishabosha commented May 12, 2022

I think version 1 is probably the best solution - e.g. it is useful to use cs to launch nightly releases, so I opened scala/scala3#15173 - however this would mean scalac is still not feature complete for all previous scala 3 versions. Perhaps that is ok?

@alexarchambault
Copy link
Member

I guess fixing both - have the main class from dotty handle the argument, and also installing the official script for former versions - is fine (even if the second fix takes a little longer than the first one).

@bishabosha
Copy link
Contributor Author

bishabosha commented May 16, 2022

the only problem is if it is widespread to use coursier cli as the way for users to quickly test nightly releases of scala 3, which would not work as they are not released to GitHub - but scala-cli can fill that gap :/

Edit: yes actually I see it is not useful probably to test nighlies for old releases :)

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

No branches or pull requests

2 participants