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

Fix detection of bundled runtime with --jvm option #12318

Merged
merged 3 commits into from
Feb 20, 2025

Conversation

Akirathan
Copy link
Member

@Akirathan Akirathan commented Feb 18, 2025

Fixes #12302

Pull Request Description

Running

$ ./enso-linux-x86_64-2025.1.1-nightly.2025.2.18.AppImage --appimage-extract
$ ./squashfs-root/resources/enso/dist/2025.1.1-nightly.2025.2.18/bin/enso --jvm --run tmp.enso

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:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

So that it detects if it is run from a portable distribution
@Akirathan Akirathan self-assigned this Feb 18, 2025
@Akirathan Akirathan added the CI: No changelog needed Do not require a changelog entry for this PR. label Feb 18, 2025
@@ -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);
Copy link
Contributor

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.

Copy link
Contributor

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());
Copy link
Contributor

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

Copy link
Member Author

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

Copy link
Member

@JaroslavTulach JaroslavTulach left a 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...

@Akirathan Akirathan force-pushed the wip/akirathan/12302-jvm-opt-fix branch from 4fdec0b to 268be33 Compare February 19, 2025 09:40
@Akirathan
Copy link
Member Author

Any chance to write a test for this? We don't want to verify this manually with every release...

@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 --jvm option testing in Engine Checks workflow - see

.

Unfortunately, we don't have any "engine integration test" yet, so we will have to keep an eye out for this after every release.

@Akirathan Akirathan merged commit 1f43b02 into develop Feb 20, 2025
51 of 52 checks passed
@Akirathan Akirathan deleted the wip/akirathan/12302-jvm-opt-fix branch February 20, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Native enso bundle contains GraalVM, but --jvm cannot find it
3 participants