diff options
author | Axel Huebl <axel.huebl@plasma.ninja> | 2019-12-06 23:47:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-06 23:47:03 -0800 |
commit | d705e96a636f480217a8f64a69fa4296a427b14e (patch) | |
tree | dd427fcdf93576cdcc59abb87df5fb78a09a0c54 | |
parent | 9d9737f765416305dd2adbd816b447de5c5eae7c (diff) | |
download | spack-d705e96a636f480217a8f64a69fa4296a427b14e.tar.gz spack-d705e96a636f480217a8f64a69fa4296a427b14e.tar.bz2 spack-d705e96a636f480217a8f64a69fa4296a427b14e.tar.xz spack-d705e96a636f480217a8f64a69fa4296a427b14e.zip |
Spec Header Dirs: Only first include/ (#13991)
* CUDA HeaderList: Unit Test
* Spec Header Dirs: Only first include/
Avoid matching recurringly nested include paths that usually
refer to internally shipped libraries in packages.
Example in CUDA Toolkit, shipping a libc++ fork internally
with libcu++ since 10.2.89:
`<prefix>/include/cuda/some/more/details/include/` or
`<prefix>/include/cuda/std/detail/libcxx/include`
regex: non-greedy first match of include
Co-Authored-By: Massimiliano Culpo <massimiliano.culpo@gmail.com>
* CUDA: Re-Enable 10.2.89 as Default
-rw-r--r-- | lib/spack/llnl/util/filesystem.py | 4 | ||||
-rw-r--r-- | lib/spack/spack/test/build_environment.py | 14 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/cuda/package.py | 3 |
3 files changed, 17 insertions, 4 deletions
diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index 0095e3fd21..4bdf543d79 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -1156,7 +1156,9 @@ class HeaderList(FileList): # Make sure to only match complete words, otherwise path components such # as "xinclude" will cause false matches. - include_regex = re.compile(r'(.*)(\binclude\b)(.*)') + # Avoid matching paths such as <prefix>/include/something/detail/include, + # e.g. in the CUDA Toolkit which ships internal libc++ headers. + include_regex = re.compile(r'(.*?)(\binclude\b)(.*)') def __init__(self, files): super(HeaderList, self).__init__(files) diff --git a/lib/spack/spack/test/build_environment.py b/lib/spack/spack/test/build_environment.py index b6a0f4b441..f2427827fe 100644 --- a/lib/spack/spack/test/build_environment.py +++ b/lib/spack/spack/test/build_environment.py @@ -17,7 +17,7 @@ from spack.util.executable import Executable from spack.util.spack_yaml import syaml_dict, syaml_str from spack.util.environment import EnvironmentModifications -from llnl.util.filesystem import LibraryList +from llnl.util.filesystem import LibraryList, HeaderList @pytest.fixture @@ -243,6 +243,18 @@ def test_set_build_environment_variables( variables. """ + # https://github.com/spack/spack/issues/13969 + cuda_headers = HeaderList([ + 'prefix/include/cuda_runtime.h', + 'prefix/include/cuda/atomic', + 'prefix/include/cuda/std/detail/libcxx/include/ctype.h']) + cuda_include_dirs = cuda_headers.directories + assert(os.path.join('prefix', 'include') + in cuda_include_dirs) + assert(os.path.join('prefix', 'include', 'cuda', 'std', 'detail', + 'libcxx', 'include') + not in cuda_include_dirs) + root = spack.spec.Spec('dt-diamond') root.concretize() diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py index a15fae7c59..97b26bf93b 100644 --- a/var/spack/repos/builtin/packages/cuda/package.py +++ b/var/spack/repos/builtin/packages/cuda/package.py @@ -60,8 +60,7 @@ class Cuda(Package): key = "{0}-{1}".format(platform.system(), platform.machine()) pkg = packages.get(key) if pkg: - version(ver, sha256=pkg[0], url=pkg[1], expand=False, - preferred=(ver == "10.1.243")) # see GH issue 13969 + version(ver, sha256=pkg[0], url=pkg[1], expand=False) # macOS Mojave drops NVIDIA graphics card support -- official NVIDIA # drivers do not exist for Mojave. See |