scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

Add --python

Open alexarchambault opened this issue 3 years ago • 4 comments

alexarchambault avatar Aug 22 '22 12:08 alexarchambault

ScalaPy native for windows doesn't work right now but I'll work on it once scalapy/scalapy#301 is settled which would make testing a lot easier.

You could also try making it work here right now by adding "-l" + nativeLibrary.get to ldflags and appending nativeLibraryPaths to PATH.

The problem currently with python-native-libs currently is I want to add nativeLibraryPaths to ldflags too so that it works for setting up sbt projects since you can't really manipulate env vars in sbt scala native (right?), but on windows paths usually have spaces in them, e.g. -LC:\Program Files\... and I'm not sure how to properly escape them. Spaces should work fine with the PATH env var though so I suspect the approach above would work.

kiendang avatar Aug 26 '22 03:08 kiendang

Oh I saw that you alr added nativeLibraryPaths to PATH, so maybe on windows adding "-l" + nativeLibrary to linking options instead of using python.ldflags for now would work.

kiendang avatar Aug 26 '22 08:08 kiendang

So looks like that was not the issue at all. Adding support for ScalaPy native on Windows turned out to be more complicated than that. I put up a summary at scalapy/scalapy#307.

kiendang avatar Sep 06 '22 09:09 kiendang

For native the SCALAPY_PYTHON_PROGRAMNAME env var should be set to python.executable too so that virtualenv works (see scalapy/scalapy#200). JVM doesn't need that coz it's alr handled via system properties.

kiendang avatar Sep 08 '22 13:09 kiendang

Closing as most of the stuff initially pushed here has been merged. Will open a new PR for the remaining things.

alexarchambault avatar Nov 18 '22 14:11 alexarchambault