scalac:3.x does not support -print-tasty flag
- Dominant language
- Scala
- Stars
- 41
- Forks
- 59
- Avg merge
- 3h 20m
- Merged PRs (30d)
- 8
Description
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
```bash
$ 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
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by inspecting the coursier/apps configuration for the scalac bootstrap launcher and the versionOverrides handling mentioned in the issue. Compare how Scala 3.x launcher modes select main classes, then determine whether the chosen approach provides working -print-tasty and -decompile commands and preserves the default scalac behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala, shell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100