From 32213e03b945c8e91354d3f99f1ccfce36eee797 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 22 Nov 2023 08:29:56 +0100 Subject: [PATCH] replace Catch2 build dep in pybind11 via parse hook --- .../2023.06/eessi-2023.06-eb-4.8.2-2023a.yml | 2 +- eb_hooks.py | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.8.2-2023a.yml b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.8.2-2023a.yml index 2c127dd327..270a1d1572 100644 --- a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.8.2-2023a.yml +++ b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.8.2-2023a.yml @@ -3,10 +3,10 @@ easyconfigs: options: from-pr: 19264 - foss-2023a.eb - - SciPy-bundle-2023.07-gfbf-2023a.eb - pybind11-2.11.1-GCCcore-12.3.0.eb: options: from-pr: 19270 + - SciPy-bundle-2023.07-gfbf-2023a.eb - TensorFlow-2.13.0-foss-2023a.eb: options: from-pr: 19268 diff --git a/eb_hooks.py b/eb_hooks.py index cfe310cd43..0f2567a04b 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -4,6 +4,7 @@ import re from easybuild.easyblocks.generic.configuremake import obtain_config_guess +from easybuild.framework.easyconfig.constants import EASYCONFIG_CONSTANTS from easybuild.tools.build_log import EasyBuildError, print_msg from easybuild.tools.config import build_option, update_build_option from easybuild.tools.filetools import apply_regex_substitutions, copy_file, which @@ -22,6 +23,8 @@ EESSI_RPATH_OVERRIDE_ATTR = 'orig_rpath_override_dirs' +SYSTEM = EASYCONFIG_CONSTANTS['SYSTEM'][0] + def get_eessi_envvar(eessi_envvar): """Get an EESSI environment variable from the environment""" @@ -180,6 +183,25 @@ def parse_hook_openblas_relax_lapack_tests_num_errors(ec, eprefix): raise EasyBuildError("OpenBLAS-specific hook triggered for non-OpenBLAS easyconfig?!") +def parse_hook_pybind11_replace_catch2(ec, eprefix): + """ + Replace Catch2 build dependency in pybind11 easyconfigs with one that doesn't use system toolchain. + cfr. https://github.com/easybuilders/easybuild-easyconfigs/pull/19270 + """ + # tihs is mainly necessary to avoid that --missing keeps reporting Catch2/2.13.9 is missing, + # and to avoid that we need to use "--from-pr 19270" for every easyconfigs that (indirectly) depends on pybind11 + if ec.name == 'pybind11' and ec.version in ['2.10.3', '2.11.1']: + build_deps = ec['builddependencies'] + catch2_build_dep = None + catch2_name, catch2_version = ('Catch2', '2.13.9') + for idx, build_dep in enumerate(build_deps): + if build_dep[0] == catch2_name and build_dep[1] == catch2_version: + catch2_build_dep = build_dep + break + if catch2_build_dep and len(catch2_build_dep) == 4 and catch2_build_dep[3] == SYSTEM: + build_deps[idx] = (catch2_name, catch2_version) + + def parse_hook_qt5_check_qtwebengine_disable(ec, eprefix): """ Disable check for QtWebEngine in Qt5 as workaround for problem with determining glibc version. @@ -341,6 +363,7 @@ def pre_single_extension_isoband(ext, *args, **kwargs): 'CGAL': parse_hook_cgal_toolchainopts_precise, 'fontconfig': parse_hook_fontconfig_add_fonts, 'OpenBLAS': parse_hook_openblas_relax_lapack_tests_num_errors, + 'pybind11': parse_hook_pybind11_replace_catch2, 'Qt5': parse_hook_qt5_check_qtwebengine_disable, 'UCX': parse_hook_ucx_eprefix, }