diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-03-01 21:52:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-01 21:52:30 +0200 |
commit | a383c5c1a5821b87abaa93ea083ca96317b410ff (patch) | |
tree | 3ea1be716edbc2e79adb932748e777774056ecd3 /mesonbuild/mconf.py | |
parent | 5f0aeafa387894b0893877a92db5122b86c2244d (diff) | |
parent | e0d0c0166a5d9ab008de43ad65cedd529e5e16a6 (diff) | |
download | meson-a383c5c1a5821b87abaa93ea083ca96317b410ff.zip meson-a383c5c1a5821b87abaa93ea083ca96317b410ff.tar.gz meson-a383c5c1a5821b87abaa93ea083ca96317b410ff.tar.bz2 |
Merge pull request #3150 from trhd/setups2
Fix a data pickling bug.
Diffstat (limited to 'mesonbuild/mconf.py')
-rw-r--r-- | mesonbuild/mconf.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index 771e9ee..45b3d82 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -13,9 +13,8 @@ # limitations under the License. import sys, os -import pickle import argparse -from . import coredata, mesonlib +from . import coredata, mesonlib, build parser = argparse.ArgumentParser(prog='meson configure') @@ -31,25 +30,17 @@ class ConfException(mesonlib.MesonException): class Conf: def __init__(self, build_dir): self.build_dir = build_dir - self.coredata_file = os.path.join(build_dir, 'meson-private/coredata.dat') - self.build_file = os.path.join(build_dir, 'meson-private/build.dat') - if not os.path.isfile(self.coredata_file) or not os.path.isfile(self.build_file): + if not os.path.isdir(os.path.join(build_dir, 'meson-private')): raise ConfException('Directory %s does not seem to be a Meson build directory.' % build_dir) - with open(self.coredata_file, 'rb') as f: - self.coredata = pickle.load(f) - with open(self.build_file, 'rb') as f: - self.build = pickle.load(f) - if self.coredata.version != coredata.version: - raise ConfException('Version mismatch (%s vs %s)' % - (coredata.version, self.coredata.version)) + self.build = build.load(self.build_dir) + self.coredata = coredata.load(self.build_dir) def clear_cache(self): self.coredata.deps = {} def save(self): # Only called if something has changed so overwrite unconditionally. - with open(self.coredata_file, 'wb') as f: - pickle.dump(self.coredata, f) + 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 # Ninja is run. |