aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorHemmo Nieminen <hemmo.nieminen@iki.fi>2018-03-01 00:25:12 +0200
committerHemmo Nieminen <hemmo.nieminen@iki.fi>2018-03-01 01:06:51 +0200
commit7fb8e518b2666aa7eea0cf63b830884f2bfeb269 (patch)
treeb60af0dfa3859f71108cdbe77d7750bd89028462 /mesonbuild/mesonmain.py
parentb0446075ec8e7e3e1506610f03417da14d4a7b08 (diff)
downloadmeson-7fb8e518b2666aa7eea0cf63b830884f2bfeb269.zip
meson-7fb8e518b2666aa7eea0cf63b830884f2bfeb269.tar.gz
meson-7fb8e518b2666aa7eea0cf63b830884f2bfeb269.tar.bz2
Harmonize data pickling.
Try to be more consistent on using save() and load() methods to pickle data.
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:]