Skip to content

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

Open
@bishabosha

Description

@bishabosha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions