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

Scala 3.5 is using the wrong launcher #238

Closed
JD557 opened this issue Aug 22, 2024 · 12 comments · Fixed by #239
Closed

Scala 3.5 is using the wrong launcher #238

JD557 opened this issue Aug 22, 2024 · 12 comments · Fixed by #239

Comments

@JD557
Copy link
Contributor

JD557 commented Aug 22, 2024

Scala 3.5.0 is using the default dotty.tools.MainGenericRunner: https://github.com/coursier/apps/blob/main/apps/resources/scala.json#L2

In turn, the following warning is launched:

[warning] MainGenericRunner class is deprecated since Scala 3.5.0, and Scala CLI features will not work.
[warning] Please be sure to update to the Scala CLI launcher to use the new features.
[warning] It appears that your Coursier-based Scala installation is misconfigured.
[warning] To update to the new Scala CLI runner, please update (coursier, cs) commands first before re-installing scala.
[warning] Check the Scala 3.5.0 release notes to troubleshoot your installation.

So I think we need to define a mainClass override, similar to https://github.com/coursier/apps/blob/main/apps/resources/scala.json#L35

But I don't know what's the new main class 😓

@SethTisue
Copy link

@bishabosha I think either this might interest you, or you could suggest who else might want to take a look?

@bishabosha
Copy link
Contributor

bishabosha commented Aug 22, 2024

You need to reinstall coursier, or at least try to update it first, then reinstall scala - there should probably be a note added to the blog post

e.g. if you read the error message, it tells you what to do

[warning] To update to the new Scala CLI runner, please update (coursier, cs) commands first before re-installing scala.
[warning] Check the Scala 3.5.0 release notes to troubleshoot your installation.

@JD557 did you follow the steps before opening the issue? - perhaps the message is incorrect

@bjornregnell
Copy link

Well well. Still only a few early adopters have already installed. (But I'm counting the hours until my 200+ students will go ahead and install on all sorts of boxes...)

@lego-eden
Copy link

For some reason running cs install scala:3.5.0 fixes this error message.

@bishabosha
Copy link
Contributor

bishabosha commented Aug 22, 2024

@bjornregnell hopefully this shouldn't affect users who install coursier for the first time

Edit: it seems it is incorrect - version overrides only kick in apparently for explicit versions

@bjornregnell
Copy link

bjornregnell commented Aug 22, 2024

@JD557 did you follow the steps before opening the issue?

I have followed all the steps and it only works if you give an explicit cs install scala:3.5.0 after a clean install (as pointed out by @lego-eden) , which is not apparent from the install instructions...

See further here: https://contributors.scala-lang.org/t/3-5-0-release-thread/6666/66

@bjornregnell
Copy link

@bishabosha how fast can a new cs version be released if needed? or an updated JSON if that is enough?

@bishabosha
Copy link
Contributor

bishabosha commented Aug 22, 2024

I have followed all the steps and it only works if you give an explicit cs install scala:3.5.0 after a clean install

ok I can reproduce that, perhaps we can rewrite the scala.json to make the native runner the default, and then version overrides use jvm launcher?

@bjornregnell
Copy link

that would be great! Do you know what the JSON should say instead?

@Gedochao
Copy link

@JD557 To clarify, it definitely isn't about the main class, so might be worth it to update the issue name, to avoid confusion.
For Scala 3.5.0+ it should use a native binary for the runner rather than the old scala runner JAR.
This is already happening for explicit cs install scala:3.5.0 with coursier v2.1.10, but it seems it is not when a simple update is called instead.
We'll likely need to look for a fix and release a new coursier launcher... 😕

@JD557 JD557 changed the title Scala 3.5 is using the wrong main class Scala 3.5 is using the wrong launcher Aug 22, 2024
@JD557
Copy link
Contributor Author

JD557 commented Aug 22, 2024

Ok, I edited the title to a more generic one

@bishabosha
Copy link
Contributor

bishabosha commented Aug 23, 2024

@Gedochao please check out my PR #239 - no need to release a new launcher - just the channel descriptor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants