Skip to content

fix: honor JBANG_USE_NATIVE when updating - #2616

Open
arnabnandy7 wants to merge 6 commits into
jbangdev:mainfrom
arnabnandy7:fix/update-jbang-use-native
Open

fix: honor JBANG_USE_NATIVE when updating#2616
arnabnandy7 wants to merge 6 commits into
jbangdev:mainfrom
arnabnandy7:fix/update-jbang-use-native

Conversation

@arnabnandy7

Copy link
Copy Markdown
Contributor

Summary

Fixes #2611.

jbang version --update now respects JBANG_USE_NATIVE. When native mode is enabled, JBang downloads and installs the release bundle matching the current operating system and architecture instead of always downloading the generic JAR-based package.

On Windows, an in-use native executable is staged as .exe.new and replaced by the launcher on the next invocation.

The JBANG_USE_NATIVE installation documentation and relevant tests have also been updated.

Validation

  • ./gradlew spotlessCheck compileTestJava
  • ./gradlew test --tests "dev.jbang.cli.TestApp"
  • PowerShell tests in TestScriptNativeDownload

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a2030667-0874-4c7c-bcec-929a8acb35d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@quintesse quintesse left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

I would like to see one change though, Right now it only uses the JBANG_USE_NATIVE environment variable to determine if it should install a native bundle or not.

I would suggest that if you're currently running the native version it should also take that as a sign to install the native bundle. (Who knows, perhaps the user simply ran the native executable manually instead of setting JBANGT_USE_NATIVE)

@arnabnandy7

Copy link
Copy Markdown
Contributor Author

@quintesse the requested behavior is now implemented. Native bundle selection will now triggered by either JBANG_USE_NATIVE=true or JavaUtil.inNativeImage().

Comment thread src/main/java/dev/jbang/cli/App.java Outdated
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@arnabnandy7
arnabnandy7 requested review from koppor and quintesse July 22, 2026 08:37
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Comment thread src/main/scripts/jbang.cmd
quintesse
quintesse previously approved these changes Jul 22, 2026

@quintesse quintesse left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it works , any improvements can always be done at a later time

…e-native

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>

# Conflicts:
#	src/main/java/dev/jbang/cli/App.java
@arnabnandy7

Copy link
Copy Markdown
Contributor Author

@quintesse fixed merge conflict in one of the file, please re-review

@arnabnandy7
arnabnandy7 requested a review from quintesse August 14, 2026 18:48
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.

Update should take into account JBANG_USE_NATIVE

4 participants