Fetching from URLs falls back to mirrors if they exist#13881
Fetching from URLs falls back to mirrors if they exist#13881tgamblin merged 13 commits intospack:developfrom
Conversation
973cda2 to
66138d2
Compare
|
This feature has been in demand for quite some time! I think it will be less valuable once Spack has its own source mirror on AWS, but still worth adding in my opinion! |
|
Considering the number of GNU packages that we support (latest count 55), if people agree I can go one step further and create a class Autoconf(AutotoolsPackage, GNUFetcher):
gnu_path = 'autoconf/autoconf-2.69.tar.gz'and have main Once the feature set of this PR is decided I'll also add docs. |
|
Looks good so far and GNU fetcher abstraction sounds good to me! |
8162844 to
f510531
Compare
|
Can people have a look at f510531 and let me know what they think? If there's agreement on a solution like that I'll go on and modify the remaining 54 GNU packages. |
|
And add docs too 🙂 |
|
Just tried this patch on 008fe37 and |
|
This PR is ready for a first round of reviews |
There was a problem hiding this comment.
This is really cool, thank you so much!
I wonder if we should also re-try with the next mirror if the downloaded package archive hash does not match what we expected. This can be the case in captive portals but also if some pages moved and are wildcard redirected, or if index/404 pages are downloaded instead of the expected source.
0af5ae7 to
591c36e
Compare
Previously the needed to define 'url' and optionally 'mirrors'
b9b7939 to
a075753
Compare
|
@tgamblin Let me know if there are further changes needed in this PR |
fixes #5613
fixes #4212
fixes #1090
refers to #13874
This PR permits to list mirrors of the main
urlin packages. If the mainurlis not available theurlin the mirrors will be tried in order. It also defines aGNUMirrorPackagemixin to deal with the special case of GNU packages and modifies all the GNU packages in the built-in repository.Note that the feature is implemented starting from 5b377a0 while previous commits are just trivial refactors that should reduce a bit the complexity of fetchers. If they are considered noise for a review I can split this PR into two.