-
Notifications
You must be signed in to change notification settings - Fork 328
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
Fix detection of bundled runtime with --jvm option #12318
Conversation
So that it detects if it is run from a portable distribution
@@ -68,7 +69,10 @@ private static boolean isOnWindows() { | |||
*/ | |||
private static Path findJavaExecutableInDistributionRuntimes() { | |||
var env = new Environment() {}; | |||
var distributionManager = new DistributionManager(env); | |||
var distributionManager = new PortableDistributionManager(env); |
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.
There should not be a PortableDistributionManager
. The DistributionManager
itself should decide whether it deals with the portable distribution or not.
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.
I know it's kind of unrelated, just quite surprised that the DistributionManager
can't do that.
@@ -89,6 +93,9 @@ private static Path findJavaExecutableInDistributionRuntimes() { | |||
versionUsedForBuild); | |||
return newerRuntime.get().javaExecutable(); | |||
} | |||
logger.trace("No appropriate runtime found in the distribution."); | |||
logger.trace("graalVersionManager.getAllRuntimes() = {}", graalVersionManager.getAllRuntimes()); | |||
logger.trace("Paths of distributionManager = {}", distributionManager.paths()); |
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.
It's better to use a single log line. Multiple lines can be mixed up with other logs making the output less clear
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.
Good point. Fixed in 268be33
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.
- I was hoping the fix to be related to distribution manager
- Any change to write a test for this?
- We don't want to verify this manually with every release...
4fdec0b
to
268be33
Compare
@JaroslavTulach This can be tested only as an "engine integration test". The test needs some valid asset that we release - like the whole (extracted) AppImage or some kind of engine-bundle. We already have enso/build_tools/build/src/engine/context.rs Line 767 in 3d6f2ec
Unfortunately, we don't have any "engine integration test" yet, so we will have to keep an eye out for this after every release. |
Fixes #12302
Pull Request Description
Running
from the extracted AppImage correctly finds the bundled runtime.
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.