aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-07-15 18:11:42 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-07-15 18:12:33 +0530
commitc01b183e5478eab213f53224a5c2589db3e6c710 (patch)
tree54ebd222d4a14d6d8021296bc5924411289cd64d
parent64919b1c7463d2adceec961350f33707cae9718b (diff)
downloadmeson-c01b183e5478eab213f53224a5c2589db3e6c710.zip
meson-c01b183e5478eab213f53224a5c2589db3e6c710.tar.gz
meson-c01b183e5478eab213f53224a5c2589db3e6c710.tar.bz2
mesonmain: Dump the coredata last
Otherwise we'll mark the build directory as successfully configured even if there's an error while doing the actual generation. Reported on IRC by 'sdgsgad'
-rw-r--r--mesonbuild/mesonmain.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 3f5612b..737352e 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -156,11 +156,16 @@ itself as required.'''
mlog.log('Build machine cpu family:', mlog.bold(intr.builtin['build_machine'].cpu_family_method([], {})))
mlog.log('Build machine cpu:', mlog.bold(intr.builtin['build_machine'].cpu_method([], {})))
intr.run()
- env.dump_coredata()
g.generate(intr)
g.run_postconf_scripts()
dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
pickle.dump(b, open(dumpfile, 'wb'))
+ # Write this last since we use the existence of this file to check if
+ # we generated the build file successfully, so we don't want an error
+ # that pops up during generation, post-conf scripts, etc to cause us to
+ # incorrectly signal a successful meson run which will cause an error
+ # about an already-configured build directory when the user tries again.
+ env.dump_coredata()
def run_script_command(args):
cmdname = args[0]