Skip to content

Add repro-check tool for build reproducibility #962

@windsunil

Description

@windsunil

Proposal

I propose adding a new in-tree tool, repro-check, to the rust-lang/rust repository. It allows developers to easily verify if Rust compiler builds are reproducible.

This is an MCP because it adds a new tool to src/tools/ and integrates with the bootstrap system (x.py).

The implementation is available in PR rust-lang/rust#149888.

Motivation

Currently, checking if compiler builds are reproducible is a manual, error-prone process. We lack an in-tree tool to automatically compare builds and pinpoint differences. This tool aims to solve that by automating the comparison.

Design and Usage

The source is located at src/tools/repro-check.

The tool is registered in x.py, allowing it to run within the existing workflow. When executed, it:

  1. Builds the compiler twice (Stage 2 by default) in separate directories.
  2. Compares artifacts byte-for-byte (SHA-256).
  3. Generates an HTML report highlighting identical vs. differing files.

Impact and Maintenance

  • Status: Experimental, opt-in tool for local development.
  • CI Impact: None. It does not run on PR CI.
  • Future direction: Eventually, we want to run this automatically to detect regressions (e.g., in Nightly or Release builds). We will gather data and evaluate infrastructure costs before proposing any automation.
  • Maintenance: Discussed with @Kobzol and the Infra team. We plan to merge this as an experiment.

Non-goals (for now)

  • No automatic execution in CI.
  • Does not block PRs or releases.
  • Does not analyze the root cause of differences, only reports them.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions