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

Shell scripts don't quote Scala home, breaks on paths with spaces, affects WSL #15823

Closed
rubin55 opened this issue Aug 5, 2022 · 2 comments
Closed

Comments

@rubin55
Copy link
Contributor

rubin55 commented Aug 5, 2022

Compiler version

Scala compiler version 3.1.3 -- Copyright 2002-2022, LAMP/EPFL

How to reproduce

  1. Install Scala somewhere with spaces, like C:\Program Files\Scala\scala3
  2. Notice that WSL automagically adds Scala to the path because Windows has it in its path
  3. Try to run Scala.. see error

Output

# uname -a
Linux SURFACE 4.4.0-22000-Microsoft #832-Microsoft Fri Jul 15 14:40:00 PST 2022 aarch64 GNU/Linux
# which scala
/mnt/c/Program Files/Scala/scala3/bin/scala
# scala -version
Error: Could not find or load main class Files.Scala.scala3
Caused by: java.lang.ClassNotFoundException: Files.Scala.scala3

Expectation

Scala's shell scripts should (like its batch counterparts, and like other Java-based utilities, like ant, maven, gradle, groovy) handle paths with spaces. This is especially noticable by people who use Scala on windows in combination with WSL.

@rubin55 rubin55 added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Aug 5, 2022
@rubin55
Copy link
Contributor Author

rubin55 commented Aug 5, 2022

The fix is super simple, I created a pull request for it. Hope it's ok. After adding of quotes:

# scala -version
Scala code runner version 3.1.3 -- Copyright 2002-2022, LAMP/EPFL

@WojciechMazur WojciechMazur added area:tooling and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Aug 5, 2022
@WojciechMazur
Copy link
Contributor

Fixed by #15824

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

2 participants