Description
the scalac
script scans some arguments to decide which main class run, for example:
scalac -print-tasty
is meant to rundotty.tools.dotc.config.TastyPrinter
,scalac -decompile
is meant to rundotty.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.