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

after dist/mkPack, running ./dist/bin/scalac doesn't work #15588

Open
som-snytt opened this issue Jul 5, 2022 · 2 comments
Open

after dist/mkPack, running ./dist/bin/scalac doesn't work #15588

som-snytt opened this issue Jul 5, 2022 · 2 comments

Comments

@som-snytt
Copy link
Contributor

Compiler version

Latest

Minimized code

Scala 2 repo:

$ sbt dist/mkPack

$ build/pack/bin/scalac -version
Scala compiler version 2.13.5-20201119-215247-c758143 -- Copyright 2002-2020, LAMP/EPFL and Lightbend, Inc.

Output

Scala 3 repo:

$ sbt -no-colors dist/pack
[fix CR-NL in script files]
$ dist/bin/scalac -version
Error: Could not find or load main class dotty.tools.MainGenericCompiler
Caused by: java.lang.ClassNotFoundException: dotty.tools.MainGenericCompiler

However, release versions work

$ sdk use scala 3.1.3
$ scalac -version
Scala compiler version 3.1.3 -- Copyright 2002-2022, LAMP/EPFL

Expectation

Just work.

Also we need to pun on dist/bin and dust/bin.

@som-snytt som-snytt added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 5, 2022
@rochala rochala added area:tooling compat:windows and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 5, 2022
@SethTisue SethTisue reopened this Apr 9, 2024
@SethTisue SethTisue changed the title locally built scalac doesn't just work under cygwin after dist/mkPack, running ./dist/bin/scalac doesn't work Apr 9, 2024
@SethTisue
Copy link
Member

I'm able to reproduce the problem on MacOS by starting with a clean checkout and then doing sbt dist/pack followed by chmod +x dist/bin/scalac and finally ./dist/bin/scalac -version

if I edit dist/bin/scalac and add -v so I can see what it's doing, then I see

"/usr/bin/java" -Xmx768m -Xms768m -classpath ":::::::::::::" -Dscala.usejavacp=true -Dscala.home="/Users/tisue/scala3/dist" dotty.tools.MainGenericCompiler '-version'

all those colons seem like the culprit

somewhat related: #19894 provides alternative scripts

perhaps dist/bin/scalac has bitrotted since compiler developers probably normally use the scalac task in sbt?

@som-snytt
Copy link
Contributor Author

Not a Scala 3 contributor, but I use bin/scalac, which is slow but effective for occasional use.

~/projects/dotty/bin/scalac

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

No branches or pull requests

3 participants