[jhbuild/wip/lantw/meson-Run-ninja-under-devenv] meson: Run ninja under devenv
- From: Ting-Wei Lan <lantw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild/wip/lantw/meson-Run-ninja-under-devenv] meson: Run ninja under devenv
- Date: Sun, 21 Nov 2021 17:54:06 +0000 (UTC)
commit 8d099dd5787eb493c538387d4a6f4699263156bc
Author: Ting-Wei Lan <lantw src gnome org>
Date: Mon Nov 22 01:19:35 2021 +0800
meson: Run ninja under devenv
Unlike libtool, meson doesn't set the LD_LIBRARY_PATH environment
variable for running uninstalled executables by default. If the build
process requires running uninstalled executables, it may fail because
LD_LIBRARY_PATH set by JHBuild may instruct it to prefer the installed
library to the uninstalled one. To fix it, use the 'devenv' subcommand
introduced in Meson 0.58 to setup the environment for ninja.
https://github.com/mesonbuild/meson/issues/1635
https://github.com/mesonbuild/meson/pull/8393
jhbuild/modtypes/__init__.py | 9 +++++----
jhbuild/modtypes/meson.py | 6 +++---
2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index 2919a9f9..c9df2c90 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -545,7 +545,7 @@ class NinjaModule(Package):
break
return self.ninjacmd
- def ninja(self, buildscript, target='', ninjaargs=None, env=None):
+ def ninja(self, buildscript, target='', pre='', ninjaargs=None, env=None):
ninjacmd = os.environ.get('NINJA', self.get_ninjacmd(buildscript.config))
if ninjacmd is None:
raise BuildStateError(_('ninja not found; use NINJA to point to a specific ninja binary'))
@@ -557,9 +557,10 @@ class NinjaModule(Package):
for k in (env or {}):
extra_env[k] = env[k]
- cmd = '{ninja} {ninjaargs} {target}'.format(ninja=ninjacmd,
- ninjaargs=ninjaargs,
- target=target)
+ cmd = '{pre}{ninja} {ninjaargs} {target}'.format(pre=pre,
+ ninja=ninjacmd,
+ ninjaargs=ninjaargs,
+ target=target)
buildscript.execute(cmd, cwd=self.get_builddir(buildscript), extra_env=extra_env)
class MakeModule(Package):
diff --git a/jhbuild/modtypes/meson.py b/jhbuild/modtypes/meson.py
index a4159e35..7277f3f0 100644
--- a/jhbuild/modtypes/meson.py
+++ b/jhbuild/modtypes/meson.py
@@ -126,14 +126,14 @@ class MesonModule(NinjaModule, DownloadableModule):
def do_build(self, buildscript):
buildscript.set_action(_('Building'), self)
- self.ninja(buildscript)
+ self.ninja(buildscript, pre='meson devenv ')
do_build.depends = [PHASE_CONFIGURE]
do_build.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE,
PHASE_CLEAN]
def do_check(self, buildscript):
buildscript.set_action(_('Checking'), self)
- self.ninja(buildscript, 'test')
+ self.ninja(buildscript, 'test', pre='meson devenv ')
do_check.depends = [PHASE_BUILD]
do_check.error_phases = [PHASE_FORCE_CHECKOUT, PHASE_CONFIGURE]
@@ -149,7 +149,7 @@ class MesonModule(NinjaModule, DownloadableModule):
def do_install(self, buildscript):
buildscript.set_action(_('Installing'), self)
destdir = self.prepare_installroot(buildscript)
- self.ninja(buildscript, 'install', env={'DESTDIR': destdir})
+ self.ninja(buildscript, 'install', pre='meson devenv ', env={'DESTDIR': destdir})
self.process_install(buildscript, self.get_revision())
do_install.depends = [PHASE_BUILD]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]