Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions easybuild/easyblocks/g/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,17 @@ def post_install_step(self, *args, **kwargs):
# since these may cause problems when upgrading to newer OS version.
# (see https://github.com/easybuilders/easybuild-easyconfigs/issues/10666)
glob_pattern = os.path.join(self.installdir, 'lib*', 'gcc', '*-linux-gnu', self.version, 'include-fixed')
matches = glob.glob(glob_pattern)
if matches:
if len(matches) == 1:
include_fixed_path = matches[0]
paths = glob.glob(glob_pattern)
if paths:
# weed out paths that point to the same location,
# for example when 'lib64' is a symlink to 'lib'
include_fixed_paths = []
for path in paths:
if not any(os.path.samefile(path, x) for x in include_fixed_paths):
include_fixed_paths.append(path)

if len(include_fixed_paths) == 1:
include_fixed_path = include_fixed_paths[0]

msg = "Found include-fixed subdirectory at %s, "
msg += "renaming it to avoid using system header files patched by fixincludes..."
Expand Down Expand Up @@ -688,7 +695,7 @@ def post_install_step(self, *args, **kwargs):
include_fixed_path, include_fixed_renamed)
else:
raise EasyBuildError("Exactly one 'include-fixed' directory expected, found %d: %s",
len(matches), matches)
len(include_fixed_paths), include_fixed_paths)
else:
self.log.info("No include-fixed subdirectory found at %s", glob_pattern)

Expand Down