bazeltools / bazel-deps

Generate bazel dependencies for maven artifacts
MIT License
249 stars 121 forks source link

Faiure due to indirect depency on expired zlib url #317

Closed rahulb1999 closed 1 year ago

rahulb1999 commented 1 year ago

I am running into the following error, while trying to run bazel run //:parse -- generate -rpwd-s 3rdparty/workspace.bzl -d dependencies.yaml. It happens because this project depends on version 3.8.0 of com_google_protobuf which in turn depends on zlib. The particular zlib url used in version 3.8.0 is no longer active.

ERROR: An error occurred during the fetch of repository 'zlib':
   Traceback (most recent call last):
    File "/home/ubuntu/.cache/bazel/_bazel_ubuntu/b26ed7439bb0d97834fc365137090839/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
        download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://zlib.net/zlib-1.2.11.tar.gz] to /home/ubuntu/.cache/bazel/_bazel_ubuntu/b26ed7439bb0d97834fc365137090839/external/zlib/zlib-1.2.11.tar.gz: GET returned 404 Not Found
ERROR: /home/ubuntu/.cache/bazel/_bazel_ubuntu/b26ed7439bb0d97834fc365137090839/external/com_google_protobuf/BUILD:148:11: @com_google_protobuf//:protobuf depends on @zlib//:zlib in repository @zlib which failed to fetch. no such package '@zlib//': java.io.IOException: Error downloading [https://zlib.net/zlib-1.2.11.tar.gz] to /home/ubuntu/.cache/bazel/_bazel_ubuntu/b26ed7439bb0d97834fc365137090839/external/zlib/zlib-1.2.11.tar.gz: GET returned 404 Not Found

Adding the following in your workspace file should fix the issue

        http_archive(
            name = "zlib",
            build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
            sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
            sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff",
            strip_prefix = "zlib-1.2.11",
            urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
            urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"],
        )
johnynek commented 1 year ago

sorry for the latency.

fixed by #314