-
Notifications
You must be signed in to change notification settings - Fork 151
fix #4005 - native-image compiles in Windows caused by SUBST collision #4006
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
base: main
Are you sure you want to change the base?
Conversation
Gedochao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any chance for us to have an integration test for this?
While the solution looks good to me, I think it may be fragile without a test.
modules/cli/src/main/scala/scala/cli/packaging/NativeImage.scala
Outdated
Show resolved
Hide resolved
Working on it. A unit test to verify that Integration tests to verify
Integration test to verify the native-image interrupted cleanup:
|
Gedochao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
modules/integration/src/test/scala/scala/cli/integration/PackageTestDefinitions.scala
Outdated
Show resolved
Hide resolved
modules/integration/src/test/scala/scala/cli/integration/PackageTestDefinitions.scala
Outdated
Show resolved
Hide resolved
|
There's a problem with the shutdown hook that shows up in manual testing so I'm converting it to a draft while I work on it. |
The following changes are made when calling the GraalVM compiler:
availableDriveLetter()to exclude existingSUBSTeddrive letterstry/finallyblock for doing cleanup with a java shutdown hookSUBSTeddrive letteros.proc()The shutdown hook runs on JVM shutdown, including Ctrl-C and is more reliable than a
finallyblock for cleanup.Because
os.procitself creates a shutdown hook, it isn't used inside the cleanup method.For readability, (2 Windows command lines are called inside the cleanup method) a new method was created:
Although the code page is restored by the
run-native-image.batscript (see #3981), it is vulnerable to interruption byCtrl-C.