← Back to Pull requests

[bazel] Make the link_wrapper.py tarball reproducible #1820

Open
unknown opened this pull request with 143 lines diff across 1 files
View on GitHub
unknown unknown commented on Nov 14, 2026 19:14 UTC
Author

Makes the tarball that link_wrapper.py writes depend only on the names and contents of its files, so identical links hit the Bazel remote and disk caches.

  • Builds the tarball with Python's tarfile instead of the host tar cf, which recorded mtimes, the build user and umask-dependent modes. The tar flags that fix this metadata are GNU-only, and macOS and Windows ship bsdtar.

  • Sets fixed metadata on every member: mtime 0, uid/gid 0, empty user/group names, and mode 0755 if the file is executable or 0644 otherwise.

  • Keeps the existing member order, since wasm_binary.py matches members to outputs by extension suffix.

  • Drops the need for a tar binary on the host.
  • Testing: Claude built //hello-world:hello-world-wasm twice with the caches off. The two link tarballs had different sha256s before the change and the same one after, and the extracted files were byte-identical to those from before. The build steps in test/test_bazel.sh pass on Linux x86_64; macOS and Windows were not tested locally.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01FPgbqmGErNcUeZcbNiQHZh

    Diff: 143 lines (+107 / -36) across 1 files Reviewer: DoDoENT Review duration: 23810m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.38) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.38 · 143 lines diff across 1 files
    0.38
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.297
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1820"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.7% (MEDIUM) · Higher = larger blast radius
    37.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.1% · Safe to merge
    20.1%