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

Misc improvements in compiler options handling #3253

Merged
merged 8 commits into from
Nov 21, 2024

Conversation

Gedochao
Copy link
Contributor

@Gedochao Gedochao commented Oct 29, 2024

This is largely a (much belated) follow-up to scala/scala3#19766, which revamped how compiler settings can be called. We haven't been supporting some of the new syntax.
The actual follow-up we plan for is #2867, this PR should be treated as the first step.

Changes include

  • compiler options can now be passed with - or -- prefixes interchangably (-Wunused:locals means exactly the same as --Wunused:locals)
  • compiler option values can be passed with : or a space, interchangably (-Wunused:locals means the same as -Wunused locals)
    • this applies to repeatable options, so now -Wunused:locals,privates, -Wunused:locals -Wunusedprivates and -Wunused locals -Wunused privates are all synonyms.
  • some options which previously required to be passed via -O now don't:
    • -explain
    • -experimental
  • some options which should have allowed to be repeatable (as they accept a list of values) now actually do
    • -Wunused
    • -coverage-exclude-classlikes
    • -coverage-exclude-files
    • -Wshadow
    • -Xlint
    • -Xmacro-settings
    • -Xplugin-disable
    • -Xplugin-require
    • -Yimports
    • -Yfrom-tasty-ignore-list
  • --source (which used to indicate a source jar artifact is to be produced by the package sub-command) and -source (a compiler option) are now synonyms, as treated by the Scala compiler
    • to produce a source jar, use --src or --sources instead.
  • the changes have been covered with tests where applicable (within reason, we can't test for each compiler option)

@Gedochao Gedochao force-pushed the maintenance/scalac-options-tweaks branch 2 times, most recently from 5017643 to 63477ba Compare October 29, 2024 13:56
@Gedochao Gedochao added the scalac compatibility Issues tied with compatibility with the scalac (compiler) command. label Oct 29, 2024
@Gedochao Gedochao force-pushed the maintenance/scalac-options-tweaks branch 4 times, most recently from fba154a to 5d88ab1 Compare October 31, 2024 09:24
@Gedochao Gedochao marked this pull request as ready for review October 31, 2024 15:02
@Gedochao Gedochao changed the title [WIP] Compiler options improvements Misc improvements in compiler options handling Oct 31, 2024
@Gedochao Gedochao requested a review from tgodzik October 31, 2024 15:03
@Gedochao
Copy link
Contributor Author

Note: the changes are rather large, although I tried to split the commits in a way so that it's easy to review. Let me know if I should split it into smaller bits.

@Gedochao Gedochao added the needs-minor-release This change should require a minor version bump. label Nov 4, 2024
Copy link
Member

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Gedochao Gedochao force-pushed the maintenance/scalac-options-tweaks branch from a59b94e to 8e44678 Compare November 13, 2024 10:03
@Gedochao Gedochao merged commit 095cc09 into VirtusLab:main Nov 21, 2024
78 checks passed
@Gedochao Gedochao deleted the maintenance/scalac-options-tweaks branch November 21, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-minor-release This change should require a minor version bump. scalac compatibility Issues tied with compatibility with the scalac (compiler) command.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants