From 0da94f63895efd9c4978d1966280e304f031e2d9 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 23 Jul 2024 15:51:11 +0200 Subject: [PATCH 1/6] `toolchainopts` are not supported for `SYSTEM` compiler --- easybuild/toolchains/system.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/easybuild/toolchains/system.py b/easybuild/toolchains/system.py index 8a8b17cfaa..1a6a79c34f 100644 --- a/easybuild/toolchains/system.py +++ b/easybuild/toolchains/system.py @@ -37,3 +37,5 @@ class SystemToolchain(SystemCompiler): """System toolchain.""" NAME = SYSTEM_TOOLCHAIN_NAME + COMPILER_UNIQUE_OPTS = None + COMPILER_SHARED_OPTS = None From c27e92be5576b92c3c0daa601a300217b5505a6e Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 23 Jul 2024 17:03:39 +0200 Subject: [PATCH 2/6] Option mappings also need to be reset --- easybuild/toolchains/system.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/easybuild/toolchains/system.py b/easybuild/toolchains/system.py index 1a6a79c34f..db806a2a50 100644 --- a/easybuild/toolchains/system.py +++ b/easybuild/toolchains/system.py @@ -39,3 +39,5 @@ class SystemToolchain(SystemCompiler): NAME = SYSTEM_TOOLCHAIN_NAME COMPILER_UNIQUE_OPTS = None COMPILER_SHARED_OPTS = None + COMPILER_UNIQUE_OPTION_MAP = None + COMPILER_SHARED_OPTION_MAP = None From 16ce1ed1f86dcf6a560e413da630978aa58699c7 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 24 Jul 2024 13:57:57 +0200 Subject: [PATCH 3/6] Move the changes to the parent class --- easybuild/toolchains/compiler/systemcompiler.py | 7 +++++++ easybuild/toolchains/system.py | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/easybuild/toolchains/compiler/systemcompiler.py b/easybuild/toolchains/compiler/systemcompiler.py index d1fd06d4d9..140ae3b159 100644 --- a/easybuild/toolchains/compiler/systemcompiler.py +++ b/easybuild/toolchains/compiler/systemcompiler.py @@ -40,3 +40,10 @@ class SystemCompiler(Compiler): """System compiler""" COMPILER_MODULE_NAME = [] COMPILER_FAMILY = TC_CONSTANT_SYSTEM + + # The system compiler does not currently support even the shared options + # (changing this would require updating set_minimal_build_env() of the toolchain class) + COMPILER_UNIQUE_OPTS = None + COMPILER_SHARED_OPTS = None + COMPILER_UNIQUE_OPTION_MAP = None + COMPILER_SHARED_OPTION_MAP = None diff --git a/easybuild/toolchains/system.py b/easybuild/toolchains/system.py index db806a2a50..8a8b17cfaa 100644 --- a/easybuild/toolchains/system.py +++ b/easybuild/toolchains/system.py @@ -37,7 +37,3 @@ class SystemToolchain(SystemCompiler): """System toolchain.""" NAME = SYSTEM_TOOLCHAIN_NAME - COMPILER_UNIQUE_OPTS = None - COMPILER_SHARED_OPTS = None - COMPILER_UNIQUE_OPTION_MAP = None - COMPILER_SHARED_OPTION_MAP = None From 72f41065e41b3825c09e15da915267112abcea6d Mon Sep 17 00:00:00 2001 From: ocaisa Date: Tue, 30 Jul 2024 10:06:47 +0200 Subject: [PATCH 4/6] Use a test easyconfig where toolchainopts are allowed --- test/framework/toy_build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/framework/toy_build.py b/test/framework/toy_build.py index 2978e64b1a..eeff304c16 100644 --- a/test/framework/toy_build.py +++ b/test/framework/toy_build.py @@ -2820,7 +2820,7 @@ def grab_gcc_rpath_wrapper_args(): # test use of rpath toolchain option test_ecs = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs') - toy_ec_txt = read_file(os.path.join(test_ecs, 't', 'toy', 'toy-0.0.eb')) + toy_ec_txt = read_file(os.path.join(test_ecs, 't', 'toy', 'toy-0.0-gompi-2018a.eb')) toy_ec_txt += "\ntoolchainopts = {'rpath': False}\n" toy_ec = os.path.join(self.test_prefix, 'toy.eb') write_file(toy_ec, toy_ec_txt) From 0444bd2fdb66c6e909c58d1382527c4f8e018bf6 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 30 Jul 2024 14:33:17 +0200 Subject: [PATCH 5/6] Don't use SYSTEM toolchain for toolchain tests --- test/framework/toolchain.py | 2 +- test/framework/toy_build.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/framework/toolchain.py b/test/framework/toolchain.py index 2ca15d26d6..c140c8d042 100644 --- a/test/framework/toolchain.py +++ b/test/framework/toolchain.py @@ -91,7 +91,7 @@ def get_toolchain(self, name, version=None): def test_toolchain(self): """Test whether toolchain is initialized correctly.""" test_ecs = os.path.join('test', 'framework', 'easyconfigs', 'test_ecs') - ec_file = find_full_path(os.path.join(test_ecs, 'g', 'gzip', 'gzip-1.4.eb')) + ec_file = find_full_path(os.path.join(test_ecs, 'g', 'gzip', 'gzip-1.4-GCC-4.9.3-2.26.eb')) ec = EasyConfig(ec_file, validate=False) tc = ec.toolchain self.assertIn('debug', tc.options) diff --git a/test/framework/toy_build.py b/test/framework/toy_build.py index eeff304c16..11f4516977 100644 --- a/test/framework/toy_build.py +++ b/test/framework/toy_build.py @@ -2821,7 +2821,7 @@ def grab_gcc_rpath_wrapper_args(): # test use of rpath toolchain option test_ecs = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs') toy_ec_txt = read_file(os.path.join(test_ecs, 't', 'toy', 'toy-0.0-gompi-2018a.eb')) - toy_ec_txt += "\ntoolchainopts = {'rpath': False}\n" + toy_ec_txt += "\ntoolchainopts = {'rpath': False}\n" # overwrites existing toolchainopts toy_ec = os.path.join(self.test_prefix, 'toy.eb') write_file(toy_ec, toy_ec_txt) with self.mocked_stdout_stderr(): From 27a869b0b432e3a0ea050453fbc351ec859430b1 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 24 Jul 2024 17:16:07 +0200 Subject: [PATCH 6/6] Make unrelated warning from CI disappear --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 223d1da646..1072bf421d 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -187,7 +187,7 @@ jobs: # run test suite python -O -m test.framework.suite 2>&1 | tee test_framework_suite.log # try and make sure output of running tests is clean (no printed messages/warnings) - IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test" + IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test|CryptographyDeprecationWarning: TripleDES has been moved|algorithms.TripleDES" # '|| true' is needed to avoid that GitHub Actions stops the job on non-zero exit of grep (i.e. when there are no matches) PRINTED_MSG=$(egrep -v "${IGNORE_PATTERNS}" test_framework_suite.log | grep '\.\n*[A-Za-z]' || true) test "x$PRINTED_MSG" = "x" || (echo "ERROR: Found printed messages in output of test suite" && echo "${PRINTED_MSG}" && exit 1)