bazelbuild / bazel-skylib

Common useful functions and rules for Bazel
https://bazel.build/
Apache License 2.0
387 stars 180 forks source link

zlib not found #449

Closed dpetrou-continua closed 1 year ago

dpetrou-continua commented 1 year ago

Hi. I'm trying to use the current version of Skylib, and it looks like zlib isn't found:

INFO: Repository zlib instantiated at:
  /Users/dpetrou/Desktop/startup_source/depot/bazel/WORKSPACE:46:14: in <toplevel>
  /private/var/tmp/_bazel_dpetrou/d9c97ab13e8004591e3172af2be9858f/external/com_google_protobuf/protobuf_deps.bzl:9:21: in protobuf_deps
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_dpetrou/d9c97ab13e8004591e3172af2be9858f/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
WARNING: Download from https://zlib.net/zlib-1.2.11.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
ERROR: An error occurred during the fetch of repository 'zlib':
   Traceback (most recent call last):
    File "/private/var/tmp/_bazel_dpetrou/d9c97ab13e8004591e3172af2be9858f/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, 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 /private/var/tmp/_bazel_dpetrou/d9c97ab13e8004591e3172af2be9858f/external/zlib/temp10697574045049452602/zlib-1.2.11.tar.gz: GET returned 404 Not Found

My WORKSPACE has:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "bazel_skylib",
    sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
    ],
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

And when I use a browser on https://zlib.net/zlib-1.2.11.tar.gz I get a 404. The zlib.net homepage mentions something about upgrading to 1.2.13 because of a vulnerability in 1.2.12. Perhaps 1.2.11 was recently removed?

tetromino commented 1 year ago

This is not a bug in bazel_skylib.

It's a bug in the com_google_protobuf repo which was fixed several months ago in https://github.com/protocolbuffers/protobuf/commit/36f168f046007361d70556ae95a1ab532fd4968; I believe that the fix was then released as part of https://github.com/protocolbuffers/protobuf/releases/tag/v22.0

As far as I know, bazel_skylib does not use com_google_protobuf. Please check your WORKSPACE file and update the protobuf dep or other dep that pulls it in.

If you are sure that the problem is with bazel_skylib, please provide your complete WORKSPACE file and the version of Bazel you are using, and we can take a look.

dpetrou-continua commented 1 year ago

Thanks tetromino. Looks like I was chasing down old instructions in creating my WORKSPACE. After getting your note, I found simple and concise directions at https://github.com/bazelbuild/rules_proto/releases and I'm now in business. Thanks. David