Skip to content

Add cargo-zigbuild for release dockerfile#4805

Merged
hangc0276 merged 2 commits into
apache:masterfrom
hangc0276:chenhang/add_cargo-zigbuild_for_release_script
Jun 1, 2026
Merged

Add cargo-zigbuild for release dockerfile#4805
hangc0276 merged 2 commits into
apache:masterfrom
hangc0276:chenhang/add_cargo-zigbuild_for_release_script

Conversation

@hangc0276
Copy link
Copy Markdown
Contributor

Descriptions of the changes in this PR:

Fix #xyz

Main Issue: #xyz

BP: #xyz

Motivation

When releasing BookKeeper with command ./dev/release/002-release-prepare.sh, it build failed with following exception

[INFO] [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (cargo-zigbuild-amd64-gnu) on project native-io: Command execution failed.: Cannot run program "cargo" (in directory "/home/hangc/Downloads/tmp/bk-release/bookkeeper/native-io/src/main/native-io-jni/rust"): error=2, No such file or directory -> [Help 1]
[INFO] [ERROR]
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] [ERROR]
[INFO] [ERROR] After correcting the problems, you can resume the build with the command
[INFO] [ERROR]   mvn <args> -rf :native-io

Changes

(Describe: what changes you have made)


In order to uphold a high standard for quality for code contributions, Apache BookKeeper runs various precommit
checks for pull requests. A pull request can only be merged when it passes precommit checks.


Be sure to do all the following to help us incorporate your contribution
quickly and easily:

If this PR is a BookKeeper Proposal (BP):

  • Make sure the PR title is formatted like:
    <BP-#>: Description of bookkeeper proposal
    e.g. BP-1: 64 bits ledger is support
  • Attach the master issue link in the description of this PR.
  • Attach the google doc link if the BP is written in Google Doc.

Otherwise:

  • Make sure the PR title is formatted like:
    <Issue #>: Description of pull request
    e.g. Issue 123: Description ...
  • Make sure tests pass via mvn clean apache-rat:check install spotbugs:check.
  • Replace <Issue #> in the title with the actual Issue number.

@hangc0276 hangc0276 self-assigned this May 29, 2026
@void-ptr974
Copy link
Copy Markdown
Contributor

Thanks for working on this!

I tested this locally with Colima. The overall approach works, but the Docker image build currently misses one dependency: Zig is downloaded as a .tar.xz archive and extracted with tar -xJ, while the base image does not include xz.

Adding xz-utils to the apt-get install list fixes the image build for me. After that, I also verified mvn -B -pl native-io -am -DskipTests package inside the image, and both linux-x86_64-gnu and linux-aarch64-gnu native libraries were generated successfully.

Comment thread dev/release/Dockerfile Outdated
@@ -23,3 +23,22 @@ RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y g++ cmake gnupg2 vim subversion less zip unzip
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.

apt-get install -y g++ cmake gnupg2 vim subversion less zip unzip xz-utils

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed.

@hangc0276 hangc0276 added this to the 4.18.0 milestone Jun 1, 2026
@hangc0276 hangc0276 merged commit 0af6e60 into apache:master Jun 1, 2026
20 checks passed
hangc0276 added a commit that referenced this pull request Jun 1, 2026
* Add cargo-zigbuild for release dockerfile

* address comments

(cherry picked from commit 0af6e60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants