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

Add support for Windows and Java 11 #9

Merged
merged 18 commits into from
Sep 9, 2020
Merged

Conversation

olafurpg
Copy link
Member

@olafurpg olafurpg commented Sep 8, 2020

Fixes #8
Fixes #7

@olafurpg
Copy link
Member Author

olafurpg commented Sep 8, 2020

Getting this error message on Windows

 Error while downloading https://repo1.maven.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.jar: Shutdown in progress, ignoring it
Error while downloading https://repo1.maven.org/maven2/com/github/alexarchambault/case-app_2.12/2.0.0/case-app_2.12-2.0.0.jar: Shutdown in progress, ignoring it
Error while downloading https://repo1.maven.org/maven2/com/github/alexarchambault/case-app-annotations_2.12/2.0.0/case-app-annotations_2.12-2.0.0.jar: Shutdown in progress, ignoring it
Error while downloading https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.10/scala-reflect-2.12.10.jar: Shutdown in progress, ignoring it
[error] java.io.FileNotFoundException: C:\Users\runneradmin\AppData\Local\Coursier\cache\v1\.structure.lock (The process cannot access the file because it is being used by another process)
[error] 	at java.io.FileOutputStream.open0(Native Method)
[error] 	at java.io.FileOutputStream.open(FileOutputStream.java:270)
[error] 	at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
[error] 	at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
[error] 	at lmcoursier.internal.shaded.coursier.paths.CachePath.withStructureLock(CachePath.java:132)
[error] 	at lmcoursier.internal.shaded.coursier.cache.CacheLocks$.withStructureLock(CacheLocks.scala:21)
[error] 	at lmcoursier.internal.shaded.coursier.cache.CacheLocks$.withLockOr(CacheLocks.scala:38)
[error] 	at lmcoursier.internal.shaded.coursier.cache.FileCache.$anonfun$download$33(FileCache.scala:508)
[error] 	at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
[error] 	at scala.util.Success.$anonfun$map$1(Try.scala:255)
[error] 	at scala.util.Success.map(Try.scala:213)

I'm not sure how to proceed, any help would be appreciated!

@olafurpg olafurpg mentioned this pull request Sep 8, 2020
@olafurpg olafurpg force-pushed the windows branch 6 times, most recently from 3afacfe to 09e5782 Compare September 8, 2020 19:42
@olafurpg
Copy link
Member Author

olafurpg commented Sep 8, 2020

After ~10 different attempts to get native-image working on Windows I gave up on automatic GraalVM installation. Nothing changes for Linux or macOS users but Windows users will need to pre-install native-image and make it available at $JAVA_HOME\bin\native-image.cmd. I'd love to improve this in the future but for now it's the only way I could get it working.

@olafurpg
Copy link
Member Author

olafurpg commented Sep 8, 2020

Can somebody with a Windows computer confirm the following auto-generated binary works?

https://github.com/scalameta/sbt-native-image/suites/1162040324/artifacts/16850330

This commits moves to using `gu install native-image` instead of
`coursier launch --jvm graalvm svm`. The second approach doesn't appear
to work well with Java 11.
@olafurpg
Copy link
Member Author

olafurpg commented Sep 9, 2020

Looks like it's possible after all to support automatic installation on Windows \o/ This allows the GitHub Actions workflow configuration to build binaries for Windows+macOS+Linux in a single matrix 😎

@olafurpg olafurpg changed the title Experiment with running native-image on Windows Add support for Windows and Java 11 Sep 9, 2020
@olafurpg olafurpg merged commit 56700d2 into scalameta:master Sep 9, 2020
@olafurpg olafurpg deleted the windows branch September 9, 2020 19:49
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 this pull request may close these issues.

Windows support Support Java 11 based graalvm distributions
1 participant