Skip to content

Migrate build system from GraalVM native-image to jbundle#8

Merged
lmangani merged 7 commits intomainfrom
copilot/build-with-jbundle-action
Jan 25, 2026
Merged

Migrate build system from GraalVM native-image to jbundle#8
lmangani merged 7 commits intomainfrom
copilot/build-with-jbundle-action

Conversation

Copy link

Copilot AI commented Jan 25, 2026

Integration Plan: Replace GraalVM with jbundle

  • Install and test jbundle locally to understand its behavior
  • Update release-builds.yml workflow to use jbundle instead of GraalVM native-image
    • Add jbundle installation step (build from source using Rust/Cargo)
    • Replace native build steps with jbundle commands for Linux
    • Replace native build steps with jbundle commands for macOS
    • Update artifact packaging to include jbundle output
  • Update ci-build.yml workflow to use jbundle for testing
    • Add jbundle installation step
    • Replace native build steps with jbundle for Linux
    • Replace native build steps with jbundle for macOS
    • Add runtime tests to verify binaries launch correctly (Linux & macOS)
    • Fix test reliability issues (proper waiting and process checking)
  • Update README.md with new build instructions for jbundle
    • Update release process documentation
    • Remove Windows references (not yet supported by jbundle)
    • Fix platform support documentation inconsistency
  • Address security concerns from code review
    • Pin jbundle to specific commit hash (f722ab543a57e7fc496656c72198c71efe52e89c)
  • Address code review feedback
    • Fixed documentation to correctly state Linux/macOS support only
    • Improved runtime test scripts to avoid race conditions
  • Fix CI failures
    • Added Java 21 setup step for jbundle to compile Java source code

Summary of Changes

This PR completely migrates the build system from GraalVM native-image to jbundle for creating self-contained binaries with embedded JVMs.

Latest Fix (CI Failure Resolution)

Issue: The Linux CI build was failing because jbundle needs a JDK to compile the Java source code before bundling it into a self-contained binary.

Solution: Added Java 21 setup step before jbundle build in all workflows. jbundle will:

  1. Use the JDK to compile the Java source code
  2. Bundle the compiled code with an embedded JVM
  3. Create a self-contained binary that doesn't require Java to run

Key Features

Self-contained binaries - No Java installation required to run
Linux & macOS support - Fully tested with runtime launch verification
Security - jbundle version pinned to specific commit
CI Testing - Automated build and runtime tests for both platforms
Clean builds - Java 21 for compilation, embedded JVM for runtime

Platform Support

  • Linux (amd64): ✅ Supported with Xvfb headless testing
  • macOS (arm64): ✅ Supported with runtime testing
  • Windows: ❌ Not yet supported by jbundle (JAR alternative documented)

Testing Improvements

  • Improved runtime tests to avoid race conditions
  • Added proper wait times for application startup
  • Captures and displays logs on failure for debugging
  • Tests verify binaries run for 8+ seconds without crashing

All CI failures should now be resolved!

Original prompt

This section details on the original issue you should resolve

<issue_title>Build with jbundle</issue_title>
<issue_description>We want to build and distribute our java app using jbundle (https://github.com/avelino/jbundle) to Package our app into a into self-contained binary. No JVM installation required to run the output.

project/jar → jbundle → single binary (runs anywhere)

We want to redesign our build github action to use jbundle and create distribution files (multiplatform) upon a release

Installation From source

git clone https://github.com/avelino/jbundle.git
cd jbundle
cargo install --path .

Usage

Build with specific Java version

jbundle build --input . --output ./dist/app --java-version 21

Cross-platform target

jbundle build --input . --output ./dist/app --target linux-x64

Pass JVM arguments

jbundle build --input . --output ./dist/app --jvm-args "-Xmx512m"

CLI profile (fast startup, optimized for short-lived tools)

jbundle build --input . --output ./dist/app --profile cli

Disable AppCDS generation

jbundle build --input . --output ./dist/app --no-appcds

Enable CRaC checkpoint (Linux, requires CRaC-enabled JDK)

jbundle build --input . --output ./dist/app --crac

Show cache info

jbundle info

Clean cache

jbundle clean
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits January 25, 2026 11:29
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot AI changed the title [WIP] Redesign build GitHub action to use jbundle Migrate build system from GraalVM native-image to jbundle Jan 25, 2026
Copilot AI requested a review from lmangani January 25, 2026 11:39
@lmangani
Copy link

@copilot The OSX CI test seems to pass BUT the Linux CI test action is failing: https://github.com/tessika/SpriteLab/actions/runs/21331968204/job/61398399647

The job failed due to two key issues:

Rust build error:
Error: could not find Cargo.toml in /home/runner/work/SpriteLab/SpriteLab or any parent directory.
This suggests that the build expects a Cargo.toml file in the root of the repository or working directory, but it is missing or located elsewhere.
Solution: Ensure the Cargo.toml file is present at the root of your repository. If it’s located in a subdirectory, adjust your workflow to change into that directory before running Rust build commands.

Maven build error:
Error: release version 21 not supported (from the Maven compiler plugin).
This indicates the Java Development Kit (JDK) on the runner does not support Java 21, but your build requests it (see java-version: 21 in your workflow’s jbundle build step).
Solution: Add a step before building with Maven to set up JDK 21. For example, insert this before any Maven or jbundle build steps:

Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 25, 2026

@copilot The OSX CI test seems to pass BUT the Linux CI test action is failing: https://github.com/tessika/SpriteLab/actions/runs/21331968204/job/61398399647

The job failed due to two key issues:...

Fixed in commit 113573e.

The issue was that jbundle needs a JDK to compile the Java source code before bundling it. I've added a Java 21 setup step before the jbundle build in both CI and release workflows for Linux and macOS.

The workflow now:

  1. Sets up Java 21 (for compilation)
  2. Sets up Rust (for jbundle)
  3. Installs jbundle from source
  4. Runs jbundle build which uses the JDK to compile the source, then bundles it with an embedded JVM

The resulting binaries still don't require Java to run - they include their own embedded JVM.

@lmangani lmangani marked this pull request as ready for review January 25, 2026 12:03
@lmangani lmangani merged commit 6c695cd into main Jan 25, 2026
2 checks passed
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.

Build with jbundle

2 participants