Skip to content

chore(PSEC): log release job failures on ic-private - #1313

Merged
tmu0 merged 2 commits into
masterfrom
tmu/log-rls-failures
Sep 3, 2024
Merged

tmu0 merged 2 commits into
masterfrom
tmu/log-rls-failures

Conversation

@tmu0

@tmu0 tmu0 commented Sep 3, 2024

Copy link
Copy Markdown
Contributor

If the release job is running in ic-private use log level info and print the reason why the job failed.

@tmu0
tmu0 requested a review from a team as a code owner September 3, 2024 15:02
@tmu0
tmu0 requested a review from a team as a code owner September 3, 2024 15:04
@tmu0
tmu0 requested review from venkkatesh-sekar and removed request for a team September 3, 2024 15:05
@tmu0
tmu0 enabled auto-merge September 3, 2024 15:05

@venkkatesh-sekar venkkatesh-sekar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks.

@tmu0
tmu0 added this pull request to the merge queue Sep 3, 2024
Merged via the queue into master with commit ced2aca Sep 3, 2024
@tmu0
tmu0 deleted the tmu/log-rls-failures branch September 3, 2024 15:53
AleDema pushed a commit to AleDema/ic that referenced this pull request Nov 18, 2026
…#12159)

Upgrades `rules_foreign_cc` from 0.15.2 to
[0.17.0](https://github.com/bazel-contrib/rules_foreign_cc/releases/tag/0.17.0),
its latest release. 0.15.2 was never released: the `bazel_dep` only
resolved because an `archive_override` replaced it with the unreleased
commit
[f68b351c](bazel-contrib/rules_foreign_cc@f68b351)
(2026-06-27, between 0.15.1 and 0.16.0), pinned for its newer Meson.
0.17.0 contains that commit plus [28
more](bazel-contrib/rules_foreign_cc@f68b351...0.17.0),
so we're back on a BCR release.

The release artifacts don't change: the IC-OS images and the binary and
canister bundles are byte-identical to master's.

## Changes

- **`MODULE.bazel`**:
- `rules_foreign_cc` 0.15.2 → 0.17.0. The `archive_override` becomes a
`single_version_override` that applies our patch on top of BCR's source.
BCR's only patch for 0.17.0 sets the version in its `MODULE.bazel`. The
comment about using HEAD for a recent Meson is gone, since 0.17.0 ships
Meson 1.12.1 (f68b351c had 1.10.1). The new comment says what the patch
is for.
- 0.17.0 requires at least `bazel_skylib` 1.9.2 and `rules_shell` 0.8.0.
Master has `bazel_skylib` 1.9.2 and `rules_shell` 0.10.0 since dfinity#12150
and dfinity#12152. This PR carried the same two bumps, plus dfinity#12150's two
`allow_symlink = True` lines in `publish/canisters/BUILD.bazel`, which
skylib 1.9.2 needs; they dropped out of its diff when I merged master.
- The `register_toolchains` for the preinstalled `make` and `pkg-config`
are unchanged and still take precedence: the generated build scripts use
`MAKE=make` and `PKG_CONFIG=pkg-config`. Since 0.16.0, the make and
pkg-config that rules_foreign_cc builds by default come from the `make`
and `pkgconf` BCR modules, not from the bootstrap scripts
[dfinity#1313](bazel-contrib/rules_foreign_cc#1313)
is about. A new comment above them says why we register them, with a
TODO to drop the registrations if the module-built make and pkg-config
turn out to be reproducible. That check is left for a follow-up.
- **`bazel/rules_foreign_cc.patch`**: the content is unchanged. Only the
`index` line and the hunk position (715 → 748) are regenerated, so the
patch applies to 0.17.0 with no offset (the old patch applied with a
33-line offset). We still need it:
[dfinity#1313](bazel-contrib/rules_foreign_cc#1313)
is open, and 0.17.0's `wrap_outputs` still declares the build log as an
output and keeps it after a successful build. With the patch, the logs
of all seven foreign_cc targets are 1 byte (a newline).
- **`bazel/conf/.bazelrc.build`**: the comment on
`--incompatible_default_to_explicit_init_py` now names the `meson`
module's `py_binary` (`@@meson+//:meson`), which rules_foreign_cc 0.17.0
runs instead of a meson it builds itself. The flag still applies to it.
dfinity#12158 (rules_python 2.5.1), now in master, edited the same comment: it
dropped rules_python's `py_console_script_gen_py` from the list and
notes that rules_python opts out its own targets. The merge of master
keeps both edits.

## Module graph

Compared with master, `bazel mod graph` shows these changes besides
`rules_foreign_cc`:

- 0.17.0 adds six modules: `m4` 1.4.21.bcr.8, `make` 4.4.1.bcr.3,
`meson` 1.12.1, `ninja` 1.13.2, `pkgconf` 3.0.10, and
`rules_cc_autoconf` 0.32.0, which `m4`, `make` and `pkgconf` are built
with.
- `nlohmann_json` moves from 3.6.1 to 3.12.0.bcr.1, required by
`rules_cc_autoconf`. The only other module that depends on it is
`rules_swift`.
- `package_metadata` moves from 0.0.7 to 0.0.13, required by `m4` and
`make`.
- 0.17.0 requires at least `bazel_features` 1.47.1 and `bazel_lib`
3.2.0. We already resolve 1.50.0 and 3.2.2, so neither moves.

There are no new direct-dependency version warnings.

## Upstream changes that touch our setup

These are the relevant changes between f68b351c and 0.17.0.
[NEWS.md](https://github.com/bazel-contrib/rules_foreign_cc/blob/0.17.0/NEWS.md)
has the full list. All seven of our foreign_cc targets were built with
0.17.0, and I compared their generated build scripts with master's.

- **m4, make, ninja, meson and pkg-config now come from BCR modules by
default**
([dfinity#1582](bazel-contrib/rules_foreign_cc#1582),
[dfinity#1584](bazel-contrib/rules_foreign_cc#1584),
[dfinity#1596](bazel-contrib/rules_foreign_cc#1596)).
The build scripts differ from master's only in these tools:
- **m4**: previously the container's `m4`, found on `PATH`. Now it is m4
1.4.21, built from the `m4` module with our hermetic toolchain, exported
as `M4` and linked into `$EXT_BUILD_DEPS/bin` in every `configure_make`
action. Of our targets, only `@jemalloc//:jemalloc_private` runs
autoconf (`autoconf = True`). Its autoconf, still the container's, now
gets that m4 through `M4`. `libjemalloc.a` stays byte-identical.
- **meson** (libfuse only): previously 1.10.1, built by
rules_foreign_cc. Now it is the `py_binary` from the `meson` 1.12.1
module, wrapped in the new `meson_tool_toolchain`
([dfinity#1599](bazel-contrib/rules_foreign_cc#1599)).
That toolchain also exports `PYTHON3`, `MESON_REAL` and
`RULES_PYTHON_EXTRACT_ROOT`.
- **ninja** (libfuse only): previously the prebuilt 1.13.2 binary. Now
it is ninja 1.13.2, built from the `ninja` module.
- **make and pkg-config**: unchanged, because our preinstalled
registrations come first.
- **Build cost**: the first build of a `configure_make` target now also
builds m4, and `rules_cc_autoconf` runs m4's configure checks as
separate (cacheable) Bazel actions. In a fresh output base, building all
seven targets ran 1,463 actions locally; the other actions came from the
shared disk cache.
- **rules_foreign_cc no longer registers a Python toolchain for its
consumers**
([dfinity#1583](bazel-contrib/rules_foreign_cc#1583)).
Meson now runs on the Python 3.12 toolchain that our root module
registers (`PYTHON3` is `python_3_12_x86_64-unknown-linux-gnu`).
rules_foreign_cc's old registration was also for 3.12.
- **Foreign builds resolve their toolchains in a `foreign_cc` exec
group**
([dfinity#1604](bazel-contrib/rules_foreign_cc#1604)).
On Linux we have a single execution platform (`//:linux-glibc-2.31`),
and the tools still build in the same `linux-glibc-2.31-opt-exec`
configuration.
- **`PWD` is dropped from the C/C++ toolchain environment**
([dfinity#1606](bazel-contrib/rules_foreign_cc#1606)).
Our toolchain never put it there: no build script exports it, before or
after this change.

## Verification

All of these were run in the dev container. The module graph, analysis,
lint and release-artifact checks were run again on the latest commit,
along with the new canister and `py_binary` checks. The foreign_cc
builds and tests ran on the first commit; the later commits only change
`publish/canisters/BUILD.bazel` and comments. After dfinity#12150, dfinity#12152 and
dfinity#12158 landed, I merged master into this branch and re-ran `bazel mod
graph` (the changes above, and only the `rules_qemu` warning that master
also prints), `bazel build //... --nobuild` (all 3389 targets analyze)
and `bazel run //:buildifier` (no changes).

- `bazel mod graph`, master vs. this PR: the changes listed above. The
only warning is the existing `rules_qemu` `use_repo` one.
- `bazel build //... --nobuild`: all 3387 targets analyze, with no
`__init__.py` deprecation warnings.
- CI Linter parity: the eight `//pre-commit` checks pass, including
`buf-breaking-check`. The autofixes (`buildifier-fix`, `shfmt-fix`,
`ruff-fix`, `:rustfmt`, `:gazelle`) and `//:buildifier` leave the tree
clean.
- **Canister copies**: `bazel aquery
'mnemonic("Symlink|CopyFile|SymlinkFile", //publish/canisters:all)'`
finds 87 `Symlink` actions, and its output is identical to master's.
Without the two `allow_symlink` lines it finds 87 `CopyFile` actions.
The 20 `file_size_check` tests in `//publish/canisters` pass (cached
results).
- **Python executables of other modules**: `bazel cquery
'kind("py_binary", deps(//...))'` lists `@@meson+//:meson` and no
`py_binary` from a rules_foreign_cc repository.
- **Builds and tests**: all seven rules_foreign_cc targets in the repo
build, along with `//:mke2fs`, `//:fuse2fs` and `//:debugfs`. That is
five `configure_make` targets (e2fsprogs, dosfstools, mtools, openssl,
jemalloc), one `make` target (dnsmasq) and one `meson` target (libfuse).
These tests, which run the built `mkfs.fat` and `mcopy`, pass:
  - `//rs/ic_os/build_tools/partition_tools:partition_tools_test`
  - `//rs/ic_os/config/tool:config_lib_test`
  - `//rs/ic_os/config/tool:config_lib_test_dev`
  - `//rs/ic_os/os_tools/guest_vm_runner:guest_vm_runner_test`
- **Release artifacts**: these are byte-identical to master's (133
files), both on the first commit and on the latest one:
- the unstamped IC-OS bundles (GuestOS prod disk and update, GuestOS
recovery update, HostOS update, SetupOS)
  - `//publish/binaries:bundle`
  - `//publish/canisters:bundle`

e2fsprogs (with libfuse), dosfstools, mtools and jemalloc are in that
build graph and were built with 0.17.0 for this check.
- **The foreign_cc outputs themselves**: I hashed the outputs of all
seven targets (332 files) for master and for this PR, in one output
base. Master's outputs came from the caches; this PR's were built
locally. 331 files are identical, including `mke2fs`, `debugfs`,
`fuse2fs`, `libfuse3.a`, `libjemalloc.a`, `libssl.a`, `mkfs.fat`,
`mcopy` and `dnsmasq`.
- The one difference is openssl's `libcrypto.a`, which isn't
reproducible in the first place. Master's copy was built on a CI runner
and this PR's locally, at different times. Only four of its 961 objects
differ. `cversion.o` has the build time. All four (`cversion.o`,
`defaults.o`, `x509_def.o` and `ct_log.o`) have the absolute sandbox
path, which is compiled in through `OPENSSLDIR`, `ENGINESDIR` and
`MODULESDIR` (configure derives them from `--prefix`) and through the
clang path in the `compiler:` string. openssl isn't in the release
artifacts' build graph.

Not verified locally: macOS builds (openssl is built with
`configure_make` there too), the system tests (the only users of
dnsmasq), and the rest of the test suite. CI covers the full build and
test suite.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
AleDema pushed a commit to AleDema/ic that referenced this pull request Nov 18, 2026
…#12155)

Upgrades `aspect_bazel_lib` from 2.19.3 to
[2.22.5](https://github.com/bazel-contrib/bazel-lib/releases/tag/v2.22.5),
its latest release. 2.x is the last `aspect_bazel_lib` line: from 3.0 on
the module is published as `bazel_lib`, which is already in our graph at
3.2.2 (through `llvm`, `rules_qemu`, `rules_distroless`,
`rules_foreign_cc`, `tar.bzl` and `yq.bzl`).

The bump comes with a small patch to `aspect_bazel_lib`'s
`MODULE.bazel`. Without it, `aspect_bazel_lib`'s own toolchains would
take over the toolchain types that it now aliases from `bazel_lib` and
`tar.bzl` (since 2.21.1 and 2.22.0). Then hermetic-llvm would assemble
its toolchain with `aspect_bazel_lib`'s tools instead of `bazel_lib`'s,
and every C/C++/Rust build would break as soon as `bazel_lib` >= 3.8.0
enters the graph (details below). With the patch, the build graph of the
release artifacts resolves the same toolchains as on master, and the
release artifacts are byte-identical.

## Changes

- **`MODULE.bazel`**: version bump, plus a `single_version_override`
that applies the patch below and pins 2.22.5. The pin is needed because
Bazel applies a patch to a module's `MODULE.bazel` to every version of
the module that it visits during resolution, and `rules_oci` 2.0.0 asks
for 2.7.2, where the patch doesn't apply.
- The pin also holds `aspect_bazel_lib` at 2.22.5 when another module
asks for a newer version, and Bazel doesn't warn about that. The comment
above the override says so and points to `bazel mod explain
aspect_bazel_lib --verbose`, which marks the requests that the pin
overrides, e.g. `[email protected] # (was 2.7.2, cause
single_version_override)` under `rules_oci` 2.0.0. Nothing asks for more
than 2.22.5 today. In our graph, `rules_oci` 2.0.0 asks for 2.7.2 and
`jq.bzl` 0.1.0 for 2.8.1. Among the latest releases of our direct
dependencies, the highest request is 2.21.1 (`rules_oci` 2.3.5).
- BCR's `aspect_bazel_lib/2.22.5` carries only its usual release patches
(version stamp, Go dev dependencies).
- 2.22.5 adds a dependency on `bazel_lib` 3.0.0 and asks for `tar.bzl`
0.5.1, `bazel_skylib` 1.8.1 and `stardoc` 0.7.1. We already resolve
`bazel_lib` 3.2.2, `tar.bzl` 0.10.4, `bazel_skylib` 1.9.0 and `stardoc`
0.7.2, so no other module's resolved version changes.
- **`bazel/aspect_bazel_lib_aliased_toolchains.patch`** (new): removes 5
of the 9 `register_toolchains` entries from `aspect_bazel_lib`'s
`MODULE.bazel`, those of the five toolchain types that 2.21.1 and 2.22.0
turned into aliases (`copy_directory`, `copy_to_directory`, `coreutils`,
`expand_template` and `tar`). jq, yq, zstd and bats are still
`aspect_bazel_lib`'s own toolchain types and keep their registrations.
The patch applies to the BCR source with no offset or fuzz.

## Why the patch


[bazel-contrib/bazel-lib#1153](bazel-contrib/bazel-lib#1153)
(2.21.1) turned the `tar` toolchain type into an alias of `tar.bzl`'s.
[bazel-contrib/bazel-lib#1216](bazel-contrib/bazel-lib#1216)
(2.22.0) turned the `copy_directory`, `copy_to_directory`, `coreutils`
and `expand_template` toolchain types into aliases of `bazel_lib`'s, so
that rules from both modules create identical actions. But
`aspect_bazel_lib` still registers its own toolchains for all five. It
is a direct dependency of the root module, while `bazel_lib` and
`tar.bzl` are transitive ones, so its registrations come first and win
for every rule that requests one of the shared types. With only the
version bump, `bazel cquery` shows two switches:

- **Release artifacts:** hermetic-llvm assembles its resource directory,
crt objects and the libc++/libc++abi/libunwind/glibc search directories
with `bazel_lib`'s `copy_file` and `copy_to_directory`. These 22
`CopyFile` and 86 `CopyToDirectory` actions (across configurations) are
the only users of these toolchains in the build graph of the release
artifacts. They would switch from `bazel_lib` 3.2.2's tools to
`aspect_bazel_lib`'s, e.g. from uutils coreutils 0.5.0 to 0.1.0.
- **Test and Rosetta images:** the `tar.bzl` and `rules_distroless`
targets would switch from `tar.bzl`'s bsdtar
(hermeticbuild/bsdtar-prebuilt v3.8.1-3) to `aspect_bazel_lib`'s
(aspect-build/bsdtar-prebuilt v3.8.1). These are
`//rs/tests:{sh,awk,ca_certificates,dpkg_status,passwd,ubuntu_packages_tar}`
and the `passwd` layers in `//rs/rosetta-api/{icp,icrc1}` and
`//rs/tests/httpbin-rs`. For `sh`, `awk` and the `passwd` targets,
`tar.bzl`'s `tar` writes the `mtree` with `bazel_lib`'s
`expand_template`, and those actions would switch to
`aspect_bazel_lib`'s `expand_template` binary as well.

That alone would be harmless today. But `bazel_lib` 3.8.0
([bazel-contrib/bazel-lib#1310](bazel-contrib/bazel-lib#1310))
passes `copy_to_directory`'s arguments in a params file, which
`aspect_bazel_lib`'s binary doesn't accept. So once any module brings in
`bazel_lib` >= 3.8.0, every one of those `CopyToDirectory` actions
fails, and with them every C/C++/Rust build. This is
[bazel-contrib/bazel-lib#1312](bazel-contrib/bazel-lib#1312).
The latest releases of our direct dependencies ask for at most
`bazel_lib` 3.2.2, so this would only bite later.

Upstream fixed dfinity#1312 on its 2.x branch with
[bazel-contrib/bazel-lib#1313](bazel-contrib/bazel-lib#1313),
merged on 2026-11-14. No release has it yet: 2.22.5 is still the latest
2.x release. dfinity#1313 removes only the `copy_directory`,
`copy_to_directory` and `coreutils` registrations, which covers the
switch in the release artifacts but not the one in the images. This
patch also removes the `expand_template` and `bsd_tar` registrations.
That keeps the image targets above on the toolchains they use on master,
and all five aliased types resolve the same way.

With the patch, each aliased type resolves to the toolchains of the
module that defines it:

- The build graph of the release artifacts resolves exactly the
toolchains it does on master.
- The `tar.bzl` and `rules_distroless` targets above keep `tar.bzl`'s
bsdtar and `bazel_lib`'s `expand_template`, as on master.
- `rules_oci` 2.0.0's `oci_image` and `oci_load`, and our
`expand_template`, ask for `aspect_bazel_lib`'s alias types. So they now
get `tar.bzl`'s bsdtar and `bazel_lib`'s coreutils (0.5.0) and
`expand_template`. On master they get `aspect_bazel_lib`'s bsdtar 3.7.9
and coreutils 0.0.27.
- Both sets of toolchains provide the same fields (`tarinfo.binary`,
`coreutils_info.bin`, `expand_template_info.bin`,
`copy_to_directory_info.bin`). The `expand_template`, `copy_directory`
and `copy_to_directory` Go tools of `aspect_bazel_lib` 2.22.5 and
`bazel_lib` 3.2.2 are built from the same `main.go` files. Only their
shared helper package differs: `bazel_lib`'s also tries reflink copies
on Linux. The outputs are byte-identical (see Verification).

## Upstream changes that touch our setup

- Toolchain aliases: `tar`
([dfinity#1153](bazel-contrib/bazel-lib#1153), 2.21.1),
and `copy_directory`, `copy_to_directory`, `coreutils` and
`expand_template`
([dfinity#1216](bazel-contrib/bazel-lib#1216), 2.22.0).
See above.
- `aspect_bazel_lib`'s own bsdtar moves from 3.7.9 to 3.8.1
([dfinity#1126](bazel-contrib/bazel-lib#1126), 2.20.0),
and its coreutils from 0.0.27 to 0.1.0
([dfinity#1136](bazel-contrib/bazel-lib#1136), 2.21.0).
With the patch, nothing in our build uses these two any more.
- `expand_template` now adds the runfiles of its `data` to its own
([dfinity#1171](bazel-contrib/bazel-lib#1171), 2.21.2).
Our two `expand_template` targets,
`//rs/rosetta-api/{icp,icrc1}:stamped`, have no `data`.
- `copy_directory`, `copy_to_directory`, `copy_file` and `copy_to_bin`
now forward to `bazel_lib`'s implementations
([dfinity#1229](bazel-contrib/bazel-lib#1229),
[dfinity#1233](bazel-contrib/bazel-lib#1233), 2.22.4
and 2.22.5). We don't use them directly, only through `rules_oci`.
- Not relevant for us: jq stays 1.7, and zstd stays 1.5.6 (the same
binaries from a new URL). yq moves to 4.45.2, but nothing in our build
uses `aspect_bazel_lib`'s yq toolchain.

## Verification

All in the dev container:

- `bazel mod graph`: compared with master, only `aspect_bazel_lib`
changes (2.19.3 → 2.22.5). There are no new warnings; the existing
`rules_qemu` `use_repo` warning is unchanged.
- **After merging master**: dfinity#12150, dfinity#12152 and dfinity#12154 changed the
`bazel_skylib`, `rules_shell` and `buildifier_prebuilt` lines around
this PR's `aspect_bazel_lib` bump. The merge keeps master's versions of
those three and this PR's `aspect_bazel_lib` 2.22.5 with its comment and
override. Against master, `bazel mod graph` still changes only
`aspect_bazel_lib`. `bazel mod explain aspect_bazel_lib --verbose` lists
only the root module and `rules_oci` 2.0.0 (asking for 2.7.2), so no
module asks for a newer version that the pin would override. `bazel
build //... --nobuild` analyzes all 3389 targets, and `bazel run
//:buildifier` changes nothing.
- `bazel build //... --nobuild`: all 3387 targets analyze.
- Linter job:
`//pre-commit:{shfmt-check,ruff-check,buf-check,DFINITY-capitalization-check,do-not-merge-check,buildifier-check,gazelle-check,buf-breaking-check}`
pass. `buildifier-fix`, `shfmt-fix`, `ruff-fix` and `//:gazelle` leave
the tree clean.
- Toolchain resolution: for the release targets below, `bazel cquery
'deps(...)'` returns the same 110,935 configured targets as on master,
with the same toolchain targets. `aspect_bazel_lib` isn't among them.
Without the patch, the `coreutils` and `copy_to_directory` toolchains
switch to `aspect_bazel_lib`'s, as described above.
- **Release artifacts are byte-identical.** I built
`//publish/binaries:bundle`, `//publish/canisters:bundle` and the
unstamped IC-OS bundles that `ci/container/build-ic.sh --icos` builds
(GuestOS prod disk and update, GuestOS recovery update, HostOS prod
update, SetupOS prod). All 133 output files have the same SHA-256 as a
build of master at c712eb2. No sandboxed action ran: apart from 26
actions that run unsandboxed (`local`), every action was a cache hit.
- **The targets that use `aspect_bazel_lib`, or its toolchains through
`rules_oci`, produce byte-identical outputs.** I built these 21 targets,
which cover every kind of use, with 2.19.3 and with this PR in the same
output base. Both builds produce the same 77 files, and the 4 OCI layout
directories have the same structure and file modes:
  - `//rs/tests:{sh,awk}` (`tar`)
- `//rs/tests:{ca_certificates,dpkg_status,passwd,ubuntu_packages_tar}`
(`rules_distroless`)
- the OCI images and `oci_load` tarballs
`//rs/tests:{ubuntu_test_runtime_image_src,ubuntu_test_runtime.tar,static-file-server.tar,minica.tar}`,
`//rs/tests/httpbin-rs:{httpbin_image_src,httpbin.tar}`,
`//rs/rosetta-api/icp:{rosetta_image,rosetta_image.tar}` and
`//rs/rosetta-api/icrc1:{ic_icrc_rosetta_image,icrc_rosetta_image.tar}`
- `//rs/tests:colocate_uvm_config_image`, which packs the test-runtime
image tarball
- the Rosetta push scripts `//rs/rosetta-api/icp:push_rosetta_image` and
`//rs/rosetta-api/icrc1:push_ic_icrc_rosetta_image`
- their `:stamped` tag files, built both unstamped and with `--stamp
--embed_label=...` (which `rosetta-release.yml` passes); with stamping,
`expand_template` runs its toolchain's binary, now `bazel_lib`'s
- I also diffed the `bazel aquery` action keys of everything these
targets depend on, master against this PR. 58 of the 8,363 actions
change, all of them `rules_oci` actions whose tools are now
`bazel_lib`'s and `tar.bzl`'s: the 10 `OCIDescriptor` (`oci_image`) and
6 `OCITarball` (`oci_load`) actions, the 3 `CopyToDirectory` actions
that lay out pulled base images, and the template and runfiles actions
of their scripts. The images, tarballs and scripts they produce are
among the identical files above.
- Not built locally: the other `oci_load` tarballs of pulled images and
the other UVM config images under `//rs/tests` (e.g. `bitcoind.tar`,
`jaeger.tar`, `vector-with-log-fetcher.tar`, `ckbtc_uvm_config_image`).
They use the same rules as `static-file-server.tar`, `minica.tar` and
`colocate_uvm_config_image`.
- Not run locally: the 476 tests that depend on these targets are all
system tests under `//rs/tests`. CI runs them, along with the full build
and test suite.

The second commit changes only comments: the patch header and the
`MODULE.bazel` comment above the override. After it, I re-ran:

- The new patch applies with `patch -F0` (no offset or fuzz) to the
`MODULE.bazel` that the BCR serves for 2.22.5. The result has the same
SHA-256 as with the first commit's patch, and so does the
`aspect_bazel_lib` `MODULE.bazel` that Bazel fetched.
- `bazel mod graph` (depth 1 and full): the same output as before the
commit, with no new warnings. `bazel mod explain aspect_bazel_lib
--verbose` shows `[email protected] # (was 2.7.2, cause
single_version_override)` under `rules_oci` 2.0.0.
- I checked the pin's effect on newer requests in a scratch workspace
whose root module asks for `aspect_bazel_lib` 2.7.2 and depends on
`jq.bzl` 0.1.0, which asks for 2.8.1. With
`single_version_override(version = "2.7.2")`, Bazel resolves 2.7.2
without a warning, and `mod explain --verbose` shows `(was 2.8.1, cause
single_version_override)`. Without the override, it resolves 2.8.1 and
warns that the root module asks for 2.7.2.
- `bazel build //... --nobuild`: all 3387 targets analyze. The
Linter-job checks pass, and the autofixes plus `//:buildifier` leave the
tree clean.
- `bazel cquery 'deps(...)'` returns the same 110,935 configured targets
for the release targets, and the same 53,045 for the targets that use
the module, as before the commit. `bazel aquery`: all 8,363 action keys
in the deps of the 21 targets above are unchanged. So I didn't rebuild
the release artifacts for this commit.

## Follow-ups

- dfinity#12157 (`rules_oci` 2.3.5, which needs `aspect_bazel_lib` >= 2.21.1)
is stacked on this PR, so it lands after it.
- Once an `aspect_bazel_lib` 2.x release includes
bazel-contrib/bazel-lib#1313, this patch no longer applies (its hunk
fails against the 2.x branch). Then reduce it to the `expand_template`
and `bsd_tar` registrations, as the TODO in the patch says, and keep the
version pin. Dropping the patch instead would make the `tar` and
`expand_template` types resolve to `aspect_bazel_lib`'s bsdtar and
`expand_template`, including for the `tar.bzl` and `rules_distroless`
targets above.
- Possibly move our three direct uses of `aspect_bazel_lib`
(`expand_template` in the two Rosetta packages, `tar` in `//rs/tests`)
to `bazel_lib` and `tar.bzl`, its 3.x successors. `rules_oci` 2.x still
depends on `aspect_bazel_lib`, though.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants