Skip to content

refactor(zipapp): implement rust exe_zip_maker program - #4151

Open
rickeylev wants to merge 2 commits into
bazel-contrib:mainfrom
rickeylev:implement_rust_exe_zipmaker
Open

refactor(zipapp): implement rust exe_zip_maker program#4151
rickeylev wants to merge 2 commits into
bazel-contrib:mainfrom
rickeylev:implement_rust_exe_zipmaker

Conversation

@rickeylev

@rickeylev rickeylev commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Creating self-executable zip archives currently relies on Python script
execution during builds, which incurs interpreter startup overhead and
requires a Python runtime.

Provide a compiled Rust implementation of exe_zip_maker. The tool
computes the SHA-256 digest of the input zip archive, substitutes the
%ZIP_HASH% placeholder within the executable preamble script, and
concatenates the modified preamble with the zip payload.

This change only adds a Rust implementation. Subsequent changes will
wire it into the overall build process as a prebuilt tool.

Provide a compiled Rust implementation of exe_zip_maker to replace
the Python script for creating self-executable zip archives.

- Implement exe_zip_maker library and CLI binary in crates/exe_zip_maker
- Use sha2 crate via crate_universe for SHA-256 computation
- Add distribution filegroups and tests in tests/exe_zip_maker
WORKSPACE mode fails when expanding wildcard patterns because @rules_rust
is only configured in Bzlmod. Provide a stub repository for rules_rust in
internal_dev_deps.bzl and set size = "small" on exe_zip_maker_test.
@rickeylev
rickeylev marked this pull request as ready for review September 7, 2026 03:00
@rickeylev
rickeylev requested a review from aignas as a code owner September 7, 2026 03:00
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.

1 participant