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

Avoid build.ninja changes due to order of hash table iteration #7900

Merged
merged 3 commits into from
Nov 18, 2020

Commits on Nov 15, 2020

  1. stabilize sets that are converted to lists

    The order of elements in sets cannot be relied upon, because the hash
    values are randomized by Python.  Whenever sets are converted to lists
    we need to keep their order stable, or random changes in the command line
    cause ninja to rebuild a lot of files unnecessarily.  To stabilize them,
    use either sort or OrderedSet.  Sorting is not always applicable, but it
    can be faster because it's done in C and it can produce slightly nicer
    output.
    bonzini committed Nov 15, 2020
    Configuration menu
    Copy the full SHA
    fc9b0cb View commit details
    Browse the repository at this point in the history
  2. stabilize iteration order for dictionaries

    The order of keys in dictionaries cannot be relied upon, because the hash
    values are randomized by Python.  Whenever we iterate on dictionaries and
    meson.build generates a list during the iteration, the different iteration
    orders may cause random changes in the command line and cause ninja to
    rebuild a lot of files unnecessarily.
    bonzini committed Nov 15, 2020
    Configuration menu
    Copy the full SHA
    4caa057 View commit details
    Browse the repository at this point in the history
  3. ninjabackend: stabilize order of dependencies and order-only dependen…

    …cies
    
    These do not go into the command line, and therefore do not matter
    for the purpose of avoiding unnecessary rebuilds after meson is
    rerun.  However, they complicate the task of finding differences
    between build lines across meson reruns.
    
    So take the easy way out and sort everything after | and ||.
    With this change, there is absolutely no change in QEMU's 40000-line
    build.ninja file after meson is rerun.
    bonzini committed Nov 15, 2020
    Configuration menu
    Copy the full SHA
    0b2865e View commit details
    Browse the repository at this point in the history