|
21 | 21 | from dataclasses import dataclass |
22 | 22 | from glob import glob |
23 | 23 | from pathlib import Path |
24 | | -from mesonbuild.environment import detect_ninja |
25 | | -from mesonbuild.mesonlib import (MesonException, RealPathAction, quiet_git, |
| 24 | +from mesonbuild.environment import Environment, detect_ninja |
| 25 | +from mesonbuild.mesonlib import (MesonException, RealPathAction, get_meson_command, quiet_git, |
26 | 26 | windows_proof_rmtree, setup_vsenv, OptionKey) |
27 | 27 | from mesonbuild.msetup import add_arguments as msetup_argparse |
28 | 28 | from mesonbuild.wrap import wrap |
@@ -103,10 +103,12 @@ def create_dist(self, archives: T.List[str]) -> T.List[str]: |
103 | 103 |
|
104 | 104 | def run_dist_scripts(self) -> None: |
105 | 105 | assert os.path.isabs(self.distdir) |
106 | | - env = {} |
107 | | - env['MESON_DIST_ROOT'] = self.distdir |
108 | | - env['MESON_SOURCE_ROOT'] = self.src_root |
109 | | - env['MESON_BUILD_ROOT'] = self.bld_root |
| 106 | + mesonrewrite = Environment.get_build_command() + ['rewrite'] |
| 107 | + env = {'MESON_DIST_ROOT': self.distdir, |
| 108 | + 'MESON_SOURCE_ROOT': self.src_root, |
| 109 | + 'MESON_BUILD_ROOT': self.bld_root, |
| 110 | + 'MESONREWRITE': ' '.join(shlex.quote(x) for x in mesonrewrite), |
| 111 | + } |
110 | 112 | for d in self.dist_scripts: |
111 | 113 | if d.subproject and d.subproject not in self.subprojects: |
112 | 114 | continue |
@@ -328,9 +330,6 @@ def run(options: argparse.Namespace) -> int: |
328 | 330 | b = build.load(options.wd) |
329 | 331 | need_vsenv = T.cast('bool', b.environment.coredata.get_option(OptionKey('vsenv'))) |
330 | 332 | setup_vsenv(need_vsenv) |
331 | | - # This import must be load delayed, otherwise it will get the default |
332 | | - # value of None. |
333 | | - from mesonbuild.mesonlib import get_meson_command |
334 | 333 | src_root = b.environment.source_dir |
335 | 334 | bld_root = b.environment.build_dir |
336 | 335 | priv_dir = os.path.join(bld_root, 'meson-private') |
|
0 commit comments