Skip to content

docs(AGENTS): add concise reproducibility recipes for build.sh#259

Merged
bryan-minimal merged 1 commit into
mainfrom
bryan/agents-repro-section
Jun 17, 2026
Merged

docs(AGENTS): add concise reproducibility recipes for build.sh#259
bryan-minimal merged 1 commit into
mainfrom
bryan/agents-repro-section

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Jun 17, 2026

Copy link
Copy Markdown
Member

What

Adds a concise Reproducibility (required) subsection to the "Creating packages workflow → Step 3: Write build.sh" section of AGENTS.md (which CLAUDE.md symlinks to).

Why

Step 3's existing build.sh patterns (Autotools / CMake / Go / Rust) include no determinism flags — so a package authored by copying them defaults to non-reproducible. Reproducibility was mentioned only abstractly elsewhere in the doc (no actionable recipes). The build cache is content-addressed, so non-reproducible outputs undermine cache trust and cross-machine verification.

What's in it

A self-contained, tool-agnostic recipe per build system:

  • C/C++-ffile-prefix-map, -gno-record-gcc-switches, -Wl,--build-id=none, ARFLAGS=Drc (+ --enable-deterministic-archives)
  • Go-trimpath -ldflags "-buildid=" (+ -buildvcs=false when a .git dir is present)
  • Rust--remap-path-prefix (build dir + cargo registry); -C codegen-units=1 + CONST_RANDOM_SEED=0 for the deeper codegen/compile-time-RNG cases
  • Linux kernelKBUILD_BUILD_TIMESTAMP/_USER/_HOST
  • Embedded timestampsSOURCE_DATE_EPOCH=0 (+ PYTHONHASHSEED=0)
  • Post-install — drop libtool .la archives
  • Verify — build twice, compare $OUTPUT_DIR byte-for-byte

Plus a pointer at the top of Step 3 so the patterns aren't taken as complete on their own. Links to https://reproducible-builds.org/ for background. No references to private/internal tooling.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Build documentation now includes explicit reproducibility requirements for all package builds
    • Provides determinism guidance across multiple build systems including C/C++, Go, Rust, Linux kernel, and embedded timestamps
    • Includes verification instructions for confirming reproducible builds through rebuild comparison

Step 3's build.sh patterns (autotools/cmake/go/rust) carried no
determinism flags, so packages authored from them defaulted to
non-reproducible. Add a "Reproducibility (required)" subsection with the
per-language one-liners (build-id, path remap, deterministic ar,
SOURCE_DATE_EPOCH, kernel KBUILD_BUILD_*) and a build-twice verify step,
plus a pointer from the top of Step 3. Links to reproducible-builds.org
for background; kept tool-agnostic (no private/internal tooling refs).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e2c45ada-7f77-4ebc-bbc2-0648189cf4a9

📥 Commits

Reviewing files that changed from the base of the PR and between 1624946 and b72ce01.

📒 Files selected for processing (1)
  • AGENTS.md

📝 Walkthrough

Walkthrough

Adds 30 lines to AGENTS.md: a top-level requirement statement in the "Step 3: Write build.sh" section mandating reproducible builds, and a new "Reproducibility (required)" subsection enumerating determinism flags for C/C++, Go, Rust, Linux kernel, embedded timestamps, and post-install cleanup, plus a verification procedure using $OUTPUT_DIR comparison.

Changes

Reproducibility Documentation

Layer / File(s) Summary
Reproducibility requirement and recipes
AGENTS.md
Inserts a requirement statement that every build must be reproducible and a new subsection defining byte-identical output, determinism flags for multiple ecosystems (C/C++, Go, Rust, Linux kernel, embedded timestamps, post-install cleanup), and a $OUTPUT_DIR diff-based verification step.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 Hop, hop, I compile again,
Same bytes each time, no random strain!
-ffile-prefix-map keeps paths tame,
SOURCE_DATE_EPOCH — timestamps the same.
Diff the trees, no surprises hide,
Deterministic builds, a bunny's pride! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding reproducibility documentation/recipes to the build.sh section of AGENTS.md.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bryan/agents-repro-section

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

@msample msample left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Nice!

@bryan-minimal bryan-minimal added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit 03a9faf Jun 17, 2026
4 checks passed
@bryan-minimal bryan-minimal deleted the bryan/agents-repro-section branch June 17, 2026 17:23
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