spack/lib/spack
Harmen Stoppels 296e5308a7
mirror: fetch by digest (#45809)
Source mirrors store entries by digest and add a human readable alias of the
form 'name-version'. If no digest is available, the alias is used as the primary
storage location.

Spack erroneously fetches by alias when the digest path does not exist. This is
problematic if `version(..., sha256=...)` changes in package.py, and the mirror
is populated with the old shasum. That would result in an error when a digest
is available, but in case of git versions with a modified commit sha, the wrong
sources would be fetched without error. With this PR, only the digest path is
used, not the alias, in case a digest is available. This is also a small performance
optimization, as the number of request is halved for mirrors that don't contain
the sources.

Further, for git sources the tag was used as a digest, but this is a moving
target. Only commit sha is used now.

Also whenever the alias already existed, Spack used to keep it in place when
updating the mirror cache, which means that aliases would always point to
outdated mirror entries whenever digests are modified. With this PR the alias
is moved in place.

Lastly, fix a recent regression where `Stage.disable_mirrors` disabled mirrors
but not the local download cache, which was the intention.
2024-08-24 09:09:25 +02:00
..
docs Add options for sparse checkout in GitFetcher (#45473) 2024-08-15 05:28:34 +00:00
env Compiler wrapper: add env var to pass vcheck flags (#44588) 2024-08-08 06:40:36 +00:00
external Update archspec to v0.2.5-dev (7e6740012b897ae4a950f0bba7e9726b767e921f) (#45721) 2024-08-15 19:49:07 +02:00
llnl Add missing MultiMethodMeta metaclass in builders (#45879) 2024-08-23 09:23:25 +02:00
spack mirror: fetch by digest (#45809) 2024-08-24 09:09:25 +02:00
spack_installable Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00