diff options
author | Todd Gamblin <gamblin2@llnl.gov> | 2022-12-12 02:24:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-12 11:24:28 +0100 |
commit | 62da76cb5dca4d52c43bee06230cca6a5882f05d (patch) | |
tree | b4165c8019df683026f43249320cf3c733482527 /share | |
parent | 65c914fff72861a44bdac20bc1f62fd5ff0879cc (diff) | |
download | spack-62da76cb5dca4d52c43bee06230cca6a5882f05d.tar.gz spack-62da76cb5dca4d52c43bee06230cca6a5882f05d.tar.bz2 spack-62da76cb5dca4d52c43bee06230cca6a5882f05d.tar.xz spack-62da76cb5dca4d52c43bee06230cca6a5882f05d.zip |
directives: depends_on should not admit anonymous specs (#34368)
Writing a long dependency like:
```python
depends_on(
"llvm"
"targets=amdgpu,bpf,nvptx,webassembly"
"version_suffix=jl +link_llvm_dylib ~internal_unwind"
)
```
when it should be formatted like this:
```python
depends_on(
"llvm"
" targets=amdgpu,bpf,nvptx,webassembly"
" version_suffix=jl +link_llvm_dylib ~internal_unwind"
)
```
can cause really subtle errors. Specifically, you'll get something like this in
the package sanity tests:
```
AttributeError: 'NoneType' object has no attribute 'rpartition'
```
because Spack happily constructs a class that has a dependency with name `None`.
We can catch this earlier by banning anonymous dependency specs directly in
`depends_on()`. This causes the package itself to fail to parse, and emits
a much better error message:
```
==> Error: Invalid dependency specification in package 'julia':
llvmtargets=amdgpu,bpf,nvptx,webassemblyversion_suffix=jl +link_llvm_dylib ~internal_unwind
```
Diffstat (limited to 'share')
0 files changed, 0 insertions, 0 deletions