Skip to content

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

Closed
@bishabosha

Description

@bishabosha

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions