bazel-steward icon indicating copy to clipboard operation
bazel-steward copied to clipboard

incomplete update for bazel-skylib rules

Open dhalperi opened this issue 1 year ago • 2 comments

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 avatar Jun 04 '24 15:06 dhalperi

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",
    ],

dhalperi avatar Jun 04 '24 15:06 dhalperi

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),
    ],
)

lukaszwawrzyk avatar Jun 07 '24 15:06 lukaszwawrzyk