aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-03-01 21:52:30 +0200
committerGitHub <noreply@github.com>2018-03-01 21:52:30 +0200
commita383c5c1a5821b87abaa93ea083ca96317b410ff (patch)
tree3ea1be716edbc2e79adb932748e777774056ecd3 /mesonbuild/mesonmain.py
parent5f0aeafa387894b0893877a92db5122b86c2244d (diff)
parente0d0c0166a5d9ab008de43ad65cedd529e5e16a6 (diff)
downloadmeson-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/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 7966d70..e354cce 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import sys, stat, traceback, pickle, argparse
-import time, datetime
+import sys, stat, traceback, argparse
+import datetime
import os.path
from . import environment, interpreter, mesonlib
from . import build
@@ -196,6 +196,7 @@ class MesonApp:
mlog.log('Build machine cpu:', mlog.bold(intr.builtin['build_machine'].cpu_method([], {})))
intr.run()
try:
+ dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
# We would like to write coredata as late as possible since we use the existence of
# this file to check if we generated the build file successfully. Since coredata
# includes settings, the build files must depend on it and appear newer. However, due
@@ -204,16 +205,13 @@ class MesonApp:
# possible, but before build files, and if any error occurs, delete it.
cdf = env.dump_coredata()
g.generate(intr)
- dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
- with open(dumpfile, 'wb') as f:
- pickle.dump(b, f)
+ build.save(b, dumpfile)
# Post-conf scripts must be run after writing coredata or else introspection fails.
g.run_postconf_scripts()
except:
os.unlink(cdf)
raise
-
def run_script_command(args):
cmdname = args[0]
cmdargs = args[1:]