From 7550a41660711618f49332016ad4ad265becb42d Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 18 Dec 2023 16:19:38 +0100 Subject: gcc: fix run environment variables not being exported in environments (#41729) Since views use symlinks, all compiler binaries were skipped in this case. Instead, only skip them if their target does not exist. --- var/spack/repos/builtin/packages/gcc/package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index d7d9dcc14d..f6dce2ea00 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -1016,7 +1016,9 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage): continue abspath = os.path.join(bin_path, filename) - if os.path.islink(abspath): + + # Skip broken symlinks (https://github.com/spack/spack/issues/41327) + if not os.path.exists(abspath): continue # Set the proper environment variable -- cgit v1.2.3-70-g09d2