summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2023-01-16 19:14:41 +0100
committerGitHub <noreply@github.com>2023-01-16 10:14:41 -0800
commit3489cc0a9b76837f0613d698815cb24f0eace07c (patch)
tree71c34b43136659c8ea87f4dd6ff57aa51b397a2b /var
parent9a25e21da85afd36dab208f7d228a0c9d52fc68f (diff)
downloadspack-3489cc0a9b76837f0613d698815cb24f0eace07c.tar.gz
spack-3489cc0a9b76837f0613d698815cb24f0eace07c.tar.bz2
spack-3489cc0a9b76837f0613d698815cb24f0eace07c.tar.xz
spack-3489cc0a9b76837f0613d698815cb24f0eace07c.zip
Refer to mirrors by name, path, or url (#34891)
With this change we get the invariant that `mirror.fetch_url` and `mirror.push_url` return valid URLs, even when the backing config file is actually using (relative) paths with potentially `$spack` and `$env` like variables. Secondly it avoids expanding mirror path / URLs too early, so if I say `spack mirror add name ./path`, it stays `./path` in my config. When it's retrieved through MirrorCollection() we exand it to say `file://<env dir>/path` if `./path` was set in an environment scope. Thirdly, the interface is simplified for the relevant buildcache commands, so it's more like `git push`: ``` spack buildcache create [mirror] [specs...] ``` `mirror` is either a mirror name, a path, or a URL. Resolving the relevant mirror goes as follows: - If it contains either / or \ it is used as an anonymous mirror with path or url. - Otherwise, it's interpreted as a named mirror, which must exist. This helps to guard against typos, e.g. typing `my-mirror` when there is no such named mirror now errors with: ``` $ spack -e . buildcache create my-mirror ==> Error: no mirror named "my-mirror". Did you mean ./my-mirror? ``` instead of creating a directory in the current working directory. I think this is reasonable, as the alternative (requiring that a local dir exists) feels a bit pendantic in the general case -- spack is happy to create the build cache dir when needed, saving a `mkdir`. The old (now deprecated) format will still be available in Spack 0.20, but is scheduled to be removed in 0.21: ``` spack buildcache create (--directory | --mirror-url | --mirror-name) [specs...] ``` This PR also touches `tmp_scope` in tests, because it didn't really work for me, since spack fixes the possible --scope values once and for all across tests, so tests failed when run out of order.
Diffstat (limited to 'var')
0 files changed, 0 insertions, 0 deletions