aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2019-07-29 12:03:26 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2019-07-30 18:04:45 +0300
commit645a8584fede006915f053de4787e1cef610f2d9 (patch)
treeda8f4d383a6e09da64ea82899a1ab8931f4dc3bc
parentc904d3eefe2a01ca60027e2a5192e1f1c7ca5d9d (diff)
downloadmeson-645a8584fede006915f053de4787e1cef610f2d9.zip
meson-645a8584fede006915f053de4787e1cef610f2d9.tar.gz
meson-645a8584fede006915f053de4787e1cef610f2d9.tar.bz2
dist: Pass right build options when configuring dist directory
Fixes https://github.com/mesonbuild/meson/issues/5732
-rw-r--r--mesonbuild/mdist.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py
index 7af0194..2d1aaf9 100644
--- a/mesonbuild/mdist.py
+++ b/mesonbuild/mdist.py
@@ -20,6 +20,7 @@ import sys
import shutil
import subprocess
import hashlib
+import json
from glob import glob
from mesonbuild.environment import detect_ninja
from mesonbuild.mesonlib import windows_proof_rmtree
@@ -143,7 +144,7 @@ def create_dist_hg(dist_name, archives, src_root, bld_root, dist_sub, dist_scrip
return output_names
-def check_dist(packagename, meson_command, privdir):
+def check_dist(packagename, meson_command, bld_root, privdir):
print('Testing distribution package %s' % packagename)
unpackdir = os.path.join(privdir, 'dist-unpack')
builddir = os.path.join(privdir, 'dist-build')
@@ -158,6 +159,9 @@ def check_dist(packagename, meson_command, privdir):
unpacked_files = glob(os.path.join(unpackdir, '*'))
assert(len(unpacked_files) == 1)
unpacked_src_dir = unpacked_files[0]
+ with open(os.path.join(bld_root, 'meson-info', 'intro-buildoptions.json')) as boptions:
+ meson_command += ['-D{name}={value}'.format(**o) for o in json.load(boptions)
+ if o['name'] not in ['backend', 'install_umask']]
if subprocess.call(meson_command + ['--backend=ninja', unpacked_src_dir, builddir]) != 0:
print('Running Meson on distribution package failed')
return 1
@@ -214,7 +218,7 @@ def run(options):
if names is None:
return 1
# Check only one.
- rc = check_dist(names[0], meson_command, priv_dir)
+ rc = check_dist(names[0], meson_command, bld_root, priv_dir)
if rc == 0:
for name in names:
create_hash(name)