diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2022-07-16 00:56:30 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2022-07-31 20:43:27 +0300 |
commit | f774609b09c483d6632bfa77fb9403c0fa9927f8 (patch) | |
tree | 1b149d2275f53a48847677908ee7b62274de7ed9 /mesonbuild | |
parent | e5df70b8d3956e1c8a5d50defd000fbec8bf44a5 (diff) | |
download | meson-f774609b09c483d6632bfa77fb9403c0fa9927f8.zip meson-f774609b09c483d6632bfa77fb9403c0fa9927f8.tar.gz meson-f774609b09c483d6632bfa77fb9403c0fa9927f8.tar.bz2 |
Only reconfigure if configure options actually changed
Currently, if we run "meson configure -Doption=value", meson will
do a reconfigure when running "ninja build" afterwards, even if
the new value is the same one that was already configured previously.
To avoid this unnecessary reconfigure, let's use replace_if_different()
instead of unconditionally replacing the conf file in coredata's save()
function.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/coredata.py | 4 | ||||
-rw-r--r-- | mesonbuild/mconf.py | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 0094796..17133f5 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -23,7 +23,7 @@ from .mesonlib import ( MesonException, EnvironmentException, MachineChoice, PerMachine, PerMachineDefaultable, default_libdir, default_libexecdir, default_prefix, split_args, OptionKey, OptionType, stringlistify, - pickle_load + pickle_load, replace_if_different ) from .wrap import WrapMode import ast @@ -1066,7 +1066,7 @@ def save(obj: CoreData, build_dir: str) -> str: pickle.dump(obj, f) f.flush() os.fsync(f.fileno()) - os.replace(tempfilename, filename) + replace_if_different(filename, tempfilename) return filename diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index aa49949..227da6d 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -93,7 +93,6 @@ class Conf: # Do nothing when using introspection if self.default_values_only: return - # Only called if something has changed so overwrite unconditionally. coredata.save(self.coredata, self.build_dir) # We don't write the build file because any changes to it # are erased when Meson is executed the next time, i.e. when |