Skip to content

Add warnings for the deprecated -Yscriptrunner legacy scala runner option instead of passing it to scalac #1804

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

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

Gedochao
Copy link
Contributor

Fixes #1721
Depends on #1801 (relies on some of the refactors from there)
Despite the -Y prefix, -Yscriptrunner is actually a scala runner option (and not a scalac option) and thus will be covered as part of #1721.
Up until now, Scala CLI has been assuming it's a scalac option and has been passing it to the compiler.
However, the compiler doesn't know what to do with it.

▶ scalac -Yscriptrunner resident
bad option '-Yscriptrunner' was ignored
source file not found: resident
▶ scala-cli -Yscriptrunner -O resident
bad option '-Yscriptrunner' was ignored
Ignoring spurious arguments: resident

With these changes, we'll be logging a reasonable warning about the option being deprecated and no longer supported in Scala CLI (it being the new scala runner). We'll no longer pass the option to the compiler, either.

▶ scala-cli . -Yscriptrunner resident 
Deprecated option '-Yscriptrunner' is ignored.
The script runner can no longer be picked as before.
scala.tools.nsc.fsc.ResidentScriptRunner (the resident script runner) is no longer available.

@Gedochao Gedochao added the SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command. label Jan 23, 2023
Copy link
Contributor

@lwronski lwronski left a comment

Choose a reason for hiding this comment

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

LGTM.

@Gedochao Gedochao enabled auto-merge (squash) January 26, 2023 13:30
@Gedochao Gedochao merged commit 9c2c8d6 into VirtusLab:main Jan 26, 2023
@Gedochao Gedochao deleted the yscriptrunner branch January 27, 2023 07:12
lwronski pushed a commit to lwronski/scala-cli that referenced this pull request Feb 9, 2023
tgodzik pushed a commit to tgodzik/scala-cli that referenced this pull request Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support or silently warn about legacy-scala-runner-specific options without failing
2 participants