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

Don't sort a Vec before computing its DepTrackingHash #85702

Merged
merged 1 commit into from
May 31, 2021

Commits on May 26, 2021

  1. Don't sort a Vec before computing its DepTrackingHash

    Previously, we sorted the vec prior to hashing, making the hash
    independent of the original (command-line argument) order. However, the
    original vec was still always kept in the original order, so we were
    relying on the rest of the compiler always working with it in an
    'order-independent' way.
    
    This assumption was not being upheld by the `native_libraries` query -
    the order of the entires in its result depends on the order of entries
    in `Options.libs`. This lead to an 'unstable fingerprint' ICE when the
    `-l` arguments were re-ordered.
    
    This PR removes the sorting logic entirely. Re-ordering command-line
    arguments (without adding/removing/changing any arguments) seems like a
    really niche use case, and correctly optimizing for it would require
    additional work. By always hashing arguments in their original order, we
    can entirely avoid a cause of 'unstable fingerprint' errors.
    Aaron1011 committed May 26, 2021
    Configuration menu
    Copy the full SHA
    605513a View commit details
    Browse the repository at this point in the history