bazel-skylib
bazel-skylib copied to clipboard
Build of maprule tests via "bazel build @bazel_skylib//tests/..." fails
WORKSPACE:
workspace(name = "foo")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
skylib_version = "0.8.0"
http_archive(
name = "bazel_skylib",
type = "tar.gz",
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib.{}.tar.gz".format (skylib_version, skylib_version),
sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
Command:
bazel build @bazel_skylib//tests/...
Output:
INFO: Analyzed 91 targets (0 packages loaded, 0 targets configured).
INFO: Found 91 targets...
ERROR: /usr/local/google/home/fwe/.cache/bazel/_bazel_fwe/ea0f404d46c6e8c3c74ad70e292ab53d/external/bazel_skylib/tests/maprule/BUILD:27:1: error executing shell command: '/bin/bash -c $MAPRULE_TOOL' failed (Exit 1) bash failed: error executing command /bin/bash -c '$MAPRULE_TOOL'
Use --sandbox_debug to see verbose messages from the sandbox
cat: ../bazel_skylib/tests/maprule/foo.txt: No such file or directory
INFO: Elapsed time: 0.440s, Critical Path: 0.12s
INFO: 3 processes: 3 linux-sandbox.
FAILED: Build did NOT complete successfully
Failure on CI: https://buildkite.com/bazel-testing/bazel-federation/builds/7#6d79a099-d63c-4a66-a234-298da77b9317
IMO this is a bazel bug. There is no good way to write this test. https://github.com/bazelbuild/bazel/issues/7130
FWIW, with bazel 4.1.0 and bazel_skylib 1.0.3 (with url = "https://github.com/bazelbuild/bazel-skylib/archive/refs/tags/{}.tar.gz".format (skylib_version) and sha256 = '7ac0fa88c0c4ad6f5b9ffb5e09ef81e235492c873659e6bb99efb89d11246bcba'), this fails with
ERROR: error loading package '': Every .bzl file must have a corresponding package, but '@bazel_skylib//:workspace.bzl' does not have one. Please create a BUILD file in the same or any parent directory. Note that this BUILD file does not need to do anything except exist.
INFO: Elapsed time: 0.110s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)