Skip to content

build(examples): standardize example workflow around ELF binaries, remove unused .bin artifacts#24

Merged
this-vishalsingh merged 1 commit into
ZippelLabs:mainfrom
mahantybiplab:build/standardize-elf-examples
May 1, 2026
Merged

build(examples): standardize example workflow around ELF binaries, remove unused .bin artifacts#24
this-vishalsingh merged 1 commit into
ZippelLabs:mainfrom
mahantybiplab:build/standardize-elf-examples

Conversation

@mahantybiplab
Copy link
Copy Markdown
Contributor

Motivation

The example docs and build_all.sh instructed users to strip ELF headers with objcopy, producing raw .bin files. However, zp1-executor's ElfLoader requires ELF headers to load memory segments — passing a stripped binary causes an Invalid ELF file: Invalid magic error.

More importantly, no code in the repository ever consumed these .bin files. They were being generated, committed, and maintained purely as a side-effect of a build step that served no purpose. This PR removes the objcopy step, the .bin files it generated, and the documentation referencing both.


Key Changes

CLI & Execution

  • Smarter path resolution: crates/cli/src/main.rs now resolves bare example names to their compiled ELF artifacts at target/riscv32im-unknown-none-elf/release/<name>, so cargo run --release -- prove --bin fibonacci works without specifying the full path.

Build Tooling

  • Removed objcopy requirement: examples/build_all.sh no longer requires LLVM/binutils. It builds and verifies ELF binaries only.

Cleanup & Documentation

  • Removed stale .bin files from example directories — these were unused artifacts with no consumers anywhere in the codebase.
  • Updated README.md and individual example docs to reflect the simplified CLI usage.
  • Updated .gitignore to exclude proofs/ and other transient build artifacts.

Verification

  • All 25 examples compiled successfully via build_all.sh for riscv32im-unknown-none-elf.
  • ElfLoader correctly parses headers and memory segments from unstripped ELF files.
  • cargo run --release -- prove --bin fibonacci resolves the ELF path and proves successfully end-to-end.
  • Full test suite passes: cargo test --workspace (162 prover tests + 16 integration tests).

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes the examples workflow to use ELF binaries end-to-end (aligning with ElfLoader requirements), removes the unused .bin artifacts, and updates CLI/docs so examples can be proved by name instead of requiring a pre-stripped raw binary.

Changes:

  • Remove objcopy/raw .bin generation from example build workflow and delete committed .bin artifacts.
  • Add CLI path fallback to resolve --bin <example-name> to the corresponding compiled ELF under examples/target/.../release/.
  • Update example documentation and .gitignore to reflect the ELF-only flow and ignore generated proofs.

Reviewed changes

Copilot reviewed 9 out of 35 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
crates/cli/src/main.rs Adds fallback resolution for prove --bin <name> into the examples ELF output directory.
examples/build_all.sh Stops generating .bin files; now builds ELF artifacts only and prints ELF sizes.
examples/README.md Updates example commands to remove objcopy and use prove --bin <name> (but needs follow-up consistency fixes).
examples/fibonacci/README.md Updates build/run instructions to use ELF-only proving flow.
examples/keccak/README.md Updates build/run instructions to use ELF-only proving flow.
examples/sha256/README.md Updates build/run instructions to use ELF-only proving flow.
examples/memory-test/README.md Updates build/run instructions to use ELF-only proving flow.
examples/ecrecover/README.md Updates build/run instructions to use ELF-only proving flow.
.gitignore Ignores /proofs output directory.
.vscode/settings.json Removes editor-specific settings file from the repo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/fibonacci/README.md
Comment thread examples/build_all.sh
Comment thread examples/build_all.sh
Comment thread examples/sha256/README.md
Comment thread examples/memory-test/README.md
Comment thread examples/keccak/README.md
Comment thread examples/ecrecover/README.md
Comment thread examples/README.md
Comment thread examples/build_all.sh
Comment thread crates/cli/src/main.rs
@this-vishalsingh this-vishalsingh self-assigned this May 1, 2026
@this-vishalsingh this-vishalsingh self-requested a review May 1, 2026 03:36
@this-vishalsingh this-vishalsingh merged commit bb6f10d into ZippelLabs:main May 1, 2026
4 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.

3 participants