When trying to download Eigen with
http_archive(
name = "eigen",
strip_prefix = "eigen-3.3.7",
sha256 = "d56fbad95abf993f8af608484729e3d87ef611dd85b3380a8bad1d5cbc373a57",
urls = [
"https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz"
],
build_file = "//third_party:eigen.BUILD"
)
bazel fetch yields the error
WARNING: Download from https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 406 Not Acceptable
ERROR: An error occurred during the fetch of repository 'eigen':
java.io.IOException: Error downloading [https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz]
I has been working for weeks so I am wondering if the problem comes from bazel or from the GitLab server?
I have no real solution for your problem, but some fixes (tested with Bazel 2.2.0):
Fix 1: Make use of mirrors
Host eigen
yourself
I use now my own webserver to host eigen
:
http_archive(
name = "eigen",
build_file = "//:eigen.BUILD",
sha256 = "d56fbad95abf993f8af608484729e3d87ef611dd85b3380a8bad1d5cbc373a57",
strip_prefix = "eigen-3.3.7",
url = "http://vertexwahn.de/artifacts/eigen-3.3.7.tar.gz",
)
You can also add both urls
:
http_archive(
name = "eigen",
build_file = "//:eigen.BUILD",
sha256 = "d56fbad95abf993f8af608484729e3d87ef611dd85b3380a8bad1d5cbc373a57",
strip_prefix = "eigen-3.3.7",
urls = [
"https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz",
"http://vertexwahn.de/artifacts/eigen-3.3.7.tar.gz",
],
)
Fix 2: Hold a local copy
Make use of --distdir
.
Put eigen-3.3.7.tar.gz
in a directory on your machine and use --disdir
.
bazel build --distdir=X:\Dropbox\artifacts //...
Summary
Since you want never to be blocked by a dumb webserver you should implement some strategies on how to continue working when something like this happens.
Nevertheless, it would be interesting to find out why this 406 happens. You can use also use a Network sniffer (e.g. Wireshark) to get probably more details we the get request fails. I tried to find out more using Wireshark, but its an https connection and everything is encrypted - too bad.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With