Finer selection of virtual providers#15569
Conversation
116a236 to
ded08d5
Compare
|
FYI. I provided feedback on #15505 |
|
I'll start #15570 now. |
867248f to
d2b6458
Compare
d16e364 to
70c58df
Compare
|
@becker33 @tgamblin Apparently the features added in #14934 didn't conflict with this PR. I have a question on semantics though. With this configuration: packages:
all:
providers:
lapack: [openblas]
lapack:
buildable: False
paths:
[email protected]: /usrI obtain the following: $ spack spec netlib-scalapack ^mpi=intel-parallel-studio@cluster+mpi
Input spec
--------------------------------
netlib-scalapack
^intel-parallel-studio@cluster+mpi
Concretized
--------------------------------
==> Error: The spec
'intel-parallel-studio@cluster+mpi'
is configured as not buildable, and no matching external installs were foundi.e. the configuration in |
|
That is correct about what #14934 did. I'm not sure that we want to keep that behavior, we can update it later to be more expressive |
tgamblin
left a comment
There was a problem hiding this comment.
@alalazo: this looks pretty good so far -- two major things:
- This needs to handle
whenconditionals for bound virtuals - The resolved virtuals should be made into edge attributes in the DAG, so that we know what's providing what.
(2) would fix the big TODO for scalapack in intel-parallel-studio's libs method.
lib/spack/spack/spec.py
Outdated
| msg = 'virtual dependency "{0}" cannot be specified multiple times' | ||
| raise ValueError(msg.format(virtual)) | ||
|
|
||
| self._explicit_providers[virtual] = spec |
There was a problem hiding this comment.
This is a fine check, (as it doesn't really know whether anything is virtual) but it may have to go away and be checked later. It is right on the edge of including package/concretization semantics in the spec parser.
I'm on the fence because while I can't think of a reason we would ever want the same virtual twice in a DAG, I don't see why we shouldn't be able to talk about a DAG with that property. A spec DAG can represent that -- it's just not a valid build.
There was a problem hiding this comment.
I completely agree with the reasoning above: one thing is construct an abstract spec, another is trying to concretize it using some constraints. I added the check above as I was trying to follow a practice that is already present for non-virtual dependencies:
Lines 1113 to 1117 in 04c6a78
This results in the following behavior:
Spack version 0.14.2
Python 3.7.4, Linux x86_64
>>> import spack.spec
>>> s = spack.spec.Spec('hdf5 ^zlib~shared ^zlib+shared')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/culpo/PycharmProjects/spack/lib/spack/spack/spec.py", line 1035, in __init__
spec_list = SpecParser(self).parse(spec_like)
File "/home/culpo/PycharmProjects/spack/lib/spack/spack/parse.py", line 152, in parse
return self.do_parse()
File "/home/culpo/PycharmProjects/spack/lib/spack/spack/spec.py", line 4113, in do_parse
self._parse_dependency(specs)
File "/home/culpo/PycharmProjects/spack/lib/spack/spack/spec.py", line 4184, in _parse_dependency
specs[-1]._add_dependency(dep, ())
File "/home/culpo/PycharmProjects/spack/lib/spack/spack/spec.py", line 1144, in _add_dependency
"Cannot depend on '%s' twice" % spec)
spack.spec.DuplicateDependencyError: Cannot depend on 'zlib+shared' twiceShould we move both checks just before concretization and verify there the pre-requisites of an abstract spec?
1a12699 to
b91f20f
Compare
b91f20f to
a5bfe28
Compare
This comment has been minimized.
This comment has been minimized.
1dda5a7 to
4181bc7
Compare
|
@tgamblin 4181bc7 solves the reindex issue (which doesn't fail) but doesn't go as far as recomputing edge attributes. For specs installed before this PR a reindex will always add an empty list under the |
4181bc7 to
afcfb74
Compare
The root spec byte blob is now generated on the fly for tests.
This should help to better convey the meaning of this attribute i.e. store somewhere the user requested providers so that we can honor those requests when concretizing.
Previously __contains__ was just checking nodes properties i.e. it was checking whether a spec *might* provide a virtual dependency or not. Since this PR annotates virtual dependencies on edges, we should now check that the edge provides the correct virtual.
2192088 to
4622489
Compare
|
Converted the PR back to draft since:
|
…e it fixes spack#26866 This semantics fits with the way Spack currently treats providers of virtual dependencies. It needs to be revisited when spack#15569 is reworked with a new syntax.
…e it fixes spack#26866 This semantics fits with the way Spack currently treats providers of virtual dependencies. It needs to be revisited when spack#15569 is reworked with a new syntax.
|
The changes in #29093 may help to unblock the extension to the spec language mentioned in the final bullet of the OP:
|
|
Superseded by #35322 |
fixes #15443
closes #17439
This PR implements what is described in #15443:
providescorrectly