From 43101489cd7b310996badaef19638ec3adbec532 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 25 Oct 2018 12:19:23 -0400 Subject: Recover when coredata cannot be loaded Write command line options into a separate file to be able to reconfigure from scatch in the case coredata cannot be loaded. The most common case is when we are reconfiguring with a newer meson version. This means that we should try as much as possible to maintain backward compatibility for the cmd_line.txt file format. The main difference with a normal reconfigure is it will use new default options values and will read again environment variables like CFLAGS, etc. --- mesonbuild/msetup.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mesonbuild/msetup.py') diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index 4256272..df6ba46 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py @@ -168,6 +168,10 @@ class MesonApp: build.save(b, dumpfile) # Post-conf scripts must be run after writing coredata or else introspection fails. intr.backend.run_postconf_scripts() + if env.first_invocation: + coredata.write_cmd_line_file(self.build_dir, self.options) + else: + coredata.update_cmd_line_file(self.build_dir, self.options) except: if 'cdf' in locals(): old_cdf = cdf + '.prev' -- cgit v1.1