bazelbuild / bazelbuild/bazel

`http_archive` shall try other mirrors if a mirror returned wrong hash

Open
#8,737 10 comments 0 reactions 0 assignees View on GitHub
not stale P4 team-ExternalDeps type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

Latest release, Windows.

```
c:\Users\Chebotarev_V\Documents\src\test_rules_cc>bazelisk build @bazel_skylib//:*
INFO: Invocation ID: f3bf734c-eb5b-4f2d-85ec-50566fa28440
INFO: Call stack for the definition of repository 'bazel_skylib' which is a http_archive (rule definition at C:/users/chebotarev_v/_bazel_chebotarev_v/tqgoo6cs/external/bazel_tools/tools/build_defs/repo/http.bzl:237:16):
- C:/users/chebotarev_v/documents/src/test_rules_cc/cc/repositories.bzl:19:9
- C:/users/chebotarev_v/documents/src/test_rules_cc/cc/repositories.bzl:6:5
- C:/users/chebotarev_v/documents/src/test_rules_cc/WORKSPACE:85:1
ERROR: An error occurred during the fetch of repository 'bazel_skylib':
java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/0.8.0.tar.gz, https://github.com/bazelbuild/bazel-skylib/archive/0.8.0.tar.gz] to C:/users/chebotarev_v/_bazel_chebotarev_v/tqgoo6cs/external/bazel_skylib/0.8.0.tar.gz: Checksum was 2ea8a5ed2b448baf4a6855d3ce049c4c452a6470b1efd1504fdb7c1c134d220a but wanted 2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e
ERROR: Skipping '@bazel_skylib//:...': no such package '@bazel_skylib//': java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/0.8.0.tar.gz, https://github.com/bazelbuild/bazel-skylib/archive/0.8.0.tar.gz] to C:/users/chebotarev_v/_bazel_chebotarev_v/tqgoo6cs/external/bazel_skylib/0.8.0.tar.gz: Checksum was 2ea8a5ed2b448baf4a6855d3ce049c4c452a6470b1efd1504fdb7c1c134d220a but wanted 2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e
WARNING: Target pattern parsing failed.
ERROR: no such package '@bazel_skylib//': java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/0.8.0.tar.gz, https://github.com/bazelbuild/bazel-skylib/archive/0.8.0.tar.gz] to C:/users/chebotarev_v/_bazel_chebotarev_v/tqgoo6cs/external/bazel_skylib/0.8.0.tar.gz: Checksum was 2ea8a5ed2b448baf4a6855d3ce049c4c452a6470b1efd1504fdb7c1c134d220a but wanted 2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e
INFO: Elapsed time: 0.413s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
```

See bazelbuild/rules_cc#21

@hlopko

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `bazelisk build @bazel_skylib//:*` and inspect `http.bzl`, especially the `http_archive` path shown in the call stack. Trace how the listed mirror URLs are fetched and verified; done means a wrong hash from one mirror leads to trying the next mirror rather than stopping immediately.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.