add support for --sources-url to fetch sources from additional URLs #4079
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a --sources-url CLI option. It is a comma separated list of URLs that EasyBuild will fetch sources from. It replaces the hard-coded
EASYBUILD_SOURCES_URL
, but keeps it as a default value. The --sources-url-priority option is used to determine if these URLs are to be queried first, or last, i.e. as a fallback.Unfortunately, this breaks 3 tests related to downloading the file, and I'm unsure of exactly why. It seems that
build_option('sources_url')
might return None when the function is run through the test harness, rather than getting populated with the default value. I've tried adding ainit_config(args=["--sources-url=https://sources.easybuild.io"])
, but that didn't work either.If the feature is of interest, could you give me a hand in fixing the tests?
EDIT: After some discussion on Slack, I was able to fix the tests. I also renamed the options to
--extra-source-urls
and--extra-source-urls-priority
. I changed the commit mesage to be imperative.