Allow suppression of 404 code from repository_ctx.download
#13,394 创建于 2021年4月22日
仓库指标
- Star
- (25,384 star)
- PR 合并指标
- (平均合并 22天 20小时) (30 天内合并 77 个 PR)
描述
Many rulesets and user configurations include several mirrors for an artifact. A common one is that mirror.bazel.build is used as a secondary url.
However it's hard to predict ahead of time which mirrors host what. For example in rules_nodejs we gave up on using mirror.bazel.build because it was too hard to mirror every single release artifact given the manual process of requesting that from the bazel team.
Another example is in rules_jvm_external where the list of urls is constructed from the list of maven mirrors and the list of packages, without regard for which packages are hosted where. In https://github.com/bazelbuild/rules_jvm_external/issues/349#issuecomment-582499282 @jin suggests that this should be fixed in repository_ctx#download* functions.
I imagine this would take the form of a new keywoard-argument to that function. Perhaps this is specific to 404, or maybe we allow users to indicate what HTTP response codes they want to ignore.