Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown -language option yields an error #20419

Closed
WojciechMazur opened this issue May 16, 2024 · 7 comments · Fixed by #20454
Closed

Unknown -language option yields an error #20419

WojciechMazur opened this issue May 16, 2024 · 7 comments · Fixed by #20454
Labels
area:settings Issues tied to command line options & settings. area:ux Issues tied to user experience. itype:bug stat:needs decision Some aspects of this issue need a decision from the maintainance team.
Milestone

Comments

@WojciechMazur
Copy link
Contributor

Before 3.5 passing -language:higherKinds was simply ignored without any mesage, now, it's yielding a compilation error. This conflicts with handling of other unknown scalac options, which emit warnings.
The new behaviour is problematic when project use utilities to set common scalacOptions like https://github.com/typelevel/sbt-tpolecat - it requires to modify the upstream project and release it or to introduce a special exclusion rules in the build.

Compiler version

Last good release: 3.5.0-RC1-bin-20240512-99c4c00-NIGHTLY
First bad release: 3.5.0-RC1-bin-20240514-7c9aae3-NIGHTLY
Bisect points to: f6345c6

Minimized code

//> using options -language:higherKinds

@main def Test = ()

Output

[error] invalid choice(s) for -language: higherKinds
[info]   scalac -help  gives more information

Expectation

Unknown variant of option should yield warning instead of error.

@WojciechMazur WojciechMazur added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label area:ux Issues tied to user experience. labels May 16, 2024
@noti0na1
Copy link
Member

-language is a choice flag now, so it errors out any invalid choice like other flags, for example, -source.

We should make a decision what behaviour we want for this kind of flags.

@som-snytt
Copy link
Contributor

As a warning, bad option '-junk' was ignored is not very opinionated. -Yrangepos is the one I remember being ignored.

sbt-tpolecat is the unproblematic case: its job is to present correct options.

@Gedochao Gedochao added area:settings Issues tied to command line options & settings. and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 17, 2024
@Gedochao
Copy link
Contributor

We should make a decision what behaviour we want for this kind of flags.

@noti0na1 agreed, we'll discuss this behaviour on the next core meeting.

@Gedochao Gedochao added the stat:needs decision Some aspects of this issue need a decision from the maintainance team. label May 17, 2024
@WojciechMazur
Copy link
Contributor Author

In the last OpenCB there are 434 failures, seems like all of this failures are caused by -language:higherKinds or other no longer viable options https://virtuslab.github.io/community-build3/2024/05/18/3.5.0-rc1-bin-20240516-c608177-nightly.html
We can adapt OpenCB to try filter out the no longer valid options, but still, it seems like large amount of ecosystem was using no-op flag for a long time.

@Gedochao
Copy link
Contributor

@noti0na1
Some notes after core meeting:

  • we should accept options from Scala 2, including -language:higherKinds.
  • for unknown options, it is correct to fail.

@noti0na1
Copy link
Member

noti0na1 commented May 22, 2024

@Gedochao Do we also accept _ with no effect? Also, for Scala 2 language features, we just accept them without any warning?

@Gedochao
Copy link
Contributor

@Gedochao Do we also accept _ with no effect?

@noti0na1 Nice catch.
No, we don't want to accept _.

noti0na1 added a commit that referenced this issue May 23, 2024
Fix #20419

* Accept legacy language features (from Scala 2),
* For other unknown features, it will still fail.
@Kordyjan Kordyjan added this to the 3.5.1 milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:settings Issues tied to command line options & settings. area:ux Issues tied to user experience. itype:bug stat:needs decision Some aspects of this issue need a decision from the maintainance team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants