Skip to content

Commit

Permalink
fix failing build for testthat R extension on top of recent glibc via…
Browse files Browse the repository at this point in the history
… pre_single_extension hook that replaces SIGSTKSZ with constant value
  • Loading branch information
boegel committed Sep 20, 2023
1 parent 2bc2d2f commit a38a5a3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,22 @@ def pre_test_hook_ignore_failing_tests_SciPybundle(self, *args, **kwargs):
self.cfg['testopts'] = "|| echo ignoring failing tests"


def pre_single_extension_hook(ext, *args, **kwargs):
"""Main pre-configure hook: trigger custom functions based on software name."""
if ext.name in PRE_SINGLE_EXTENSION_HOOKS:
PRE_SINGLE_EXTENSION_HOOKS[self.name](ext, *args, **kwargs)


def pre_single_extension_testthat(ext, *args, **kwargs):
"""
Pre-extension hook for testthat, to fix build on top of recent glibc.
"""
if ext.name == 'testthat' and LooseVersion(ext.version) < LooseVersion('3.1.0'):
# use constant value instead of SIGSTKSZ for stack size,
# cfr. https://github.com/r-lib/testthat/issues/1373 + https://github.com/r-lib/testthat/pull/1403
ext.cfg['preinstallopts'] = "sed -i 's/SIGSTKSZ/32768/g' inst/include/testthat/vendor/catch.h && "


PARSE_HOOKS = {
'CGAL': parse_hook_cgal_toolchainopts_precise,
'fontconfig': parse_hook_fontconfig_add_fonts,
Expand All @@ -296,3 +312,7 @@ def pre_test_hook_ignore_failing_tests_SciPybundle(self, *args, **kwargs):
PRE_TEST_HOOKS = {
'SciPy-bundle': pre_test_hook_ignore_failing_tests_SciPybundle,
}

PRE_SINGLE_EXTENSION_HOOKS = {
'testthat': pre_single_extension_testthat,
}

0 comments on commit a38a5a3

Please sign in to comment.