Skip to content

scala script uses an old Scala version for printing help messages #21263

Closed
@Gedochao

Description

@Gedochao

Compiler version

3.5.0-RC5, 3.5.1-RC1

Minimized code

All help messages returned by the runner (Scala CLI) use the launcher's default Scala version (3.4.2 for Scala CLI v1.4.1) rather than what's passed as --cli-default-scala-version in the scala script.
This affects all help messages (-X, -Y, --scalac-help, etc).

cs install:3.5.1-RC1
scala --scalac-help

Output

Usage: scalac <options> <source files>
where possible standard options include:
          -D<property=value>  Pass -D<property=value> directly to the runtime
                              system.
                    -J<flag>  Pass -J<flag> directly to the runtime system.
                          -P  Pass an option to a plugin, e.g. -P:<plugin>:<opt>
                          -V  Print a synopsis of verbose options.
                          -W  Print a synopsis of warning options.
                      -Wconf  Configure compiler warnings.
                     -Werror  Fail the compilation if there are any warnings.
                          -X  Print a synopsis of advanced options.
                          -Y  Print a synopsis of private options.
              -bootclasspath  Override location of bootstrap class files.
                  -classpath  Specify where to find user class files.
                              Default .
                      -color  Colored output
                              Default always
                              Choices : always, never
-coverage-exclude-classlikes  List of regexes for packages, classes and modules
                              to exclude from coverage.
     -coverage-exclude-files  List of regexes for files to exclude from
                              coverage.
               -coverage-out  Destination for coverage classfiles and
                              instrumentation data.
                          -d  Destination for generated classfiles.
                -deprecation  Emit warning and location for usages of deprecated
                              APIs.
                   -encoding  Specify character encoding used by source files.
                              Default UTF-8
               -experimental  Annotate all top-level definitions with
                              @experimental. This enables the use of
                              experimental features anywhere in the project.
                    -explain  Explain errors in more detail.
             -explain-cyclic  Explain cyclic reference errors in more detail.
              -explain-types  Explain type errors in more detail (deprecated,
                              use -explain instead).
                    -extdirs  Override location of installed extensions.
                    -feature  Emit warning and location for usages of features
                              that should be imported explicitly.
                 -from-tasty  Compile classes from tasty files. The arguments
                              are .tasty or .jar files.
                       -help  Print a synopsis of standard options.
                     -indent  Together with -rewrite, remove {...} syntax when
                              possible due to significant indentation.
        -java-output-version  Compile code with classes specific to the given
                              version of the Java platform available on the
                              classpath and emit bytecode for this version.
                              Corresponds to -release flag in javac.
                              Choices : 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
          -javabootclasspath  Override java boot classpath.
                -javaextdirs  Override java extdirs classpath.
                   -language  Enable one or more language features.
                 -new-syntax  Require `then` and `do` in control expressions.
                  -no-indent  Require classical {...} syntax, indentation is not
                              significant.
                     -nowarn  Silence all warnings.
                 -old-syntax  Require `(...)` around conditions.
                  -pagewidth  Set page width
                              Default 80
                -print-lines  Show source code line numbers.
                -print-tasty  Prints the raw tasty.
                -project-url  The source repository of your project.
                    -rewrite  When used in conjunction with a `...-migration`
                              source version, rewrites sources to migrate to new
                              version.
                    -scalajs  Compile in Scala.js mode (requires
                              scalajs-library.jar on the classpath).
-scalajs-genStaticForwardersForNonTopLevelObjects
                              Generate static forwarders even for non-top-level
                              objects (Scala.js only).
       -scalajs-mapSourceURI  rebases source URIs from uri1 to uri2 (or to a
                              relative URI) for source maps (Scala.js only).
          -semanticdb-target  Specify an alternative output directory for
                              SemanticDB files.
            -semanticdb-text  Specifies whether to include source code in
                              SemanticDB files or not.
                     -source  source version
                              Default 3.4
                              Choices : 3.0-migration, 3.0, 3.1, 3.2-migration,
                              3.2, 3.3-migration, 3.3, 3.4-migration, 3.4,
                              3.5-migration, 3.5, future-migration, future
                 -sourcepath  Specify location(s) of source files.
                 -sourceroot  Specify workspace root directory.
                              Default .
                  -unchecked  Enable additional warnings where generated code
                              depends on assumptions.
                     -uniqid  Uniquely tag all identifiers in debugging output.
                  -usejavacp  Utilize the java.class.path in classpath
                              resolution.
                    -verbose  Output messages about what the compiler is doing.
                    -version  Print product version and exit.
                     @<file>  A text file containing compiler arguments (options
                              and source files).

Expectation

scala --scalac-help

should return the same as

scalac -help

for a given installation.

Metadata

Metadata

Assignees

Labels

area:runnerIssues tied to the scala runner command.itype:bugregressionThis worked in a previous version but doesn't anymore

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions