Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incomplete update for bazel-skylib rules #388

Open
dhalperi opened this issue Jun 4, 2024 · 2 comments
Open

incomplete update for bazel-skylib rules #388

dhalperi opened this issue Jun 4, 2024 · 2 comments

Comments

@dhalperi
Copy link
Contributor

dhalperi commented Jun 4, 2024

https://github.com/batfish/batfish/pull/9050/files

Today, bazel-steward only updates 3 of the 4 references to the old version. It works because there are two mirrors, with a warning. I believe we are using the recommended parameters for WORKSPACE setup: https://github.com/bazelbuild/bazel-skylib/releases/tag/1.7.1

@dhalperi
Copy link
Contributor Author

dhalperi commented Jun 4, 2024

Note:

urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/<NOT UPDATED>1.7.0<NOT UPDATED>/bazel-skylib-1.7.1.tar.gz",
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
    ],

@lukaszwawrzyk
Copy link
Collaborator

Hi, thanks for the feedback!

Unfortunately, the replacement logic is based on heuristics. We try to catch a lot of possible scenarios and an easy fix for this one might break some other important scenarios. I think it would need a major rewrite of these heuristics to be even more bulletproof. With bzlmod already here it is probably not worth the effort.

As a workaround, you can either just use one url (preferably github one) or put version in one place like this:

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

BAZEL_SKYLIB_VERSION = "1.7.1"
BAZEL_SKYLIB_SHA256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f"

http_archive(
    name = "bazel_skylib",
    sha256 = BAZEL_SKYLIB_SHA256,
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{0}/bazel-skylib-{0}.tar.gz".format(BAZEL_SKYLIB_VERSION),
        "https://github.com/bazelbuild/bazel-skylib/releases/download/{0}/bazel-skylib-{0}.tar.gz".format(BAZEL_SKYLIB_VERSION),
    ],
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants