From c01b183e5478eab213f53224a5c2589db3e6c710 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 15 Jul 2016 18:11:42 +0530 Subject: [PATCH] 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' --- mesonbuild/mesonmain.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 3f5612b49..737352e37 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]