autotools: skip compiler prefixes during aclocal directory search - #6277
Open
bernhardkaindl wants to merge 1 commit into
Open
autotools: skip compiler prefixes during aclocal directory search#6277bernhardkaindl wants to merge 1 commit into
bernhardkaindl wants to merge 1 commit into
Conversation
bernhardkaindl
requested review from
alalazo,
becker33,
haampie,
johnwparent and
tldahlgren
as code owners
August 29, 2026 11:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
autotools: skip compiler prefixes during aclocal directory search
For packages using autotools, spack creates a list of search paths for
prefix/share/aclocaldirectories foraclocal -I._autoreconf_search_path_argsofautotools.py. It checks the prefixes of all dependencies forprefix/share/aclocaldirectories.spack installhave a prefix e.g. in/usrand the host has an installation ofautoconfin the same prefix, theaclocal -Isearch path created also contains/usr, as if it was a prefix of a regular dependency that needs it aclocal directory.This is of course an unwanted external inclusion of host-installed aclocal files into the build which we don't want unless needed e.g. for external packages.
This behaviour can be confirmed by making
/usr/share/aclocalinaccessible usingsudo chmod 700 /usr/share/aclocal. After that, aspack install --overwrite -y gmpfrom source demonstrates the issue:To only use the needed aclocal paths, do not add prefixes when they're only for compilers when searching for aclocal directories:
prefix: /usr,/usr/share/aclocalwould still be added for such external packages, but it would be at the end of the search order, after the internal spack prefixes.PS: I considered also a wider check for inaccessible directories, but I don't propose it because: