Skip to content

Command line option aliases ("abbreviations") not understood by scalac #10810

Closed
@griggt

Description

@griggt

The aliases ("abbreviations") given to command line options in dotty/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala by withAbbreviation do not appear to be understood when specified on the command line.

I believe this is the cause of the community build test failures in #10733.

This also means that any such aliases added for backward compatibility as part of the recent compiler flags cleanup (#10236) may not be functional.

A couple of examples:

https://github.com/lampepfl/dotty/blob/bbd092b7f6ceeb7959e304a16219a040a4db1001/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala#L27

$ scalac -version
Scala compiler version 3.0.0-M3-bin-SNAPSHOT-git-bbd092b -- Copyright 2002-2020, LAMP/EPFL

$ scalac --version
bad option '--version' was ignored
Usage: scalac <options> <source files>
      ... help text elided ...

https://github.com/lampepfl/dotty/blob/bbd092b7f6ceeb7959e304a16219a040a4db1001/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala#L103

$ ls -l
total 8
-rw-r--r-- 1 tgrigg tgrigg 282 Dec 15 13:25 Test.class
-rw-r--r-- 1 tgrigg tgrigg 259 Dec 15 13:25 Test.tasty

$ dotc -from-tasty Test.tasty
$ ls -l
total 8
-rw-r--r-- 1 tgrigg tgrigg 282 Dec 15 13:26 Test.class
-rw-r--r-- 1 tgrigg tgrigg 259 Dec 15 13:26 Test.tasty

$ dotc --from-tasty Test.tasty
bad option '--from-tasty' was ignored
-- [E080] Syntax Error: Test.tasty:1:0 -----------------------------------------
1 |\������]��������������ASTs��<empty>��Test��<init>��java��lang������Object����?�����Unit��scala��SourceFile��annotation������internal����������String����?������Test.scala��Positions��Comments����6��������p�Uu�6����)u�6� ��u�6���p�U3�@��������������ؠƆ���
  |^^^
  |Expected a toplevel definition
-- Error: Test.tasty:1:6 -------------------------------------------------------
1 |\������]��������������ASTs��<empty>��Test��<init>��java��lang������Object����?�����Unit��scala��SourceFile��annotation������internal����������String����?������Test.scala��Positions��Comments����6��������p�Uu�6����)u�6� ��u�6���p�U3�@��������������ؠƆ���
  |      ^
  |      illegal character '\u0000'

    ... more errors elided ...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions