aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2017-04-03 17:03:56 +0100
committerSam Thursfield <sam@afuera.me.uk>2017-04-12 21:37:25 +0100
commit2db11f1383e3d9c59f54f4a742bd44ad85dce226 (patch)
tree62f68a78cca2c3d77688b533c0571c2e96ee81b8
parentc408bd6a8eb31b261170de09e20ecf8e0317152e (diff)
downloadmeson-2db11f1383e3d9c59f54f4a742bd44ad85dce226.zip
meson-2db11f1383e3d9c59f54f4a742bd44ad85dce226.tar.gz
meson-2db11f1383e3d9c59f54f4a742bd44ad85dce226.tar.bz2
Sort user commandline options when generating 'scan-build' target
We receive these options from the 'argparse' module in a random order. To ensure the build.ninja file doesn't include random variations we should sort them before writing them back out.
-rw-r--r--mesonbuild/backend/ninjabackend.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index f29a7be..63db854 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2276,7 +2276,10 @@ rule FORTRAN_DEP_HACK
cmds = []
for (k, v) in self.environment.coredata.user_options.items():
cmds.append('-D' + k + '=' + (v.value if isinstance(v.value, str) else str(v.value).lower()))
- return cmds
+ # The order of these arguments must be the same between runs of Meson
+ # to ensure reproducible output. The order we pass them shouldn't
+ # affect behaviour in any other way.
+ return sorted(cmds)
# For things like scan-build and other helper tools we might have.
def generate_utils(self, outfile):