From 8a2eca3cf3c949cff5fb1f61e1a3ef4e6d2cdfd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Jul 2024 12:06:20 +0200 Subject: [PATCH 1/5] add a hook for GObject-Introspection that prevents environment vars from being set if EB filters them --- eb_hooks.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/eb_hooks.py b/eb_hooks.py index 73adce90f1..deea409cf4 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -387,6 +387,24 @@ def pre_configure_hook_extrae(self, *args, **kwargs): else: raise EasyBuildError("Extrae-specific hook triggered for non-Extrae easyconfig?!") + +def pre_configure_hook_gobject_introspection(self, *args, **kwargs): + """ + pre-configure hook for GObject-Introspection: + - prevent GObject-Introspection from setting $LD_LIBRARY_PATH if Easybuild is configured to filter it + that are configured to be filtered by EasyBuild, see: + https://github.com/EESSI/software-layer/issues/196 + """ + if self.name == 'GObject-Introspection': + # inject a line that removes all items from runtime_path_envvar that are in $EASYBUILD_FILTER_ENVVARS + sed_cmd = r'sed -i "s@\(^\s*runtime_path_envvar = \)\(.*\)@' + sed_cmd += r'\1\2\n\1 [x for x in runtime_path_envvar if not x in os.environ.get(\'EASYBUILD_FILTER_ENV_VARS\', \'\').split(\',\')]@g"' + sed_cmd += ' %(start_dir)s/giscanner/ccompiler.py && ' + self.cfg.update('preconfigopts', sed_cmd) + else: + raise EasyBuildError("GObject-Introspection-specific hook triggered for non-GObject-Introspection easyconfig?!") + + def pre_configure_hook_gromacs(self, *args, **kwargs): """ Pre-configure hook for GROMACS: @@ -744,6 +762,7 @@ def inject_gpu_property(ec): PRE_CONFIGURE_HOOKS = { 'at-spi2-core': pre_configure_hook_atspi2core_filter_ld_library_path, 'BLIS': pre_configure_hook_BLIS_a64fx, + 'GObject-Introspection': pre_configure_hook_gobject_introspection, 'Extrae': pre_configure_hook_extrae, 'GROMACS': pre_configure_hook_gromacs, 'libfabric': pre_configure_hook_libfabric_disable_psm3_x86_64_generic, From 62c1f7d000473bd53a60fa7d814dcccf11978524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Jul 2024 13:45:42 +0200 Subject: [PATCH 2/5] rebuild all GObject-Introspection versions to apply new hook --- ...eb-4.9.2-GObject-Introspection-filter-envvars.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 easystacks/software.eessi.io/2023.06/rebuilds/20240719-eb-4.9.2-GObject-Introspection-filter-envvars.yml diff --git a/easystacks/software.eessi.io/2023.06/rebuilds/20240719-eb-4.9.2-GObject-Introspection-filter-envvars.yml b/easystacks/software.eessi.io/2023.06/rebuilds/20240719-eb-4.9.2-GObject-Introspection-filter-envvars.yml new file mode 100644 index 0000000000..676a2fe548 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/rebuilds/20240719-eb-4.9.2-GObject-Introspection-filter-envvars.yml @@ -0,0 +1,12 @@ +# 2024.07.19 +# GObject-Introspection sets $LD_LIBRARY_PATH (to many different paths, including $EPREFIX/lib) +# when calling gcc, and this causes a lot of issues for, especially, scripts using /bin/bash. +# +# This rebuild ensures (by using a new EasyBuild hook) that GObject-Introspection will not set +# environment variables that are configured to be filtered by EasyBuild. +# +# See https://github.com/EESSI/software-layer/issues/196 +easyconfigs: + - GObject-Introspection-1.74.0-GCCcore-12.2.0.eb + - GObject-Introspection-1.76.1-GCCcore-12.3.0.eb + - GObject-Introspection-1.78.1-GCCcore-13.2.0.eb From 6277bc382003651012a8196bc7667ae1a3371704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Jul 2024 13:58:53 +0200 Subject: [PATCH 3/5] fix comment Co-authored-by: ocaisa --- eb_hooks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index deea409cf4..aa9bde383a 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -391,8 +391,7 @@ def pre_configure_hook_extrae(self, *args, **kwargs): def pre_configure_hook_gobject_introspection(self, *args, **kwargs): """ pre-configure hook for GObject-Introspection: - - prevent GObject-Introspection from setting $LD_LIBRARY_PATH if Easybuild is configured to filter it - that are configured to be filtered by EasyBuild, see: + - prevent GObject-Introspection from setting $LD_LIBRARY_PATH if EasyBuild is configured to filter it, see: https://github.com/EESSI/software-layer/issues/196 """ if self.name == 'GObject-Introspection': From 5593999aa6acfaef2d235abc987a908643109cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Jul 2024 14:39:10 +0200 Subject: [PATCH 4/5] remove the at-spi2-core hook --- eb_hooks.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index deea409cf4..00d26df37b 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -486,21 +486,6 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs): raise EasyBuildError("WRF-specific hook triggered for non-WRF easyconfig?!") -def pre_configure_hook_atspi2core_filter_ld_library_path(self, *args, **kwargs): - """ - pre-configure hook for at-spi2-core: - - instruct GObject-Introspection's g-ir-scanner tool to not set $LD_LIBRARY_PATH - when EasyBuild is configured to filter it, see: - https://github.com/EESSI/software-layer/issues/196 - """ - if self.name == 'at-spi2-core': - if build_option('filter_env_vars') and 'LD_LIBRARY_PATH' in build_option('filter_env_vars'): - sed_cmd = 'sed -i "s/gir_extra_args = \[/gir_extra_args = \[\\n \'--lib-dirs-envvar=FILTER_LD_LIBRARY_PATH\',/g" %(start_dir)s/atspi/meson.build && ' - self.cfg.update('preconfigopts', sed_cmd) - else: - raise EasyBuildError("at-spi2-core-specific hook triggered for non-at-spi2-core easyconfig?!") - - def pre_test_hook(self,*args, **kwargs): """Main pre-test hook: trigger custom functions based on software name.""" if self.name in PRE_TEST_HOOKS: @@ -760,7 +745,6 @@ def inject_gpu_property(ec): } PRE_CONFIGURE_HOOKS = { - 'at-spi2-core': pre_configure_hook_atspi2core_filter_ld_library_path, 'BLIS': pre_configure_hook_BLIS_a64fx, 'GObject-Introspection': pre_configure_hook_gobject_introspection, 'Extrae': pre_configure_hook_extrae, From 46a9c85149e1a9ff29bc8da9c322eda639c7f923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 19 Jul 2024 14:39:34 +0200 Subject: [PATCH 5/5] rebuild at-spi2-core with the rebuilt GObject-Introspection --- .../20240719-eb-4.9.2-GObject-Introspection-filter-envvars.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/easystacks/software.eessi.io/2023.06/rebuilds/20240719-eb-4.9.2-GObject-Introspection-filter-envvars.yml b/easystacks/software.eessi.io/2023.06/rebuilds/20240719-eb-4.9.2-GObject-Introspection-filter-envvars.yml index 676a2fe548..a61cd9705b 100644 --- a/easystacks/software.eessi.io/2023.06/rebuilds/20240719-eb-4.9.2-GObject-Introspection-filter-envvars.yml +++ b/easystacks/software.eessi.io/2023.06/rebuilds/20240719-eb-4.9.2-GObject-Introspection-filter-envvars.yml @@ -10,3 +10,5 @@ easyconfigs: - GObject-Introspection-1.74.0-GCCcore-12.2.0.eb - GObject-Introspection-1.76.1-GCCcore-12.3.0.eb - GObject-Introspection-1.78.1-GCCcore-13.2.0.eb + - at-spi2-core-2.46.0-GCCcore-12.2.0.eb + - at-spi2-core-2.49.91-GCCcore-12.3.0.eb