VirtusLab / bazel-steward

A bot to keep Bazel dependencies up to date
https://virtuslab.github.io/bazel-steward/
Apache License 2.0
62 stars 6 forks source link

incomplete update for bazel-skylib rules #388

Open dhalperi opened 5 months ago

dhalperi commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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