bugfix: don't fetch package metadata for unknown concrete specs#36990
bugfix: don't fetch package metadata for unknown concrete specs#36990
Conversation
|
@eugeneswalker: does this fix your issue? |
|
This PR does indeed resolve #36847. Thank you! |
|
@eugeneswalker see if the second commit fixes #34108. |
fe8e8e4 to
0106478
Compare
lib/spack/spack/solver/asp.py
Outdated
| # Ensure Spack will not coconcretize this with another provider | ||
| # for the same virtual | ||
| for virtual in dep.package.virtuals_provided: | ||
| # Skip virtual node constriants for renamed/deleted packages, |
There was a problem hiding this comment.
| # Skip virtual node constriants for renamed/deleted packages, | |
| # Skip virtual node constraints for renamed/deleted packages, |
lib/spack/spack/solver/asp.py
Outdated
| # NOTE: with current specs (which lack edge attributes) this | ||
| # can allow concretizations with two providers, but it's unlikely. |
There was a problem hiding this comment.
This is a bit scary 😟 Not sure what we could do more than this though. I agree it's unlikely, since one of the provider must be in a buildcache and not in the current repository.
There was a problem hiding this comment.
I think we don't rename things (especially MPI and other virtuals) frequently enough for this to matter. Though @eugeneswalker and the E4S team are trying hard to make it matter with their 100,000 package buildcache.
Goal should be to get virtual info on edges before it matters 😅
There was a problem hiding this comment.
I think the value of reuse here outweighs the corner case.
The concretizer can fail with `reuse:true` if a buildcache or installation contains a package with a dependency that has been renamed or deleted in the main repo (e.g., `netcdf` was refactored to `netcdf-c`, `netcdf-fortran`, etc., but there are still binary packages with dependencies called `netcdf`). We should still be able to install things for which we are missing `package.py` files. `Spec.inject_patches_variant()` was failing this requirement by attempting to look up the package class for concrete specs. This isn't needed -- we can skip it. - [x] swap two conditions in `Spec.inject_patches_variant()`
`spec_clauses()` attempts to look up package information for concrete specs in order to determine which virtuals they may provide. This fails for renamed/deleted dependencies of buildcaches and installed packages. This will eventually be fixed by #35258, which adds virtual information on edges, but we need a workaround to make older buildcaches usable. - [x] make an exception for renamed packages and omit their virtual constraints - [x] add a note that this will be solved by adding virtuals to edges
We currently throw a nasty error if you try to reuse packages from some other namespace (e.g., OLCF), but we should be able to reuse patched local versions of builtin packages. Right now the only obstacle to that is that we try to look up virtual info for unknown namespaces, and we can't get the package from the repo to do that. We *can* assume that a package with a known namespace is similar, and that its virtual provider information is reasonably accurate, so we now do that. This isn't 100% accurate, but neither is relying on the package itself, as it may have gone out of date. The real solution here is virtual edge information, but this is a stopgap until we have that.
a892475 to
7517ed5
Compare
Fixes #36847.
Fixes #34108.
This fixes two issues:
The concretizer can fail with
reuse:trueif a buildcache or installation contains a package with a dependency that has been renamed or deleted in the main repo (e.g.,netcdfwas refactored tonetcdf-c,netcdf-fortran, etc., but there are still binary packages with dependencies callednetcdf).We should still be able to install things for which we are missing
package.pyfiles.Spec.inject_patches_variant()was failing this requirement by attempting to look up the package class for concrete specs. This isn't needed -- we can skip it.spec_clauses()attempts to look up package information for concrete specs in order to determine which virtuals they may provide. This fails for renamed/deleted dependencies of buildcaches and installed packages.This will eventually be fixed by Add virtual information on DAG edges #35258, but we need a workaround to make older buildcaches usable.
Spec.inject_patches_variant()