summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-11-08 22:55:53 +0100
committerGitHub <noreply@github.com>2024-11-08 13:55:53 -0800
commit907a37145f9434d36b238ef8f435f157a7fb129b (patch)
treeec33e4c12de2f2a1ef38d5f39b0ec96951e95c0d /var
parent4778d2d332d36c3db0054746d75531d6e357effb (diff)
downloadspack-907a37145f9434d36b238ef8f435f157a7fb129b.tar.gz
spack-907a37145f9434d36b238ef8f435f157a7fb129b.tar.bz2
spack-907a37145f9434d36b238ef8f435f157a7fb129b.tar.xz
spack-907a37145f9434d36b238ef8f435f157a7fb129b.zip
llnl.util.filesystem: multiple entrypoints and max_depth (#47495)
If a package `foo` doesn't implement `libs`, the default was to search recursively for `libfoo` whenever asking for `spec[foo].libs` (this also happens automatically if a package includes `foo` as a link dependency). This can lead to some strange behavior: 1. A package that is normally used as a build dependency (e.g. `cmake` at one point) is referenced like `depends_on(cmake)` which leads to a fully-recursive search for `libcmake` (this can take "forever" when CMake is registered as an external with a prefix like `/usr`, particularly on NFS mounts). 2. A similar hang can occur if a package is registered as an external with an incorrect prefix - [x] Update the default library search to stop after a maximum depth (by default, search the root prefix and each directory in it, but no lower). - [x] The following is a list of known changes to `find` compared to `develop`: 1. Matching directories are no longer returned -- `find` consistently only finds non-dirs, even at `max_depth` 2. Symlinked directories are followed (needed to support max_depth) 3. `find(..., "dir/*.txt")` is allowed, for finding files inside certain dirs. These "complex" patterns are delegated to `glob`, like they are on `develop`. 4. `root` and `files` arguments both support generic sequences, and `root` allows both `str` and `path` types. This allows us to specify multiple entry points to `find`. --------- Co-authored-by: Peter Scheibel <scheibel1@llnl.gov>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/attributes-foo/package.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/var/spack/repos/builtin.mock/packages/attributes-foo/package.py b/var/spack/repos/builtin.mock/packages/attributes-foo/package.py
index 31c88f4b08..b882fc9b65 100644
--- a/var/spack/repos/builtin.mock/packages/attributes-foo/package.py
+++ b/var/spack/repos/builtin.mock/packages/attributes-foo/package.py
@@ -44,7 +44,7 @@ class AttributesFoo(BundlePackage):
# Header provided by the bar virutal package
@property
def bar_headers(self):
- return find_headers("bar/bar", root=self.home.include, recursive=False)
+ return find_headers("bar", root=self.home.include, recursive=True)
# Libary provided by the bar virtual package
@property
@@ -59,7 +59,7 @@ class AttributesFoo(BundlePackage):
# Header provided by the baz virtual package
@property
def baz_headers(self):
- return find_headers("baz/baz", root=self.baz_home.include, recursive=False)
+ return find_headers("baz", root=self.baz_home.include, recursive=True)
# Library provided by the baz virtual package
@property