Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc: Introduce Strict Version Hashes #12533

Merged
merged 3 commits into from
Feb 28, 2014
Merged

Commits on Feb 28, 2014

  1. rustc: Simplify crate loading constraints

    The previous code passed around a {name,version} pair everywhere, but this is
    better expressed as a CrateId. This patch changes these paths to store and pass
    around crate ids instead of these pairs of name/version. This also prepares the
    code to change the type of hash that is stored in crates.
    alexcrichton committed Feb 28, 2014
    Configuration menu
    Copy the full SHA
    8213e18 View commit details
    Browse the repository at this point in the history
  2. rustc: Add the concept of a Strict Version Hash

    This new SVH is used to uniquely identify all crates as a snapshot in time of
    their ABI/API/publicly reachable state. This current calculation is just a hash
    of the entire crate's AST. This is obviously incorrect, but it is currently the
    reality for today.
    
    This change threads through the new Svh structure which originates from crate
    dependencies. The concept of crate id hash is preserved to provide efficient
    matching on filenames for crate loading. The inspected hash once crate metadata
    is opened has been changed to use the new Svh.
    
    The goal of this hash is to identify when upstream crates have changed but
    downstream crates have not been recompiled. This will prevent the def-id drift
    problem where upstream crates were recompiled, thereby changing their metadata,
    but downstream crates were not recompiled.
    
    In the future this hash can be expanded to exclude contents of the AST like doc
    comments, but limitations in the compiler prevent this change from being made at
    this time.
    
    Closes rust-lang#10207
    alexcrichton committed Feb 28, 2014
    Configuration menu
    Copy the full SHA
    ec57db0 View commit details
    Browse the repository at this point in the history
  3. syntax: Expand format!() deterministically

    Previously, format!("{a}{b}", a=foo(), b=bar()) has foo() and bar() run in a
    nondeterminisc order. This is clearly a non-desirable property, so this commit
    uses iteration over a list instead of iteration over a hash map to provide
    deterministic code generation of these format arguments.
    alexcrichton committed Feb 28, 2014
    5 Configuration menu
    Copy the full SHA
    017c504 View commit details
    Browse the repository at this point in the history