Skip to content

Scalac command should delegate to a "generic runner" #15173

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

Closed
bishabosha opened this issue May 12, 2022 · 2 comments · Fixed by #15212
Closed

Scalac command should delegate to a "generic runner" #15173

bishabosha opened this issue May 12, 2022 · 2 comments · Fixed by #15212

Comments

@bishabosha
Copy link
Member

bishabosha commented May 12, 2022

the scalac script scans some arguments to decide which main class 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.

cs is the recommended way to install scala, however its scalac installed by cs setup is broken because it is fixed to run dotty.tools.dotc.Main.

We could patch the app descriptor for scalac to use a prebuilt launcher, (i.e. the official script downloaded from github.com/lampepfl/dotty/releases), but then it would not work for nightly releases of scala 3, which I think is an important feature to preserve.

Alternatively I propose that in future releases scalac should be a small wrapper script to set up the classpath that then invokes a class MainGenericCompiler that then selects the actual main class. - Then we can patch the app descriptor to use the new wrapper class.

@bishabosha bishabosha added stat:needs triage Every issue needs to have an "area" and "itype" label itype:enhancement area:tooling and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 12, 2022
@bishabosha
Copy link
Member Author

bishabosha commented May 12, 2022

other option is to move everything to dotty.tools.dotc.Main, but I imagine this is not practical as there are different inclusions on the classpath depending on flags, such as the -with-compiler option

@bishabosha bishabosha modified the milestones: 3.2.0-RC1, 3.1.3 May 13, 2022
@bishabosha bishabosha assigned bishabosha and unassigned BarkingBad May 16, 2022
@bishabosha
Copy link
Member Author

support from @alexarchambault in coursier/coursier#2413 (comment)

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

Successfully merging a pull request may close this issue.

2 participants