From a6eaae0df93d02929c5bb6f6bb1bf9b36251be29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 2 Oct 2026 08:33:14 +0200 Subject: [PATCH 01/11] bazel: plain bazel_deps, no cmake, no host tools Make naja's Bazel build ready to be a Bazel Central Registry module: MODULE.bazel now contains only bazel_deps. - slang: sv-lang (native Bazel build) instead of building slang's CMake project through rules_foreign_cc. - TBB, Boost, fmt, spdlog, bison/m4: the BCR onetbb, boost.*, fmt, spdlog and bison modules instead of pkg-config/python3-config/PATH probing repository rules, vendored tarballs and the vendored spdlog. - Python: the rules_python toolchain for libpython and for the Python test runners. - cpptrace, tomlplusplus: dropped; nothing in naja's Bazel build uses them directly. - NajaVersion.h: the git hash comes from the module version (-- for registry builds) instead of a repository rule running git. - SV frontend tests: resolve the benchmarks path before changing the current directory, instead of baking the workspace's absolute path in with a repository rule. - Export FF_scan.lib for downstream test suites. Modules not on BCR yet (naja-if, naja-verilog, and sv-lang at the slang commit naja is developed against) are served by an in-tree registry in bazel/registry/ with BCR's layout, listed ahead of BCR in .bazelrc, so publishing them is a copy into a BCR pull request. The naja-verilog entry's overlay uses the BCR bison/flex modules. The submodule/Bazel pin check now reads the registry. Bazel CI no longer installs any host packages. Co-Authored-By: Claude Opus 5.5 --- .bazelignore | 13 +- .bazelrc | 7 +- .bazelversion | 2 +- .github/workflows/macos-bazel.yml | 39 +- .github/workflows/ubuntu-bazel.yml | 50 +- .reuse/dep5 | 4 + CLAUDE.md | 37 +- MODULE.bazel | 271 +------ MODULE.bazel.lock | 666 +++++++++--------- bazel/BUILD.bazel | 6 - bazel/git_version.bzl | 51 -- bazel/lefdef_bison.bzl | 83 --- bazel/registry/README.md | 56 ++ bazel/registry/bazel_registry.json | 1 + .../0.0.0-20260723-099677d9/MODULE.bazel | 7 + .../overlay/MODULE.bazel | 1 + .../0.0.0-20260723-099677d9/presubmit.yml | 12 + .../0.0.0-20260723-099677d9/source.json | 8 + bazel/registry/modules/naja-if/metadata.json | 11 + .../0.0.0-20260909-be6544b1/MODULE.bazel | 9 + .../overlay/BUILD.bazel | 60 ++ .../overlay/MODULE.bazel | 1 + .../0.0.0-20260909-be6544b1/presubmit.yml | 10 + .../0.0.0-20260909-be6544b1/source.json | 9 + .../modules/naja-verilog/metadata.json | 11 + .../11.0.0-20260701-b60d729d/MODULE.bazel | 25 + .../overlay/BUILD.bazel | 513 ++++++++++++++ .../overlay/MODULE.bazel | 1 + .../private/slang/export_headers/BUILD.bazel | 35 + .../overlay/private/tests/BUILD.bazel | 19 + .../overlay/private/tests/pyslang/BUILD.bazel | 11 + .../overlay/private/tests/pyslang/test.py | 21 + .../private/tests/pyslang/test_module.sv | 12 + .../overlay/pyslang/BUILD.bazel | 59 ++ .../overlay/pyslang/__init__.py | 1 + .../patches/toml_single_header.patch | 15 + .../11.0.0-20260701-b60d729d/presubmit.yml | 60 ++ .../11.0.0-20260701-b60d729d/source.json | 19 + bazel/registry/modules/sv-lang/metadata.json | 24 + bazel/registry/update_source.py | 58 ++ bazel/system_tool.bzl | 36 - bazel/thirdparty/BUILD.bazel | 11 - bazel/thirdparty/boost_overlay.BUILD | 31 - bazel/thirdparty/fmt_overlay.BUILD | 38 - bazel/thirdparty/python/BUILD.bazel | 6 - bazel/thirdparty/python/repo.bzl | 97 --- bazel/thirdparty/slang_host_prefixes.bzl | 40 -- bazel/thirdparty/slang_overlay.BUILD | 161 ----- bazel/thirdparty/tbb/BUILD.bazel | 6 - bazel/thirdparty/tbb/repo.bzl | 77 -- bazel/thirdparty/tomlplusplus_overlay.BUILD | 35 - bazel/workspace_root.bzl | 35 - ci/check_submodule_bazel_sync.py | 43 +- src/apps/naja_edit/BUILD.bazel | 1 - src/bne/BUILD.bazel | 3 +- src/core/BUILD.bazel | 8 +- src/core/naja_version.bzl | 18 + src/dnl/BUILD.bazel | 5 +- src/metrics/BUILD.bazel | 3 +- src/najaeda/examples/BUILD.bazel | 7 +- src/nl/formats/lefdef/BUILD.bazel | 3 +- src/nl/formats/systemverilog/BUILD.bazel | 2 +- src/nl/formats/verilog/BUILD.bazel | 1 + src/nl/formats/vhdl/BUILD.bazel | 1 + src/nl/netlist/BUILD.bazel | 4 +- .../netlist/serialization/capnp/BUILD.bazel | 1 + src/nl/python/naja_wrapping/BUILD.bazel | 12 +- src/nl/python/pyloader/BUILD.bazel | 5 +- src/optimization/BUILD.bazel | 3 +- test/najaeda/BUILD.bazel | 7 +- test/nl/formats/liberty/BUILD.bazel | 7 + .../systemverilog/frontend/BUILD.bazel | 9 +- .../frontend/SNLSVConstructorTestSimple.cpp | 10 +- test/nl/python/naja_wrapping/BUILD.bazel | 8 +- thirdparty/lefdef/src/def/def/BUILD.bazel | 23 +- thirdparty/lefdef/src/lef/lef/BUILD.bazel | 27 +- thirdparty/spdlog-1.17.0/BUILD.bazel | 15 - 77 files changed, 1606 insertions(+), 1491 deletions(-) delete mode 100644 bazel/BUILD.bazel delete mode 100644 bazel/git_version.bzl delete mode 100644 bazel/lefdef_bison.bzl create mode 100644 bazel/registry/README.md create mode 100644 bazel/registry/bazel_registry.json create mode 100644 bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/MODULE.bazel create mode 120000 bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/overlay/MODULE.bazel create mode 100644 bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/presubmit.yml create mode 100644 bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/source.json create mode 100644 bazel/registry/modules/naja-if/metadata.json create mode 100644 bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/MODULE.bazel create mode 100644 bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/overlay/BUILD.bazel create mode 120000 bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/overlay/MODULE.bazel create mode 100644 bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/presubmit.yml create mode 100644 bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/source.json create mode 100644 bazel/registry/modules/naja-verilog/metadata.json create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/MODULE.bazel create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/BUILD.bazel create mode 120000 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/MODULE.bazel create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/slang/export_headers/BUILD.bazel create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/BUILD.bazel create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/BUILD.bazel create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/test.py create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/test_module.sv create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/pyslang/BUILD.bazel create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/pyslang/__init__.py create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/patches/toml_single_header.patch create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/presubmit.yml create mode 100644 bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/source.json create mode 100644 bazel/registry/modules/sv-lang/metadata.json create mode 100755 bazel/registry/update_source.py delete mode 100644 bazel/system_tool.bzl delete mode 100644 bazel/thirdparty/BUILD.bazel delete mode 100644 bazel/thirdparty/boost_overlay.BUILD delete mode 100644 bazel/thirdparty/fmt_overlay.BUILD delete mode 100644 bazel/thirdparty/python/BUILD.bazel delete mode 100644 bazel/thirdparty/python/repo.bzl delete mode 100644 bazel/thirdparty/slang_host_prefixes.bzl delete mode 100644 bazel/thirdparty/slang_overlay.BUILD delete mode 100644 bazel/thirdparty/tbb/BUILD.bazel delete mode 100644 bazel/thirdparty/tbb/repo.bzl delete mode 100644 bazel/thirdparty/tomlplusplus_overlay.BUILD delete mode 100644 bazel/workspace_root.bzl create mode 100644 src/core/naja_version.bzl delete mode 100644 thirdparty/spdlog-1.17.0/BUILD.bazel diff --git a/.bazelignore b/.bazelignore index bf65f4e92..1432ca37e 100644 --- a/.bazelignore +++ b/.bazelignore @@ -8,14 +8,15 @@ build-tsan build-coverage build-coverage-svconstructor -# Submodule checkouts kept for CMake (see internal/bazel-migration-plan.md's -# Phase 1 "Bazel-only" scope decision) -- Bazel fetches its own separate -# copies of these instead (git_repository/bazel_dep in MODULE.bazel), so -# these on-disk checkouts should never be scanned as Bazel packages (some -# ship their own unrelated BUILD files with unmet dev dependencies, e.g. -# thirdparty/googletest's own test suite needs rules_python we don't have). +# Submodule checkouts kept for CMake -- Bazel takes these as modules +# (bazel_dep in MODULE.bazel) instead, so these on-disk checkouts should +# never be scanned as Bazel packages (some ship their own unrelated BUILD +# files with unmet dev dependencies). thirdparty/googletest thirdparty/naja-verilog thirdparty/cpptrace thirdparty/naja-if thirdparty/slang + +# Registry entries carry BUILD files for other modules (overlays). +bazel/registry diff --git a/.bazelrc b/.bazelrc index 0ed200817..327b6a7e1 100644 --- a/.bazelrc +++ b/.bazelrc @@ -2,6 +2,11 @@ # # SPDX-License-Identifier: Apache-2.0 +# Modules not yet on the Bazel Central Registry come from the in-tree +# registry (see bazel/registry/README.md); everything else from BCR. +common --registry=file://%workspace%/bazel/registry +common --registry=https://bcr.bazel.build/ + # Matches CMakeLists.txt:59's `set(CMAKE_CXX_STANDARD 20)` -- applied # globally here rather than per-target, same as the CMake build. build --cxxopt=-std=c++20 @@ -18,7 +23,7 @@ build -c opt # Force fully static linking on every platform. Found via live Ubuntu # CI (internal/bazel-migration-plan.md, Phase 8, task #26): Bazel's # default --dynamic_mode on Linux can auto-split a large cc_library -# (here, @slang//:slang's libsvlang.a) that's shared across multiple +# (here, @sv-lang//:libsvlang) that's shared across multiple # test binaries into an intermediate `_solib_k8/*.so`, built with only # what that specific linker invocation resolved at the time -- which can # come up short on symbols (`slang::SourceLocation::NoLocation`, a diff --git a/.bazelversion b/.bazelversion index e7fdef7e2..acd405b1d 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -8.4.2 +8.6.0 diff --git a/.github/workflows/macos-bazel.yml b/.github/workflows/macos-bazel.yml index 1449f8750..460b66d58 100644 --- a/.github/workflows/macos-bazel.yml +++ b/.github/workflows/macos-bazel.yml @@ -1,11 +1,10 @@ name: macOS Bazel Build -# CMake is naja's primary build system (see macos-build.yml) -- this -# workflow keeps the Bazel side (MODULE.bazel, BUILD.bazel throughout -# the tree) validated as a smoke test rather than as CI's main gate. See -# CLAUDE.md's "Build systems: CMake (primary) + Bazel (validated smoke -# test)" section, and internal/bazel-migration-plan.md for the full -# history of how this was built out and why it's not CI's primary path. +# CMake is naja's primary build system -- this workflow keeps the Bazel +# side (MODULE.bazel, BUILD.bazel throughout the tree) validated. The +# Bazel build needs no host packages: every library and code generator +# comes from a Bazel module (BCR, or bazel/registry/ for the few that are +# not on BCR yet). on: push: @@ -23,34 +22,10 @@ jobs: steps: - uses: actions/checkout@v7 - # No `submodules: true` -- Bazel fetches naja-if/naja-verilog/slang - # itself (MODULE.bazel), doesn't use the thirdparty/ checkouts. - # dependency-sync-check.yml is what keeps these two build systems' + # No `submodules: true` -- Bazel doesn't use the thirdparty/ + # checkouts. dependency-sync-check.yml keeps the two build systems' # pins from silently drifting apart. - - name: Install dependencies - # tomlplusplus here is for slang's *own* internal find_package() - # (bazel/thirdparty/slang_host_prefixes.bzl queries `brew --prefix - # tomlplusplus` for slang's CMAKE_PREFIX_PATH) -- unrelated to this - # repo's own @tomlplusplus (vendored via git_repository since - # libtomlplusplus-dev isn't apt-installable on Ubuntu; still needed - # here regardless of that). - run: | - brew install capnp tbb bison flex boost fmt tomlplusplus pkg-config - - - name: Set Homebrew paths - # Xcode's own toolchain ships an ancient BSD bison/flex - # (/Applications/Xcode*/.../usr/bin) that otherwise shadows - # Homebrew's -- e.g. that bison doesn't understand GNU bison's - # -Wconflicts-sr flag (bazel/lefdef_bison.bzl, - # bazel/thirdparty/*/system_tool.bzl's `which("bison")` picks - # whichever comes first on PATH). - run: | - echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH - echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH - echo "/opt/homebrew/opt/flex/bin" >> $GITHUB_PATH - echo "/opt/homebrew/opt/bison/bin" >> $GITHUB_PATH - - uses: bazel-contrib/setup-bazel@0.19.0 with: bazelisk-cache: true diff --git a/.github/workflows/ubuntu-bazel.yml b/.github/workflows/ubuntu-bazel.yml index 5729d6fd4..a72504aa4 100644 --- a/.github/workflows/ubuntu-bazel.yml +++ b/.github/workflows/ubuntu-bazel.yml @@ -1,28 +1,10 @@ name: Ubuntu Bazel Build -# CMake is naja's primary build system (see ubuntu-build.yml) -- this -# workflow keeps the Bazel side (MODULE.bazel, BUILD.bazel throughout -# the tree) validated as a smoke test rather than as CI's main gate. See -# CLAUDE.md's "Build systems: CMake (primary) + Bazel (validated smoke -# test)" section, and internal/bazel-migration-plan.md for the full -# history of how this was built out and why it's not CI's primary path. -# -# @fmt//:fmt and @tomlplusplus//:tomlplusplus are vendored (git_repository -# + bazel/thirdparty/{fmt,tomlplusplus}_overlay.BUILD in MODULE.bazel, -# each pinned to the exact version slang itself requires) rather than -# pkg-config-wrapped like tbb/boost -- not installed via apt here at all. -# Found the hard way on live CI: tomlplusplus isn't apt-installable on -# either Ubuntu version at all; fmt *is* installable, but too old -# (libfmt-dev is 8.1.1/22.04, 9.1.0/24.04, both below slang's `fmt>=12.2` -# requirement), and pkg-config-wrapping that stale apt fmt caused a real -# `fmt::v12::...` undefined-reference link failure (libsvlang.a links -# against the real fmt 12.2.0 slang's own build fetches over the network -# when its `find_package()` rejects the old apt one -- `requires-network` -# on slang's cmake() rule permits that fetch). Vendoring both removes -# this whole category of platform-dependent version mismatch. -# -# Single default toolchain for now (no gcc/clang matrix) -- kept simple -# until there's a concrete reason to add it back. +# CMake is naja's primary build system -- this workflow keeps the Bazel +# side (MODULE.bazel, BUILD.bazel throughout the tree) validated. The +# Bazel build needs no host packages: every library and code generator +# comes from a Bazel module (BCR, or bazel/registry/ for the few that are +# not on BCR yet). on: push: @@ -40,28 +22,10 @@ jobs: steps: - uses: actions/checkout@v7 - # No `submodules: true` -- Bazel fetches naja-if/naja-verilog/slang - # itself (MODULE.bazel), doesn't use the thirdparty/ checkouts. - # dependency-sync-check.yml is what keeps these two build systems' + # No `submodules: true` -- Bazel doesn't use the thirdparty/ + # checkouts. dependency-sync-check.yml keeps the two build systems' # pins from silently drifting apart. - - name: Install dependencies - # libboost-dev: not needed for naja's own code (Boost is vendored - # via a pinned http_archive tarball, task #11) -- needed because - # slang is wrapped via rules_foreign_cc's cmake() rule, and slang's - # own nested CMake build does a real find_package(Boost) against - # the system install. libtbb-dev: no BCR module exists for oneTBB; - # bazel/thirdparty/tbb/repo.bzl locates it via pkg-config, so the - # real library has to already be on the host. See - # internal/bazel-migration-plan.md's CI apt dependency audit for - # the full per-package reasoning (also covers capnproto/ - # libcapnp-dev, dropped, and libfl-dev, kept). - run: | - sudo apt-get update - sudo apt-get install -yq \ - libboost-dev libfl-dev libtbb-dev \ - bison flex m4 pkg-config python3-dev git - - uses: bazel-contrib/setup-bazel@0.19.0 with: bazelisk-cache: true diff --git a/.reuse/dep5 b/.reuse/dep5 index e6b244d17..e920481f7 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -95,3 +95,7 @@ Files: tutorials/README.md tutorials/images/* tutorials/notebooks/06_fanout_analysis.ipynb Copyright: 2024 The Naja Authors License: Apache-2.0 + +Files: bazel/registry/* +Copyright: 2026 The Naja Authors. +License: Apache-2.0 diff --git a/CLAUDE.md b/CLAUDE.md index 136fce38d..a809cf8da 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -85,31 +85,32 @@ Docker images), and most workflows use, and it's the one to reach for by default. Bazel (`MODULE.bazel`, `BUILD.bazel` throughout the tree) is kept in parallel as a validated smoke test only, via `ubuntu-bazel.yml`/ `macos-bazel.yml` (`bazel build //... && bazel test //...`, no -submodules — bzlmod fetches its own copies of shared dependencies). It +submodules, no host packages — every dependency is a `bazel_dep`). It is **not** CI's primary gate and doesn't need to track every workflow's behavior (sanitizer suppressions, coverage flags, etc.) — just prove the Bazel side keeps compiling and passing tests. **Keep submodule pins and Bazel pins in sync.** CMake pins shared upstream dependencies via git submodules (`.gitmodules`, `thirdparty/*`); -Bazel pins its own copies of the *same* dependencies via -`git_override()`/`git_repository()` commits in `MODULE.bazel`. Nothing -forces these to move together — bumping one without the other silently -makes the two build systems test different upstream code. When you bump -a submodule commit (or vice versa), update the matching `MODULE.bazel` -pin in the same change: - -- `cpptrace`, `slang`: must be an **exact** commit match. -- `naja-if`, `naja-verilog`: these are the project's own forks, and - Bazel tracks a separate `bazel-support` branch (native Bazel BUILD - files added on top) rather than the branch CMake tracks — so an exact - match isn't meaningful. Instead, the submodule's pinned commit must be - an **ancestor of (or equal to)** the `bazel-support` pin, i.e. - `bazel-support` must never fall behind main. +Bazel takes the *same* dependencies as `bazel_dep`s, and those not on +BCR are pinned to commits by the in-tree registry +(`bazel/registry/modules///source.json`, see +`bazel/registry/README.md`). Nothing forces these to move together — +bumping one without the other silently makes the two build systems test +different upstream code. When you bump a submodule commit (or vice +versa), add the matching registry version and point `MODULE.bazel` at it +in the same change: + +- `slang` (Bazel module `sv-lang`), `naja-verilog`: must be an + **exact** commit match. +- `naja-if`: Bazel tracks a separate `bazel-support` branch (native + Bazel BUILD files added on top) rather than the branch CMake tracks — + so an exact match isn't meaningful. Instead, the submodule's pinned + commit must be an **ancestor of (or equal to)** the `bazel-support` + pin, i.e. `bazel-support` must never fall behind main. - `googletest`: deliberately excluded — CMake pins an old submodule dev - commit, Bazel takes a BCR release (`1.17.0.bcr.2`). Different - dependency-sourcing mechanisms entirely; not meant to track in - lockstep. + commit, Bazel takes a BCR release. Different dependency-sourcing + mechanisms entirely; not meant to track in lockstep. This is enforced automatically: `ci/check_submodule_bazel_sync.py` (run by `.github/workflows/dependency-sync-check.yml` on every push/PR) diff --git a/MODULE.bazel b/MODULE.bazel index 497b79e04..d650c3cb8 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,248 +4,37 @@ """Bazel module for naja. -CMake is naja's primary build system (see CLAUDE.md's "Build systems" -section) -- this file, and the BUILD.bazel tree throughout the repo, -are kept as a validated smoke test (ubuntu-bazel.yml/macos-bazel.yml: -`bazel build //... && bazel test //...`), not CI's primary gate. See -internal/bazel-migration-plan.md for the full history of how this was -built out and the 2026-07-28 pivot away from full Bazel migration. - -ci/check_submodule_bazel_sync.py (run by -.github/workflows/dependency-sync-check.yml) keeps this file's -git_override()/git_repository() commit pins in sync with CMake's git -submodule pins (.gitmodules/thirdparty/) for the dependencies both -build systems share. +Every dependency is a plain bazel_dep. Modules that are not yet on the +Bazel Central Registry (naja-if, naja-verilog) are served by the +registry in bazel/registry/, which .bazelrc lists ahead of BCR, as is +sv-lang at the slang commit naja is developed against. See +bazel/registry/README.md. """ module( name = "naja", - version = "1.0.0", -) - -# --- Bazel Central Registry dependencies (Phase 0) --- - -bazel_dep(name = "rules_cc", version = "0.2.17") - -# Used by test/ (cc_test targets land in Phase 5, task #20). -bazel_dep(name = "googletest", version = "1.17.0.bcr.2", repo_name = "googletest") - -# naja-verilog's googletest 1.18.0 dependency uses abseil-cpp -# 20260526.0 at compatibility level 0, while protobuf 29.0 uses -# 20250814.1 at compatibility level 1. Overrides declared by dependency -# modules do not apply to the root module, so permit both versions here. -multiple_version_override( - module_name = "abseil-cpp", - versions = [ - "20250814.1", - "20260526.0", - ], -) - -# Used by bench/ (task #28) -- mirrors CMake's `find_package(benchmark -# REQUIRED)` (bench/CMakeLists.txt), gated there behind -DBUILD_BENCHMARKS=ON; -# no equivalent optional-fetch mechanism in bzlmod, so this is just an -# ordinary bazel_dep (same non-dev-dependency style as googletest above). -bazel_dep(name = "google_benchmark", version = "1.9.5") - -# select()-ed on directly (task #18, dnl/bne/opt/metrics' -Wno-sign-conversion -# on macOS, matching CMakeLists.txt's `if(APPLE)` guards) -- otherwise only -# pulled in transitively, not visible to our own module under strict deps. -bazel_dep(name = "platforms", version = "1.0.0") - -# Transitive dependency of capnp-cpp; also used directly by naja's own -# codegen/serialization glue. -bazel_dep(name = "zlib", version = "1.3.2") - -# Replaces the CMake-side `capnp_generate_cpp()` toolchain -# (src/nl/netlist/serialization/capnp/CMakeLists.txt). Schema BUILD rules -# for the 3 naja-if .capnp files are written in Phase 2 (task #9). -bazel_dep(name = "capnp-cpp", version = "1.4.0") - -# --- cpptrace (task #4): BCR module exists, pinned to the exact current -# submodule commit (3db8da8) rather than the newer 1.0.4 BCR release, so -# behavior doesn't shift as a side effect of the build-system switch. --- -bazel_dep(name = "cpptrace", version = "1.0.4.bcr.1") -git_override( - module_name = "cpptrace", - remote = "https://github.com/jeremy-rifkin/cpptrace", - commit = "3db8da80111171c219ab5839905771386bee06b3", -) - -# --- naja-if, naja-verilog (tasks #5, #6): both are najaeda-org forks -# (siblings of this repo, not truly third-party), each carrying its own -# native MODULE.bazel/BUILD.bazel -- making them real Bazel modules -# consumable via bazel_dep + git_override, the same pattern as cpptrace -# above. See internal/bazel-migration-plan.md. -bazel_dep(name = "naja-if", version = "0.0.0") -git_override( - module_name = "naja-if", - remote = "https://github.com/najaeda/naja-if", - commit = "099677d9f52c0db11b12c08d03e32543eebc7888", # bazel-support -) - -# naja-verilog's `bazel-support` branch (native MODULE.bazel/BUILD.bazel) -# was merged into `main` (2026), so this now just tracks `main`'s tip -# directly, same commit CMake's own submodule pin -# (thirdparty/naja-verilog) tracks -- ci/check_submodule_bazel_sync.py -# checks these for an exact match now, not just ancestry. -bazel_dep(name = "naja-verilog", version = "0.0.0") -git_override( - module_name = "naja-verilog", - remote = "https://github.com/najaeda/naja-verilog", - commit = "be6544b128e229ce2aee814e795c1e49b02caf5c", # main -) - -# --- slang (task #7): its build is Python-codegen-driven and uses -# FetchContent for fmt/mimalloc/Catch2/Boost.regex/tomlplusplus, so keep it as -# a non-module git_repository and shell out to its own CMake build via -# rules_foreign_cc (bazel/thirdparty/slang_overlay.BUILD). --- - -bazel_dep(name = "rules_foreign_cc", version = "0.15.1") - -host_prefixes = use_repo_rule( - "//bazel/thirdparty:slang_host_prefixes.bzl", - "host_prefixes", -) - -host_prefixes(name = "slang_host_prefixes") - -git_repository = use_repo_rule( - "@bazel_tools//tools/build_defs/repo:git.bzl", - "git_repository", -) - -git_repository( - name = "slang", - remote = "https://github.com/MikePopoloski/slang", - commit = "b60d729d66b9cdeec158b800f898461a138d505e", - build_file = "//bazel/thirdparty:slang_overlay.BUILD", -) - -# fmt: svlang's static library doesn't bundle it (found as a system lib via -# CMAKE_PREFIX_PATH, see host_prefixes.bzl above), so @slang//:slang needs -# to link it directly too. Vendored (pinned to the exact 12.2.0 tag -# commit, matching slang's own `FIND_PACKAGE_ARGS 12.2` requirement) -# rather than pkg-config-wrapped like tbb/boost: live Ubuntu CI showed a -# real ABI mismatch when this was pkg-config-wrapped against apt's -# libfmt-dev (v8/v9, far below 12.2) -- slang's own internal build -# rejects that same old version and fetches a real fmt 12.2.0 over the -# network instead, so libsvlang.a ends up needing `fmt::v12::...` -# symbols an older wrapped fmt can never provide (undefined reference -# errors, confirmed on live CI). Same fix as tomlplusplus below: pin our -# own copy to the exact version slang requires, everywhere, rather than -# depend on whatever a platform's package manager happens to ship. -git_repository( - name = "fmt", - remote = "https://github.com/fmtlib/fmt", - commit = "1be298e1bd68957e4cd352e1f676f00e07dcfb57", # 12.2.0 - build_file = "//bazel/thirdparty:fmt_overlay.BUILD", -) - -# tomlplusplus: same situation as fmt (svlang doesn't bundle it in -# either), vendored the same way (pinned to the v3.4.0 tag's commit, -# matching slang's own `FIND_PACKAGE_ARGS 3.4` minimum) -- Ubuntu's apt -# doesn't have libtomlplusplus-dev at all (confirmed on live CI). See -# bazel/thirdparty/tomlplusplus_overlay.BUILD. -git_repository( - name = "tomlplusplus", - remote = "https://github.com/marzer/tomlplusplus", - commit = "30172438cee64926dc41fdd9c11fb3ba5b2ba9de", # v3.4.0 - build_file = "//bazel/thirdparty:tomlplusplus_overlay.BUILD", -) - -# --- TBB (task #10): no BCR module. Wrap the already system-installed -# oneTBB (same one CMake's find_package(TBB REQUIRED) resolves against) -# via pkg-config rather than building it from source under Bazel. --- - -tbb_repository = use_repo_rule( - "//bazel/thirdparty/tbb:repo.bzl", - "tbb_repository", -) - -tbb_repository(name = "tbb") - -# --- Boost (task #11): no BCR module. naja only consumes it as headers -# (no compiled Boost:: component is linked anywhere in src/), so vendor -# the official release tarball the same way fmt/tomlplusplus are vendored -# above, rather than wrapping whatever Boost a given host happens to have -# installed. The earlier pkg-config/find_path-style -# bazel/thirdparty/boost/repo.bzl meant both the exact version and the -# search-order-picked install location varied by machine, and its -# repo_ctx.symlink of the whole discovered include prefix was found to -# leak unrelated system headers into the include path (a stale -# libgtest-dev gtest.h shadowed Bazel's own fetched @googletest on one -# dev machine). Pinning a tarball fetch removes both: identical Boost -# bits everywhere, and only boost/** on the include path. --- - -http_archive = use_repo_rule( - "@bazel_tools//tools/build_defs/repo:http.bzl", - "http_archive", -) - -http_archive( - name = "boost", - url = "https://archives.boost.io/release/1.89.0/source/boost_1_89_0.tar.gz", - sha256 = "9de758db755e8330a01d995b0a24d09798048400ac25c03fc5ea9be364b13c93", - strip_prefix = "boost_1_89_0", - build_file = "//bazel/thirdparty:boost_overlay.BUILD", -) - -# --- Python (tasks #21/#22): no BCR module usable here (rules_python's -# hermetic toolchain would introduce a second, different Python from the -# one naja's own CMake build already uses) -- wrap the system Python 3 -# via python3-config instead, same pragmatic pattern as everything above. -# See bazel/thirdparty/python/repo.bzl. --- - -python_repository = use_repo_rule( - "//bazel/thirdparty/python:repo.bzl", - "python_repository", -) - -python_repository(name = "python") - -# --- lefdef (task #13): vendored directly in thirdparty/lefdef/ (not a -# submodule, no separate repo to push a bazel-support branch to). Only -# `bison` is needed (this SDK's lef.y/def.y embed their own hand-written -# lexers -- no flex/.l files at all), located via system_tool.bzl the same -# way CMake's find_package(BISON REQUIRED) -# (thirdparty/lefdef/CMakeLists.txt) does. See -# bazel/lefdef_bison.bzl and internal/bazel-migration-plan.md. --- - -system_tool_repository = use_repo_rule( - "//bazel:system_tool.bzl", - "system_tool_repository", -) - -system_tool_repository(name = "bison_tool", tool = "bison") -system_tool_repository(name = "m4_tool", tool = "m4") - -# --- najaeda Python test infra (task #28): the interpreter itself (not -# just Python.h/libpython above) is needed to actually run -# `python3 -m unittest discover` inside sh_test sandboxes. Reuses -# system_tool.bzl's PATH-search pattern already declared above for -# bison/m4 rather than a second repo rule. --- - -system_tool_repository(name = "python3_tool", tool = "python3") - -# --- naja_core version stamping (task #15/#18): generates -# src/core/NajaVersion.h's @NAJA_GIT_HASH@ substitution. See -# bazel/git_version.bzl for the staleness caveat versus CMake's -# configure_file (rerun on every configure). --- - -git_version = use_repo_rule( - "//bazel:git_version.bzl", - "git_version", -) - -git_version(name = "naja_git_version") - -# Phase 5, task #20: absolute workspace root, needed only by -# test/nl/formats/systemverilog/frontend's SNLSVConstructorTestSimple.cpp -# CWD-changing test. See bazel/workspace_root.bzl. -workspace_root = use_repo_rule( - "//bazel:workspace_root.bzl", - "workspace_root", -) - -workspace_root(name = "naja_workspace_root") + version = "0.7.26", + bazel_compatibility = [">=8.0.0"], +) + +bazel_dep(name = "bazel_skylib", version = "1.9.2") +bazel_dep(name = "bison", version = "3.8.2.bcr.9") +bazel_dep(name = "boost.asio", version = "1.90.0.bcr.1") +bazel_dep(name = "boost.dynamic_bitset", version = "1.90.0.bcr.1") +bazel_dep(name = "boost.intrusive", version = "1.90.0.bcr.1") +bazel_dep(name = "boost.multiprecision", version = "1.90.0.bcr.1") +bazel_dep(name = "capnp-cpp", version = "1.5.0") +bazel_dep(name = "fmt", version = "12.2.0") +bazel_dep(name = "naja-if", version = "0.0.0-20260723-099677d9") +bazel_dep(name = "naja-verilog", version = "0.0.0-20260909-be6544b1") +bazel_dep(name = "onetbb", version = "2023.1.0") +bazel_dep(name = "platforms", version = "1.1.0") +bazel_dep(name = "rules_cc", version = "0.2.25") +bazel_dep(name = "rules_python", version = "1.9.0") +bazel_dep(name = "rules_shell", version = "0.8.0") +bazel_dep(name = "spdlog", version = "1.17.0") +bazel_dep(name = "sv-lang", version = "11.0.0-20260701-b60d729d") +bazel_dep(name = "zlib", version = "1.3.2.bcr.1") + +bazel_dep(name = "google_benchmark", version = "1.9.5", dev_dependency = True) +bazel_dep(name = "googletest", version = "1.18.0.bcr.1", dev_dependency = True) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 707282f19..202e10f7d 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,5 +1,5 @@ { - "lockFileVersion": 18, + "lockFileVersion": 24, "registryFileHashes": { "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", @@ -13,14 +13,23 @@ "https://bcr.bazel.build/modules/abseil-cpp/20250127.1/MODULE.bazel": "c4a89e7ceb9bf1e25cf84a9f830ff6b817b72874088bf5141b314726e46a57c1", "https://bcr.bazel.build/modules/abseil-cpp/20250512.1/MODULE.bazel": "d209fdb6f36ffaf61c509fcc81b19e81b411a999a934a032e10cd009a0226215", "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/MODULE.bazel": "51f2312901470cdab0dbdf3b88c40cd21c62a7ed58a3de45b365ddc5b11bcab2", - "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/source.json": "cea3901d7e299da7320700abbaafe57a65d039f10d0d7ea601c4a66938ea4b0c", "https://bcr.bazel.build/modules/abseil-cpp/20260526.0/MODULE.bazel": "b4a76a8d70ba08aa0253fd5e374ca5a5fa6b15aba985a7bbe4467c138954830f", "https://bcr.bazel.build/modules/abseil-cpp/20260526.0/source.json": "a39a26fec1b7037bdd7ea6c25cc098b99ae80af10ff0b6ec8c4bfe0df694f451", "https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85", "https://bcr.bazel.build/modules/apple_support/1.22.1/MODULE.bazel": "90bd1a660590f3ceffbdf524e37483094b29352d85317060b2327fff8f3f4458", "https://bcr.bazel.build/modules/apple_support/1.23.1/MODULE.bazel": "53763fed456a968cf919b3240427cf3a9d5481ec5466abc9d5dc51bc70087442", "https://bcr.bazel.build/modules/apple_support/1.24.2/MODULE.bazel": "0e62471818affb9f0b26f128831d5c40b074d32e6dda5a0d3852847215a41ca4", - "https://bcr.bazel.build/modules/apple_support/1.24.2/source.json": "2c22c9827093250406c5568da6c54e6fdf0ef06238def3d99c71b12feb057a8d", + "https://bcr.bazel.build/modules/apple_support/2.8.0/MODULE.bazel": "c45f5176057092afba0be6c48a9ea02101666802f8be536947e099e94757f8ed", + "https://bcr.bazel.build/modules/apple_support/2.8.0/source.json": "b7f6d87669c206adaa7d82cc44733349c63e341b80a0e049496ebd91d78c3472", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.14.0/MODULE.bazel": "2b31ffcc9bdc8295b2167e07a757dbbc9ac8906e7028e5170a3708cecaac119f", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.19.3/MODULE.bazel": "253d739ba126f62a5767d832765b12b59e9f8d2bc88cc1572f4a73e46eb298ca", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.21.2/MODULE.bazel": "276347663a25b0d5bd6cad869252bea3e160c4d980e764b15f3bae7f80b30624", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.21.2/source.json": "f42051fa42629f0e59b7ac2adf0a55749144b11f1efcd8c697f0ee247181e526", + "https://bcr.bazel.build/modules/aspect_bazel_lib/2.8.1/MODULE.bazel": "812d2dd42f65dca362152101fbec418029cc8fd34cbad1a2fde905383d705838", + "https://bcr.bazel.build/modules/aspect_rules_py/1.8.4/MODULE.bazel": "4ab4a78e9d65cf15e755807f7ae504655e1771cefd7c3343ad34dbbb625b9564", + "https://bcr.bazel.build/modules/aspect_rules_py/1.8.4/source.json": "7cd80ad811f0c2b3aad3c878506ae602fce2fe53b78487ecfbcc8bcde07d220e", + "https://bcr.bazel.build/modules/aspect_tools_telemetry/0.3.3/MODULE.bazel": "37c764292861c2f70314efa9846bb6dbb44fc0308903b3285da6528305450183", + "https://bcr.bazel.build/modules/aspect_tools_telemetry/0.3.3/source.json": "605086bbc197743a0d360f7ddc550a1d4dfa0441bc807236e17170f636153348", "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", @@ -28,15 +37,23 @@ "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.24.0/MODULE.bazel": "4796b4c25b47053e9bbffa792b3792d07e228ff66cd0405faef56a978708acd4", "https://bcr.bazel.build/modules/bazel_features/1.27.0/MODULE.bazel": "621eeee06c4458a9121d1f104efb80f39d34deff4984e778359c60eaf1a8cb65", "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d", "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", + "https://bcr.bazel.build/modules/bazel_features/1.34.0/MODULE.bazel": "e8475ad7c8965542e0c7aac8af68eb48c4af904be3d614b6aa6274c092c2ea1e", "https://bcr.bazel.build/modules/bazel_features/1.36.0/MODULE.bazel": "596cb62090b039caf1cad1d52a8bc35cf188ca9a4e279a828005e7ee49a1bec3", + "https://bcr.bazel.build/modules/bazel_features/1.38.0/MODULE.bazel": "f9b8a9c890ebd216b4049fd12a31d3c2602e3403c7af636b04fbbd7453edc9c9", "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", "https://bcr.bazel.build/modules/bazel_features/1.43.0/MODULE.bazel": "defa2226f06ba20550d6548c3a2ea2a7929634437a52973869c20c225450eb91", + "https://bcr.bazel.build/modules/bazel_features/1.47.1/MODULE.bazel": "e6be691539341681678a68c2076771f6a73fcdc9823c5b6bf280d2e916d1ad80", "https://bcr.bazel.build/modules/bazel_features/1.50.0/MODULE.bazel": "2083ef9c7a469f520890483ccf8e0189d6e71e2117e7752e15e6554433d5ae3e", "https://bcr.bazel.build/modules/bazel_features/1.50.0/source.json": "e0ee3debde2789ff56e4452e612d126925ba9ab64d4bde79c67f099d2902df9b", + "https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", + "https://bcr.bazel.build/modules/bazel_lib/3.0.0/MODULE.bazel": "22b70b80ac89ad3f3772526cd9feee2fa412c2b01933fea7ed13238a448d370d", + "https://bcr.bazel.build/modules/bazel_lib/3.1.0/MODULE.bazel": "6809765c14e3c766a9b9286c7b0ec56ed87a73326e48fe01749f0c0fdcfe3287", + "https://bcr.bazel.build/modules/bazel_lib/3.1.0/source.json": "aaf7c2dc816219f4cb356c9d65f2555fb7f9543e537199f74a921f7877d23dfb", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", @@ -52,15 +69,132 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6", "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7", - "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", + "https://bcr.bazel.build/modules/bazel_skylib/1.9.2/MODULE.bazel": "8c51259b0f4481475586dbfede7591e57b75702e637f840f6138eec80c34b270", + "https://bcr.bazel.build/modules/bazel_skylib/1.9.2/source.json": "41cbde7546542dee2f26e3f10bf1c4ac57909943194b7ac48cc5238a01893aa8", + "https://bcr.bazel.build/modules/bison/3.8.2.bcr.9/MODULE.bazel": "8b9a90d9c44ac5d7dcc351318b10b075620fc0eed1bb5e9c3030a5a86e46794b", + "https://bcr.bazel.build/modules/bison/3.8.2.bcr.9/source.json": "2a59219a64dca807563bb5d2a5fc108ca6e3351da241d9b1f1526d2ad89df878", + "https://bcr.bazel.build/modules/boost.algorithm/1.90.0.bcr.1/MODULE.bazel": "2f3447a25fe67ddefa26d39f1eae65d3035fb6faaa77d39cf7742a8f952ceedb", + "https://bcr.bazel.build/modules/boost.algorithm/1.90.0.bcr.1/source.json": "f9c995cf5dc0663827484065fb1e76ec4c7091f84476c1a98fa9a4bcf87bcb8f", + "https://bcr.bazel.build/modules/boost.align/1.90.0.bcr.1/MODULE.bazel": "dd81d6e7f9dc036ccc06753bb7670c6505bf0b7fab170e22d1b5b83044ac66e8", + "https://bcr.bazel.build/modules/boost.align/1.90.0.bcr.1/source.json": "459a2ea37158d8b3c48070a0438d4416d5191b7b3873b2f82eaee0a5bcf67023", + "https://bcr.bazel.build/modules/boost.array/1.90.0.bcr.1/MODULE.bazel": "ef99bf8b92d84c7f02e45e3d4d7bfb4a747e67f035029ab5f5c6444326635959", + "https://bcr.bazel.build/modules/boost.array/1.90.0.bcr.1/source.json": "87f00a41900300132f199fc9d02c1d60a2de7d9e2b62feebaef3042161d1c469", + "https://bcr.bazel.build/modules/boost.asio/1.90.0.bcr.1/MODULE.bazel": "a8bc4ac6e9cf53b66c0ad09b64050932d14c0df81b3299251d8ddb219d8ee012", + "https://bcr.bazel.build/modules/boost.asio/1.90.0.bcr.1/source.json": "74a4b560af858e8e3b9165840102f9f302fcb5c26f273b97c705a857bb29d481", + "https://bcr.bazel.build/modules/boost.assert/1.90.0.bcr.1/MODULE.bazel": "82fa42de969959b0eb59b03b528b6ed6fdc130429766f980f0bda20a7efd09bb", + "https://bcr.bazel.build/modules/boost.assert/1.90.0.bcr.1/source.json": "276a47c8c07761df24435e276ec6ed0ac859839ae9d62259787d222e022d23e2", + "https://bcr.bazel.build/modules/boost.bind/1.90.0.bcr.1/MODULE.bazel": "b15f1e3dbc8aa6ad67d4a6afbb906132c3127d57dd2be3f1a51d036331ceacdf", + "https://bcr.bazel.build/modules/boost.bind/1.90.0.bcr.1/source.json": "edf015c5bb872a130b893e05c927ccc862a70d5d84bd9e571d93bed080c761da", + "https://bcr.bazel.build/modules/boost.concept_check/1.90.0.bcr.1/MODULE.bazel": "cc84379d08dbb71364a2718307580228bdca15bd351d989db825af78403e0f24", + "https://bcr.bazel.build/modules/boost.concept_check/1.90.0.bcr.1/source.json": "9e9dffd3b7d4b3b1db57d381bbb65e802eb9fceeff700a132c2c1edd1d325345", + "https://bcr.bazel.build/modules/boost.config/1.90.0.bcr.1/MODULE.bazel": "c14d7f8f9d6ba5d13383df5dabe296dcfef3925b398158b71c1c4080e2a14365", + "https://bcr.bazel.build/modules/boost.config/1.90.0.bcr.1/source.json": "44b2941a2e656fd2c3747576ddd1e44e4d55c5d3ef5a22f0231f35c8dded3051", + "https://bcr.bazel.build/modules/boost.container/1.90.0.bcr.1/MODULE.bazel": "a67046f213674ff29a975fdcd58b324d7a91854f0cc6ac29b56b590314869115", + "https://bcr.bazel.build/modules/boost.container/1.90.0.bcr.1/source.json": "f4ad3664df3d5c2157897f8482e0528922043f87a242e39a3d9509165963fe56", + "https://bcr.bazel.build/modules/boost.container_hash/1.90.0.bcr.1/MODULE.bazel": "99905e56c4de3090bd802393e9a683fcf885f9ef9a7add79c05333de1c41ccf7", + "https://bcr.bazel.build/modules/boost.container_hash/1.90.0.bcr.1/source.json": "9403da9bcc0f1600e569d7921aede5505a4f8407541597b00dcfd116ffb30580", + "https://bcr.bazel.build/modules/boost.context/1.90.0.bcr.1/MODULE.bazel": "2e3df4731eef8a307197733e3c51cd44e92de6a6bde18f3e815dbff96b318a2c", + "https://bcr.bazel.build/modules/boost.context/1.90.0.bcr.1/source.json": "7c61df90cc134e5f3c3711b80d57d02e7bd753b963527b7023f8289a5c9a8f75", + "https://bcr.bazel.build/modules/boost.conversion/1.90.0.bcr.1/MODULE.bazel": "41b14134aed2dd5459a31955f577504740f89b96355b538dd8acc0b748d27060", + "https://bcr.bazel.build/modules/boost.conversion/1.90.0.bcr.1/source.json": "fc5128b2c079f6d6eb35de3d8626808c5145a9724aeaa775ae8b2f1991eec3a8", + "https://bcr.bazel.build/modules/boost.core/1.90.0.bcr.1/MODULE.bazel": "c94d17f2da1e7557046730a5647e06943e4e0fc10d6537e3656dbd23f8a0a573", + "https://bcr.bazel.build/modules/boost.core/1.90.0.bcr.1/source.json": "5b3b6b9c6ea8e38e63d3b1a92370902a9ba78a4efd6c23df3c538d719a200cbe", + "https://bcr.bazel.build/modules/boost.date_time/1.90.0.bcr.1/MODULE.bazel": "c695e8ffab06bc921e8eb9f2e4cf99d0e9c79a0e889bc49d6c3c8cadb8f9c340", + "https://bcr.bazel.build/modules/boost.date_time/1.90.0.bcr.1/source.json": "1e23a1f1a0afd29fdb19dae37b088c484dd76bf04e3ba4d8196132a6263946b3", + "https://bcr.bazel.build/modules/boost.describe/1.90.0.bcr.1/MODULE.bazel": "ee5316a4d469c5a272e90b6a1c6f8185fb842a2a6401e970da159b08b4bdcc6a", + "https://bcr.bazel.build/modules/boost.describe/1.90.0.bcr.1/source.json": "5ca72db73619c8915d030d88f7bcff970211daee4d7fa49a99ac3a510b507355", + "https://bcr.bazel.build/modules/boost.detail/1.90.0.bcr.1/MODULE.bazel": "b20ffa33d79c6258067825f222339dd857b88649b889693bb6c24f39d0e21863", + "https://bcr.bazel.build/modules/boost.detail/1.90.0.bcr.1/source.json": "57cc97827a0aa2d4c3074d6496c4dd2b969932bf1b3c3d4e712b495445aa0e2b", + "https://bcr.bazel.build/modules/boost.dynamic_bitset/1.90.0.bcr.1/MODULE.bazel": "7f60a0414731be88571567dfbb5551618fa978a1505243fdb58c25375ebbe575", + "https://bcr.bazel.build/modules/boost.dynamic_bitset/1.90.0.bcr.1/source.json": "43dd9e4fedc9fdacb2aa29630b8f507e42d73eb4635f0841cbb2f70c155958fa", + "https://bcr.bazel.build/modules/boost.exception/1.90.0.bcr.1/MODULE.bazel": "3081e2864ebd75034e80c11477ac09f926ad79dbc703f88449df8c6ab1aba47f", + "https://bcr.bazel.build/modules/boost.exception/1.90.0.bcr.1/source.json": "42f0990ff0fe3b1e68051bea5829c7be8eb45b0853eed3fb24923c4f2d293164", + "https://bcr.bazel.build/modules/boost.function/1.90.0.bcr.1/MODULE.bazel": "2ad8f4d912fffdee4b47a668b732a4ed05951890a7bac8d26e885db961f4322e", + "https://bcr.bazel.build/modules/boost.function/1.90.0.bcr.1/source.json": "d49e4336a09802baf69be2cf8d8f8fe5e58d714bb2f1803f0810578f6a63dbb3", + "https://bcr.bazel.build/modules/boost.function_types/1.90.0.bcr.1/MODULE.bazel": "cae2f1221ae24acafa2d645357d2ba0689ee161fb416c6e4ed7d2f3b057d848b", + "https://bcr.bazel.build/modules/boost.function_types/1.90.0.bcr.1/source.json": "b4403f730a6e47d38c0aaf80d1402f95a0b0660337eb584d182c33a4062efe23", + "https://bcr.bazel.build/modules/boost.functional/1.90.0.bcr.1/MODULE.bazel": "029fa1c3a5ddd4c0e23fa56c91d64f23136b767c6c477d830101bbeab3ae8eb5", + "https://bcr.bazel.build/modules/boost.functional/1.90.0.bcr.1/source.json": "276bad6e466373048a2b0ebc37009cd3275df088538cf24254aeb3cb225dedb9", + "https://bcr.bazel.build/modules/boost.fusion/1.90.0.bcr.1/MODULE.bazel": "3a3d5ed0a340d34a4cf04e3d48d7cc7df15b467e25a905a4ac1e43432486b48e", + "https://bcr.bazel.build/modules/boost.fusion/1.90.0.bcr.1/source.json": "1781c3b5bfdd18a2ff8ef300de745fe537ff204633ec3fda3b2f8e74dea5f7d1", + "https://bcr.bazel.build/modules/boost.integer/1.90.0.bcr.1/MODULE.bazel": "68d85ed004416863647e6730ba9cfff69ede4ad049f37a92c18e3d209096d99d", + "https://bcr.bazel.build/modules/boost.integer/1.90.0.bcr.1/source.json": "6c2324678fb5b3a4d392facbb47c6f53c6851fd87b2291822f964e2fe216ffbd", + "https://bcr.bazel.build/modules/boost.intrusive/1.90.0.bcr.1/MODULE.bazel": "b1e99deb8a3245538de955d836fe1d24686c60f0cfe438dc111ecd146a02205c", + "https://bcr.bazel.build/modules/boost.intrusive/1.90.0.bcr.1/source.json": "5721f82ef9788874404eb63631865997b1cbcba34f3d9baa48e92e6dc8cfcc95", + "https://bcr.bazel.build/modules/boost.io/1.90.0.bcr.1/MODULE.bazel": "79ef547ebf5b492e9a1c7e60a88f37c90f833156ec22d2bbfa4707eead3d3936", + "https://bcr.bazel.build/modules/boost.io/1.90.0.bcr.1/source.json": "16f18477ae750f5c98c681dcf33c823b6e4ba98ae58f8a88d0d7770433cd4a0c", + "https://bcr.bazel.build/modules/boost.iterator/1.90.0.bcr.1/MODULE.bazel": "87c7ed8d4e13fad6002f7bc7ecc1b3c1956eb16196dcfde09cdca0187d847063", + "https://bcr.bazel.build/modules/boost.iterator/1.90.0.bcr.1/source.json": "6a7af83abf5de4d437fbcb90a700459392f3fd0eff700ab2a608abd363401884", + "https://bcr.bazel.build/modules/boost.lexical_cast/1.90.0.bcr.1/MODULE.bazel": "dce40cd91da852e099182abc8d2bbd33800002a16576d03a99462f5d71554b98", + "https://bcr.bazel.build/modules/boost.lexical_cast/1.90.0.bcr.1/source.json": "5118bc53f21fd23de329af4acfeb0bc991aa6661273f7b7b7889190abadd355d", + "https://bcr.bazel.build/modules/boost.math/1.90.0.bcr.1/MODULE.bazel": "2e794674fcb3cc8ffe8fda648afde8303e1e1d297f1b86c8a3e33844a1500165", + "https://bcr.bazel.build/modules/boost.math/1.90.0.bcr.1/source.json": "453bc2f40630acee4f90051832663fb0a988b8d711a1e7f3617bb25e7e881c44", + "https://bcr.bazel.build/modules/boost.move/1.90.0.bcr.1/MODULE.bazel": "587b5ab010a5c869e65df561c65f40382cf1035252f03a532fa3b617d3c0fa4a", + "https://bcr.bazel.build/modules/boost.move/1.90.0.bcr.1/source.json": "71964cabe3dfca8d09a4de3dd69dd5e92c6249925b475bcf0ed14ad6213afcdc", + "https://bcr.bazel.build/modules/boost.mp11/1.90.0.bcr.1/MODULE.bazel": "9180b001b76e786d764f40b9cf9f3cffc92fd58b36fe7680b1f481e8e9991d2a", + "https://bcr.bazel.build/modules/boost.mp11/1.90.0.bcr.1/source.json": "5720af0062e685970e3adcc72e925445171ba2ff192cde0b68c53031d25fa7f4", + "https://bcr.bazel.build/modules/boost.mpl/1.90.0.bcr.1/MODULE.bazel": "4b09392fdc6ead264ab2d24d1ec8ea8f2046656119c9d7cc1512839b5c01c877", + "https://bcr.bazel.build/modules/boost.mpl/1.90.0.bcr.1/source.json": "4d4aad33ab4100aa6598bf6477dbb4c7b3ff81887723240f3a85230e4416b298", + "https://bcr.bazel.build/modules/boost.multiprecision/1.90.0.bcr.1/MODULE.bazel": "961359e6896f54b887fea8af9b03cc6913b38b240b14ea4f75be2c5ac61a32d9", + "https://bcr.bazel.build/modules/boost.multiprecision/1.90.0.bcr.1/source.json": "88e9275e5fb53568f11d405619482970157cfc1dcf79f77f2da5b4c4fd8fc700", + "https://bcr.bazel.build/modules/boost.numeric_conversion/1.90.0.bcr.1/MODULE.bazel": "4f3beec77ed7fc446791196671db244ec9af31a1ba4d86fa91a9cffe5fe03f6d", + "https://bcr.bazel.build/modules/boost.numeric_conversion/1.90.0.bcr.1/source.json": "cf79a810793fe85dc1f44a9f0937c542e37f4aa4c750d66963100fc1d619e3f8", + "https://bcr.bazel.build/modules/boost.optional/1.90.0.bcr.1/MODULE.bazel": "39359f2a95bfed16b341fffb3f37c873954cf3969ec1dc671f92bfc63485043e", + "https://bcr.bazel.build/modules/boost.optional/1.90.0.bcr.1/source.json": "b5035d89c5cc9ba3a53a60cded20b54492cb997ef1d279ef603f3e98cf9adfe5", + "https://bcr.bazel.build/modules/boost.pool/1.90.0.bcr.1/MODULE.bazel": "18bcb58eece18fe643cb6bc7aad4e9849ee322564d3d09bff5dd065cefafc49c", + "https://bcr.bazel.build/modules/boost.pool/1.90.0.bcr.1/source.json": "60c9498ef0f023d35e3a26f4d3945d0b7c5b3c4e4f69e767063387af1c8a955d", + "https://bcr.bazel.build/modules/boost.predef/1.90.0.bcr.1/MODULE.bazel": "0c92fea5e1d63e301f7bb81763a5bfbb5f27204d6b6127e09ae23ae7d1bb3eaa", + "https://bcr.bazel.build/modules/boost.predef/1.90.0.bcr.1/source.json": "f32e27769816c6de69925c5995733adf8e176e5a281d23c079c64aafae532e2f", + "https://bcr.bazel.build/modules/boost.preprocessor/1.90.0.bcr.1/MODULE.bazel": "084f90b6beafd64ef47f5cebeb5e7a6ed166afe27bd9c25d8e275135fe11b974", + "https://bcr.bazel.build/modules/boost.preprocessor/1.90.0.bcr.1/source.json": "84f34b52de470d6706b667852f08c58243377301145c8cfd0fe7e7db7b63080e", + "https://bcr.bazel.build/modules/boost.random/1.90.0.bcr.1/MODULE.bazel": "c599af3e38c0020ba1306cbdc5defbb1bb355df2ea38eb0b2791296e3560e303", + "https://bcr.bazel.build/modules/boost.random/1.90.0.bcr.1/source.json": "4c88ab2004261124a9dd15d75a38e223a10d593ff96c18253613d848ac4b8544", + "https://bcr.bazel.build/modules/boost.range/1.90.0.bcr.1/MODULE.bazel": "42adac11c9ce8d97f32e29b925cdaae8a683f04cdc21b67c7474ca478733ecae", + "https://bcr.bazel.build/modules/boost.range/1.90.0.bcr.1/source.json": "930068c26eed8bd4abde2128bb31e593dd99b42874bc7888fe4b14d0a10123b8", + "https://bcr.bazel.build/modules/boost.regex/1.90.0.bcr.1/MODULE.bazel": "6c6a96ad0ac7cee1b1818e598e61e64bce720b96195b4ad3faaab9efbcf72ac9", + "https://bcr.bazel.build/modules/boost.regex/1.90.0.bcr.1/source.json": "81b7c2977c77a8e075d76e5daf2a0397e9d142b72a2c861646c4a79786917e91", + "https://bcr.bazel.build/modules/boost.smart_ptr/1.90.0.bcr.1/MODULE.bazel": "5d5fcb4493bfc2e8211670598ea03a7377e85f87ed11c51500a59582b17054dd", + "https://bcr.bazel.build/modules/boost.smart_ptr/1.90.0.bcr.1/source.json": "06b72903ac9bedb4d5d8fd576573ea522d88813b3d07e13b60a98ad4302eb92a", + "https://bcr.bazel.build/modules/boost.static_assert/1.90.0.bcr.1/MODULE.bazel": "f2294a6eb7822de1aaef416d6193845fce7559b23a45c271682f540f6311752f", + "https://bcr.bazel.build/modules/boost.static_assert/1.90.0.bcr.1/source.json": "3135fc2892c834b3abf53d68ca9997ffb91e6dbd80b769dbce8223bab8dce594", + "https://bcr.bazel.build/modules/boost.system/1.90.0.bcr.1/MODULE.bazel": "5b91c82353d17b7f1d5ef7c10e0698ac0dda274f73b0b08b41ffe4b9bedc676e", + "https://bcr.bazel.build/modules/boost.system/1.90.0.bcr.1/source.json": "d07d45b027141d8cd9a925e8bff70582f50758f336854884a7aac53c1f72e6b1", + "https://bcr.bazel.build/modules/boost.throw_exception/1.90.0.bcr.1/MODULE.bazel": "57242f92eecc485f09b07a8a1c8e2c7a6bf211808abb4599eec6fdbe875bb33f", + "https://bcr.bazel.build/modules/boost.throw_exception/1.90.0.bcr.1/source.json": "1889e091be52f80ebb436305663c64bc631527445edb153e622f6e22010e6c9e", + "https://bcr.bazel.build/modules/boost.tokenizer/1.90.0.bcr.1/MODULE.bazel": "6a468d35e8ce888843acbb7e57427fc8ac033660351dd511c8dab64eaa7e2b1e", + "https://bcr.bazel.build/modules/boost.tokenizer/1.90.0.bcr.1/source.json": "0c3cdb3175d38cc2eb2dba5bd47ca86a3410fa074c5acc7628818cac6e52de68", + "https://bcr.bazel.build/modules/boost.tuple/1.90.0.bcr.1/MODULE.bazel": "bb5152e9c9ba06ad986958be2dfe7a2a02863e35ea1a1008a16060945822711d", + "https://bcr.bazel.build/modules/boost.tuple/1.90.0.bcr.1/source.json": "a34a147c687ff0bbb7725ff71708361065b6de825458fa8e6e3909cc36c2a691", + "https://bcr.bazel.build/modules/boost.type_traits/1.90.0.bcr.1/MODULE.bazel": "2c83d0ae3aa30a8570082e24e10723e334d4712f1a1c478df17f43473f505ae1", + "https://bcr.bazel.build/modules/boost.type_traits/1.90.0.bcr.1/source.json": "7beb195f52a0b099eb48002f325f7b3f4fa15a75925e07b7e6e61c660fb6eacd", + "https://bcr.bazel.build/modules/boost.typeof/1.90.0.bcr.1/MODULE.bazel": "1931fb843ba5a0b41fa760e9fdb15bca55c67f893b4eebd8c6a4b72512a3575e", + "https://bcr.bazel.build/modules/boost.typeof/1.90.0.bcr.1/source.json": "d41ebca911eb57b9c903cec47b26f732d85d5990501f601f5c37356c0085a6bb", + "https://bcr.bazel.build/modules/boost.unordered/1.90.0.bcr.1/MODULE.bazel": "4f7e455c70e9b3c57b840307aa77224011c10045082b45c0e46a1f96fce141ef", + "https://bcr.bazel.build/modules/boost.unordered/1.90.0.bcr.1/source.json": "61fb5bd89e2f70131f4afb459e61f14faa5f0b6d5cbbfc0a5cc1e0bee6e6fece", + "https://bcr.bazel.build/modules/boost.utility/1.90.0.bcr.1/MODULE.bazel": "a8715bc66b4e8fcdd4ba30c20b05b2f8f34ea83998c9bf80ffaf7a7ff011ed8c", + "https://bcr.bazel.build/modules/boost.utility/1.90.0.bcr.1/source.json": "288dd9f2818547937b24b26eea3caaa116a11d613e5480545a02f9c8e1c357f3", + "https://bcr.bazel.build/modules/boost.variant2/1.90.0.bcr.1/MODULE.bazel": "d764ab496cc95eab7d1598513a76a82964eab94d0ca830be64bec69c1d604979", + "https://bcr.bazel.build/modules/boost.variant2/1.90.0.bcr.1/source.json": "cb0f0b2c4c6f5a78a41a08f8639e92ba37262c24d9104e4b79d204c4feba8429", + "https://bcr.bazel.build/modules/boost.winapi/1.90.0.bcr.1/MODULE.bazel": "3a0a93b4162d370fa18ffe233848753872c0ea7d0d1218f7b52b0b5cd5788e3b", + "https://bcr.bazel.build/modules/boost.winapi/1.90.0.bcr.1/source.json": "f447c24284aa173a8c7b82de36fd3752ae51750acad0c9ff8b7f026ab197ff7f", + "https://bcr.bazel.build/modules/boost/1.90.0.bcr.1/MODULE.bazel": "2f0a26d9a55a46017cf1f8a7895e49250f11306486419b002355f85ab595390f", + "https://bcr.bazel.build/modules/boost/1.90.0.bcr.1/source.json": "3ba95d0dcf35d52e907cc82d460a27024270cd684641912e550bfb4102da1a9e", "https://bcr.bazel.build/modules/boringssl/0.20241024.0/MODULE.bazel": "b540cff73d948cb79cb0bc108d7cef391d2098a25adabfda5043e4ef548dbc87", - "https://bcr.bazel.build/modules/boringssl/0.20241024.0/source.json": "d843092e682b84188c043ac742965d7f96e04c846c7e338187e03238674909a9", + "https://bcr.bazel.build/modules/boringssl/0.20251002.0/MODULE.bazel": "d27433ae3dbb180193dffcd80aaa612bd0d63136f09629dd809a4c71ba114cdd", + "https://bcr.bazel.build/modules/boringssl/0.20251002.0/source.json": "3e49d652fc2b2ff8c047451bd44c9723b10dc53e282ced68a6058084362e6a7c", "https://bcr.bazel.build/modules/brotli/1.2.0.bcr.1/MODULE.bazel": "945ec1b6fbb979b493424a5938b38590db3149d4290d45de579a9b37212e2b92", "https://bcr.bazel.build/modules/brotli/1.2.0.bcr.1/source.json": "7d93f86e45a24ad8440e47c23eabafaa5fbe1ff821a5147438282c3f989c91b7", "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", - "https://bcr.bazel.build/modules/capnp-cpp/1.4.0/MODULE.bazel": "4922584e161389d74fb60a0627c9211dfea00fb329f584a8060fb38eb8134262", - "https://bcr.bazel.build/modules/capnp-cpp/1.4.0/source.json": "a5e652f3a339bcb24b04b76bd413e090cb3c622b56f3a1ea8aa7f307196861b9", + "https://bcr.bazel.build/modules/capnp-cpp/1.5.0/MODULE.bazel": "5600ec6d4fe27bce387d53771bc03e919e8662bfbd9358ae5f1881c3646a9580", + "https://bcr.bazel.build/modules/capnp-cpp/1.5.0/source.json": "7f2f556143370e4501c6984bfe1dfd9e202b4507fa482a298ae61c3de5b06465", + "https://bcr.bazel.build/modules/flex/2.6.4.bcr.7/MODULE.bazel": "05ab3a7dd82dd19b57680f2278442704734ed97162756c0366f84601d680d221", + "https://bcr.bazel.build/modules/flex/2.6.4.bcr.7/source.json": "b739a301f11b8a87f04a03d4b49b22e4d0c4f82dc04640f740777b05e1391b05", + "https://bcr.bazel.build/modules/fmt/12.1.0/MODULE.bazel": "c6b460c936f408b371bf12ccee5ecbd5aed8f6abfb6e8b63fad0c622715fd458", + "https://bcr.bazel.build/modules/fmt/12.2.0/MODULE.bazel": "4dfeae41549da5454feb6ba20ef6313a4121eff976e1696ef622fe296c1652c6", + "https://bcr.bazel.build/modules/fmt/12.2.0/source.json": "783ecf1e5b0d6f5faa61123e92f8f2875fb9cf4df73457885808ce72873cc43c", + "https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/MODULE.bazel": "cdf8cbe5ee750db04b78878c9633cc76e80dcf4416cbe982ac3a9222f80713c8", + "https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/source.json": "fa7b512dfcb5eafd90ce3959cf42a2a6fe96144ebbb4b3b3928054895f2afac2", "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", "https://bcr.bazel.build/modules/google_benchmark/1.9.5/MODULE.bazel": "8a85cfd90b1e45e6e68f1aa2aa9efce3c04add57df732571d7fd54c07e7c5143", "https://bcr.bazel.build/modules/google_benchmark/1.9.5/source.json": "0bd357fd9db30ee31d5eb4c78b1086ce3d79b4423ce76de19e8a2fa7b2fa2e10", @@ -68,15 +202,27 @@ "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", "https://bcr.bazel.build/modules/googletest/1.15.2/MODULE.bazel": "6de1edc1d26cafb0ea1a6ab3f4d4192d91a312fd2d360b63adaa213cd00b2108", + "https://bcr.bazel.build/modules/googletest/1.17.0.bcr.1/MODULE.bazel": "9f8e815fba6e81dee850a33068166989000eabcf7690d2127a975c2ebda6baae", "https://bcr.bazel.build/modules/googletest/1.17.0.bcr.2/MODULE.bazel": "827f54f492a3ce549c940106d73de332c2b30cebd0c20c0bc5d786aba7f116cb", "https://bcr.bazel.build/modules/googletest/1.17.0/MODULE.bazel": "dbec758171594a705933a29fcf69293d2468c49ec1f2ebca65c36f504d72df46", - "https://bcr.bazel.build/modules/googletest/1.18.0/MODULE.bazel": "00f855225d5746ca0d59965b09762e278b7259a6dfb7840d1b034ab60e72921e", - "https://bcr.bazel.build/modules/googletest/1.18.0/source.json": "cbf8951f03dcff3750c0265b431bb6245e91cf327a2c7284e896acefd1b87b68", + "https://bcr.bazel.build/modules/googletest/1.18.0.bcr.1/MODULE.bazel": "b489ffe6790bb6a3544b64c7604cbbea8a5529574cd4697dac227472656cea2b", + "https://bcr.bazel.build/modules/googletest/1.18.0.bcr.1/source.json": "963014628876b76748ab3babb368f53ff4afe6ee327bf9fc1e893e62757b6ac4", + "https://bcr.bazel.build/modules/jq.bzl/0.1.0/MODULE.bazel": "2ce69b1af49952cd4121a9c3055faa679e748ce774c7f1fda9657f936cae902f", + "https://bcr.bazel.build/modules/jq.bzl/0.1.0/source.json": "746bf13cac0860f091df5e4911d0c593971cd8796b5ad4e809b2f8e133eee3d5", "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", "https://bcr.bazel.build/modules/libpfm/4.11.0.bcr.1/MODULE.bazel": "e5362dadc90aab6724c83a2cc1e67cbed9c89a05d97fb1f90053c8deb1e445c8", "https://bcr.bazel.build/modules/libpfm/4.11.0.bcr.1/source.json": "0646414d9037f8aad148781dd760bec90b0b25ac12fda5e03f8aadbd6b9c61e6", "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/m4/1.4.21.bcr.4/MODULE.bazel": "40fef4b9091aea8e97b76a5706b3490b8d731ba008b02a883751ee2abf84daf4", + "https://bcr.bazel.build/modules/m4/1.4.21.bcr.4/source.json": "c4add456cedd43c0c0d1329bd52120f8eedb6191c6d8299448bce1ed81be60a4", + "https://bcr.bazel.build/modules/nlohmann_json/3.12.0.bcr.1/MODULE.bazel": "a1c8bb07b5b91d971727c635f449d05623ac9608f6fe4f5f04254ea12f08e349", + "https://bcr.bazel.build/modules/nlohmann_json/3.12.0.bcr.1/source.json": "93f82a5ae985eb935c539bfee95e04767187818189241ac956f3ccadbdb8fb02", + "https://bcr.bazel.build/modules/onetbb/2023.1.0/MODULE.bazel": "af7aaf0a28cb1b4ae950c69b7fa951e75eb9b312421116997ba0ae85771ffa41", + "https://bcr.bazel.build/modules/onetbb/2023.1.0/source.json": "a2439cb6e8ae476ea75c783b4d173f8c09b358ad690b53de65821cfbb1182477", + "https://bcr.bazel.build/modules/openssl/3.5.4.bcr.1/MODULE.bazel": "57715e299abe6a43fe4965dbb0a7d7de62222c8f51dd8671ed4751ad5fdd3636", + "https://bcr.bazel.build/modules/openssl/3.5.4.bcr.1/source.json": "85414804e90d84843def3877206172ae0c6664587c070dab2cb765d1b3ca3836", + "https://bcr.bazel.build/modules/package_metadata/0.0.2/MODULE.bazel": "fb8d25550742674d63d7b250063d4580ca530499f045d70748b1b142081ebb92", "https://bcr.bazel.build/modules/package_metadata/0.0.3/MODULE.bazel": "77890552ecea9e284b5424c9de827a58099348763a4359e975c359a83d4faa83", "https://bcr.bazel.build/modules/package_metadata/0.0.3/source.json": "742075a428ad12a3fa18a69014c2f57f01af910c6d9d18646c990200853e641a", "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", @@ -104,7 +250,8 @@ "https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/MODULE.bazel": "e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34", "https://bcr.bazel.build/modules/pybind11_bazel/2.13.6/MODULE.bazel": "2d746fda559464b253b2b2e6073cb51643a2ac79009ca02100ebbc44b4548656", "https://bcr.bazel.build/modules/pybind11_bazel/3.0.0/MODULE.bazel": "a2bfa6020ed603a00d944161c63173c7f109774e99bee0c2cd8dbf24159f8134", - "https://bcr.bazel.build/modules/pybind11_bazel/3.0.0/source.json": "d8f5104d4c21d272bf327ebe44366fb0b4c036cdaa1f5cceb21a408ca4ef2ef8", + "https://bcr.bazel.build/modules/pybind11_bazel/3.0.1/MODULE.bazel": "67899804c3dbdf169d107ce7c00e60a38a46d097c7ff3460bdebe192cbc77f56", + "https://bcr.bazel.build/modules/pybind11_bazel/3.0.1/source.json": "5bcb3ae55c0d5a159bd910154d7ee8873bdf61dd7b13cd0a2bb456011ec706ae", "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/MODULE.bazel": "b4963dda9b31080be1905ef085ecd7dd6cd47c05c79b9cdf83ade83ab2ab271a", "https://bcr.bazel.build/modules/re2/2024-07-02/MODULE.bazel": "0eadc4395959969297cbcf31a249ff457f2f1d456228c67719480205aa306daa", @@ -128,22 +275,29 @@ "https://bcr.bazel.build/modules/rules_cc/0.1.4/MODULE.bazel": "bb03a452a7527ac25a7518fb86a946ef63df860b9657d8323a0c50f8504fb0b9", "https://bcr.bazel.build/modules/rules_cc/0.1.5/MODULE.bazel": "88dfc9361e8b5ae1008ac38f7cdfd45ad738e4fa676a3ad67d19204f045a1fd8", "https://bcr.bazel.build/modules/rules_cc/0.2.0/MODULE.bazel": "b5c17f90458caae90d2ccd114c81970062946f49f355610ed89bebf954f5783c", + "https://bcr.bazel.build/modules/rules_cc/0.2.13/MODULE.bazel": "eecdd666eda6be16a8d9dc15e44b5c75133405e820f620a234acc4b1fdc5aa37", "https://bcr.bazel.build/modules/rules_cc/0.2.14/MODULE.bazel": "353c99ed148887ee89c54a17d4100ae7e7e436593d104b668476019023b58df8", + "https://bcr.bazel.build/modules/rules_cc/0.2.16/MODULE.bazel": "9242fa89f950c6ef7702801ab53922e99c69b02310c39fb6e62b2bd30df2a1d4", "https://bcr.bazel.build/modules/rules_cc/0.2.17/MODULE.bazel": "1849602c86cb60da8613d2de887f9566a6d354a6df6d7009f9d04a14402f9a84", "https://bcr.bazel.build/modules/rules_cc/0.2.18/MODULE.bazel": "4460ec36adc8f722a6a2a4ac9374cb91f2acebadaa93fc37966129afb3dece87", + "https://bcr.bazel.build/modules/rules_cc/0.2.20/MODULE.bazel": "f5c07bce5ddcb99be21a0812ff5aadb439e688b7449c6542152363b2fd859c1a", "https://bcr.bazel.build/modules/rules_cc/0.2.22/MODULE.bazel": "94df4328edef9e44d38de5e73b037cd348e75e7ae55f4e21bf07878c41a31ebb", - "https://bcr.bazel.build/modules/rules_cc/0.2.22/source.json": "b2d6d6f9c332ce269ad75b89c6f3168d809a66173c9040210fb9bcc733ab42fa", + "https://bcr.bazel.build/modules/rules_cc/0.2.25/MODULE.bazel": "4a3d4f3606d3b3190be495dbc497acca552807d1d5540661ef0d1658472882e3", + "https://bcr.bazel.build/modules/rules_cc/0.2.25/source.json": "8df28a9a97b878fe45f0a4f4adf019869dda51a60ee2f6e15a0c79656a25058d", + "https://bcr.bazel.build/modules/rules_cc/0.2.4/MODULE.bazel": "1ff1223dfd24f3ecf8f028446d4a27608aa43c3f41e346d22838a4223980b8cc", "https://bcr.bazel.build/modules/rules_cc/0.2.8/MODULE.bazel": "f1df20f0bf22c28192a794f29b501ee2018fa37a3862a1a2132ae2940a23a642", "https://bcr.bazel.build/modules/rules_cc/0.2.9/MODULE.bazel": "34263f1dca62ea664265438cef714d7db124c03e1ed55ebb4f1dc860164308d1", - "https://bcr.bazel.build/modules/rules_foreign_cc/0.11.1/MODULE.bazel": "beeb0dd8d488d3cff57fa12ab3378051a7299aa9de2476d61c1d46f664d6398d", - "https://bcr.bazel.build/modules/rules_foreign_cc/0.15.1/MODULE.bazel": "c2c60d26c79fda484acb95cdbec46e89d6b28b4845cb277160ce1e0c8622bb88", - "https://bcr.bazel.build/modules/rules_foreign_cc/0.15.1/source.json": "a161811a63ba8a859086da3b7ff3ad04f2e9c255d7727b41087103fc0eb22f55", + "https://bcr.bazel.build/modules/rules_cc_autoconf/0.13.2/MODULE.bazel": "3ec13b93183a28b7088563e0fef1a51835dde06c272a1dabc5900e8bc26b2188", + "https://bcr.bazel.build/modules/rules_cc_autoconf/0.19.0/MODULE.bazel": "7835352c9c5bab4e880ba098145c7f9267329ed03927ac70e96b6ebefc4f4cec", + "https://bcr.bazel.build/modules/rules_cc_autoconf/0.24.0/MODULE.bazel": "332e2a2972ef5d5a537b2dbc23bea7a0d5d97fc5fa82cebe032b1b8d509b06a1", + "https://bcr.bazel.build/modules/rules_cc_autoconf/0.24.0/source.json": "7b729d9f90f03cfd1214a69ddb1f7efd0009d68271ccdbfa7dec9f2dcabaaa55", "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e", "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", + "https://bcr.bazel.build/modules/rules_java/6.3.0/MODULE.bazel": "a97c7678c19f236a956ad260d59c86e10a463badb7eb2eda787490f4c969b963", "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", "https://bcr.bazel.build/modules/rules_java/7.1.0/MODULE.bazel": "30d9135a2b6561c761bd67bd4990da591e6bdc128790ce3e7afd6a3558b2fb64", @@ -156,6 +310,7 @@ "https://bcr.bazel.build/modules/rules_java/8.14.0/source.json": "8a88c4ca9e8759da53cddc88123880565c520503321e2566b4e33d0287a3d4bc", "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", + "https://bcr.bazel.build/modules/rules_java/8.6.0/MODULE.bazel": "9c064c434606d75a086f15ade5edb514308cccd1544c2b2a89bbac4310e41c71", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", @@ -170,6 +325,8 @@ "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", + "https://bcr.bazel.build/modules/rules_perl/0.5.0/MODULE.bazel": "1bff473031644dfb23bd57abe3befe9780f003f0d2156b082527a5c477008792", + "https://bcr.bazel.build/modules/rules_perl/0.5.0/source.json": "0076e22051d1b8aedf6d1bf3655bd9e895e9b01dbd3ccc82d80d3bbcae863c34", "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", @@ -179,6 +336,8 @@ "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", "https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1", + "https://bcr.bazel.build/modules/rules_pycross/0.8.3/MODULE.bazel": "e726b9d033f3d743d55c6dbda2d850f18aa912134bfb9e5717d98b16bcd30598", + "https://bcr.bazel.build/modules/rules_pycross/0.8.3/source.json": "011cb3635856e333b6c335f8134417597e029055f3d75919b47cdfb17950f6fb", "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", @@ -188,150 +347,151 @@ "https://bcr.bazel.build/modules/rules_python/0.34.0/MODULE.bazel": "1d623d026e075b78c9fde483a889cda7996f5da4f36dffb24c246ab30f06513a", "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", - "https://bcr.bazel.build/modules/rules_python/1.2.0/MODULE.bazel": "5aeeb48b2a6c19d668b48adf2b8a2b209a6310c230db0ce77450f148a89846e4", + "https://bcr.bazel.build/modules/rules_python/1.0.0/MODULE.bazel": "898a3d999c22caa585eb062b600f88654bf92efb204fa346fb55f6f8edffca43", "https://bcr.bazel.build/modules/rules_python/1.5.1/MODULE.bazel": "acfe65880942d44a69129d4c5c3122d57baaf3edf58ae5a6bd4edea114906bf5", "https://bcr.bazel.build/modules/rules_python/1.6.3/MODULE.bazel": "a7b80c42cb3de5ee2a5fa1abc119684593704fcd2fec83165ebe615dec76574f", "https://bcr.bazel.build/modules/rules_python/1.7.0/MODULE.bazel": "d01f995ecd137abf30238ad9ce97f8fc3ac57289c8b24bd0bf53324d937a14f8", - "https://bcr.bazel.build/modules/rules_python/1.7.0/source.json": "028a084b65dcf8f4dc4f82f8778dbe65df133f234b316828a82e060d81bdce32", + "https://bcr.bazel.build/modules/rules_python/1.9.0/MODULE.bazel": "afc3a05f29f09f2d3ee95ad99a145250dab41a2b2d8d6f82cc91936b3213282c", + "https://bcr.bazel.build/modules/rules_python/1.9.0/source.json": "3921ea0b65298d51aead5b9e4a82203d7be9b5918619b58b53f1c259f4e63169", "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", - "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", - "https://bcr.bazel.build/modules/rules_shell/0.3.0/source.json": "c55ed591aa5009401ddf80ded9762ac32c358d2517ee7820be981e2de9756cf3", + "https://bcr.bazel.build/modules/rules_shell/0.4.1/MODULE.bazel": "00e501db01bbf4e3e1dd1595959092c2fadf2087b2852d3f553b5370f5633592", + "https://bcr.bazel.build/modules/rules_shell/0.6.1/MODULE.bazel": "72e76b0eea4e81611ef5452aa82b3da34caca0c8b7b5c0c9584338aa93bae26b", + "https://bcr.bazel.build/modules/rules_shell/0.8.0/MODULE.bazel": "f6a89f1d6a669a26f28fe814503857055d76306b79cfc11d12399af08d0b80ae", + "https://bcr.bazel.build/modules/rules_shell/0.8.0/source.json": "eb53cc815bc503c6683c5fe12d943f98883f81fc22f51403ec8a95610cba4195", + "https://bcr.bazel.build/modules/spdlog/1.17.0/MODULE.bazel": "5d03b65eb8549f48dc888495c397b4053c8be095ea2e9c776d3c7aaaff3cd0d5", + "https://bcr.bazel.build/modules/spdlog/1.17.0/source.json": "62ba6fc81ead9d2bd05578c92643fa9abfa230c4ac238dbf10e75e3e1aaea4ee", "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef", + "https://bcr.bazel.build/modules/stardoc/0.6.2/MODULE.bazel": "7060193196395f5dd668eda046ccbeacebfd98efc77fed418dbe2b82ffaa39fd", "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7", "https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5", "https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216", - "https://bcr.bazel.build/modules/toolchains_llvm/1.1.2/MODULE.bazel": "402101d6f73115ec49a3a765a3361c1dd90ba3959fa688ccdcd465c36dbbbc52", - "https://bcr.bazel.build/modules/toolchains_llvm/1.1.2/source.json": "27f3cf531bc654c719b50411cac94613b7676d63e60962243d485af63e13b9ff", + "https://bcr.bazel.build/modules/tar.bzl/0.2.1/MODULE.bazel": "52d1c00a80a8cc67acbd01649e83d8dd6a9dc426a6c0b754a04fe8c219c76468", + "https://bcr.bazel.build/modules/tar.bzl/0.5.1/MODULE.bazel": "7c2eb3dcfc53b0f3d6f9acdfd911ca803eaf92aadf54f8ca6e4c1f3aee288351", + "https://bcr.bazel.build/modules/tar.bzl/0.5.5/MODULE.bazel": "4bfab9bbc7a1966c2c5f7371f5848f5e2d27c465951b4435adc9aaf00ed681da", + "https://bcr.bazel.build/modules/tar.bzl/0.5.5/source.json": "67c322bd9f9a6714b9d55d4df36ddc222976a7fbb2070410ef036f68cdf2eeb7", + "https://bcr.bazel.build/modules/tomlplusplus/3.4.0/MODULE.bazel": "0e703c6673f7291bf3b65351974cd105dee92e3229647514a6e0debff051cc82", + "https://bcr.bazel.build/modules/tomlplusplus/3.4.0/source.json": "5b7f01774e4212485bf0c022495325eacf993a9c0d67fb3d0bc694740aa39cd7", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", "https://bcr.bazel.build/modules/upb/0.0.0-20230516-61a97ef/MODULE.bazel": "c0df5e35ad55e264160417fd0875932ee3c9dda63d9fccace35ac62f45e1b6f9", - "https://bcr.bazel.build/modules/xz/5.4.5.bcr.2/MODULE.bazel": "463976fb85f578a2535421ba4c38fe90657ab348e4b5d5404b75c061602705d0", - "https://bcr.bazel.build/modules/xz/5.4.5.bcr.2/source.json": "e735da8a3f396bf200ed06c585f670f7667e08c4e1ed2849bae7c2691bcb10cf", + "https://bcr.bazel.build/modules/with_cfg.bzl/0.14.1/MODULE.bazel": "aa0ef3f6c67dd35db7ac38c76785dc02f48b53f34e16b20487e70f51b5324d0a", + "https://bcr.bazel.build/modules/with_cfg.bzl/0.14.1/source.json": "4666d3035f69063ecd136f3f0c68e424f1b1dd97ffc9cceb679522c0be38761b", + "https://bcr.bazel.build/modules/yq.bzl/0.1.1/MODULE.bazel": "9039681f9bcb8958ee2c87ffc74bdafba9f4369096a2b5634b88abc0eaefa072", + "https://bcr.bazel.build/modules/yq.bzl/0.1.1/source.json": "2d2bad780a9f2b9195a4a370314d2c17ae95eaa745cefc2e12fbc49759b15aa3", "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca", "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198", - "https://bcr.bazel.build/modules/zlib/1.3.2/MODULE.bazel": "7303cb87d80e438f313194fc640e38475a8d337b8c70ff6a0725f55236566a33", - "https://bcr.bazel.build/modules/zlib/1.3.2/source.json": "8f35ed65174ee2ad9630baeccd243cadf482b72d2ab32b57f9d84dc30ab076e0", - "https://bcr.bazel.build/modules/zstd/1.5.6/MODULE.bazel": "471ebe7d3cdd8c6469390fcf623eb4779ff55fbee0a87f1dc57a1def468b96d4", - "https://bcr.bazel.build/modules/zstd/1.5.6/source.json": "02010c3333fc89b44fe861db049968decb6e688411f7f9d4f6791d74f9adfb51" + "https://bcr.bazel.build/modules/zlib/1.3.2.bcr.1/MODULE.bazel": "b0601339f8d16ccd7b778db6d68c9afee8278578c78f407ef276bfdf7c9ac73c", + "https://bcr.bazel.build/modules/zlib/1.3.2.bcr.1/source.json": "4dc02e1dde88f719a34819151f616258ff48f0099d61642a8ccfc9a72eb8382a", + "https://bcr.bazel.build/modules/zlib/1.3.2/MODULE.bazel": "7303cb87d80e438f313194fc640e38475a8d337b8c70ff6a0725f55236566a33" }, "selectedYankedVersions": {}, "moduleExtensions": { - "@@pybind11_bazel+//:internal_configure.bzl%internal_configure_extension": { + "@@aspect_rules_py+//py:extensions.bzl%py_tools": { "general": { - "bzlTransitiveDigest": "tTVXx5awRrw3tdWVDq1eemm8zSoh5O0F8fjzYFe+Opo=", - "usagesDigest": "tVQNvLoXMWAbiK39am3yovKGpwINdftfn7RpDyN+JZc=", + "bzlTransitiveDigest": "oU/ipNJ8DeJdU0mSys6ZGfB2UTKgppiJMtoZD+x2ae0=", + "usagesDigest": "9BiP3ASHlGl4doGhzXJwK17taNzv/q6x/IZ4Hb6LxNY=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "pybind11": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "rules_py_tools.darwin_amd64": { + "repoRuleId": "@@aspect_rules_py+//py/private/toolchain:repo.bzl%prebuilt_tool_repo", "attributes": { - "build_file": "@@pybind11_bazel+//:pybind11-BUILD.bazel", - "strip_prefix": "pybind11-2.13.6", - "url": "https://github.com/pybind/pybind11/archive/refs/tags/v2.13.6.tar.gz", - "integrity": "sha256-4Iy4f0dz2pf6e18DXeh2OrxlbYfVdz5i9toFh9Hw7CA=" - } - } - }, - "recordedRepoMappingEntries": [ - [ - "pybind11_bazel+", - "bazel_tools", - "bazel_tools" - ] - ] - } - }, - "@@rules_fuzzing+//fuzzing/private:extensions.bzl%non_module_dependencies": { - "general": { - "bzlTransitiveDigest": "v2H25KPHEkN56IHR41S67Kzp5Xjxd75GBiazhON8jzc=", - "usagesDigest": "wy6ISK6UOcBEjj/mvJ/S3WeXoO67X+1llb9yPyFtPgc=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "platforms": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz", - "https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz" - ], - "sha256": "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74" + "platform": "darwin_amd64" } }, - "rules_python": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "rules_py_tools.darwin_arm64": { + "repoRuleId": "@@aspect_rules_py+//py/private/toolchain:repo.bzl%prebuilt_tool_repo", "attributes": { - "sha256": "d70cd72a7a4880f0000a6346253414825c19cdd40a28289bdf67b8e6480edff8", - "strip_prefix": "rules_python-0.28.0", - "url": "https://github.com/bazelbuild/rules_python/releases/download/0.28.0/rules_python-0.28.0.tar.gz" + "platform": "darwin_arm64" } }, - "bazel_skylib": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "rules_py_tools.linux_amd64": { + "repoRuleId": "@@aspect_rules_py+//py/private/toolchain:repo.bzl%prebuilt_tool_repo", "attributes": { - "sha256": "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94", - "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz" - ] + "platform": "linux_amd64" } }, - "com_google_absl": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "rules_py_tools.linux_arm64": { + "repoRuleId": "@@aspect_rules_py+//py/private/toolchain:repo.bzl%prebuilt_tool_repo", "attributes": { - "urls": [ - "https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.1.zip" - ], - "strip_prefix": "abseil-cpp-20240116.1", - "integrity": "sha256-7capMWOvWyoYbUaHF/b+I2U6XLMaHmky8KugWvfXYuk=" + "platform": "linux_arm64" } }, - "rules_fuzzing_oss_fuzz": { - "repoRuleId": "@@rules_fuzzing+//fuzzing/private/oss_fuzz:repository.bzl%oss_fuzz_repository", - "attributes": {} - }, - "honggfuzz": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "rules_py_tools": { + "repoRuleId": "@@aspect_rules_py+//py/private/toolchain:repo.bzl%toolchains_repo", "attributes": { - "build_file": "@@rules_fuzzing+//:honggfuzz.BUILD", - "sha256": "6b18ba13bc1f36b7b950c72d80f19ea67fbadc0ac0bb297ec89ad91f2eaa423e", - "url": "https://github.com/google/honggfuzz/archive/2.5.zip", - "strip_prefix": "honggfuzz-2.5" + "user_repository_name": "rules_py_tools" } }, - "rules_fuzzing_jazzer": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_jar", - "attributes": { - "sha256": "ee6feb569d88962d59cb59e8a31eb9d007c82683f3ebc64955fd5b96f277eec2", - "url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer/0.20.1/jazzer-0.20.1.jar" - } - }, - "rules_fuzzing_jazzer_api": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_jar", + "rules_py_pex_2_3_1": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", "attributes": { - "sha256": "f5a60242bc408f7fa20fccf10d6c5c5ea1fcb3c6f44642fec5af88373ae7aa1b", - "url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer-api/0.20.1/jazzer-api-0.20.1.jar" + "urls": [ + "https://files.pythonhosted.org/packages/e7/d0/fbda2a4d41d62d86ce53f5ae4fbaaee8c34070f75bb7ca009090510ae874/pex-2.3.1-py2.py3-none-any.whl" + ], + "sha256": "64692a5bf6f298403aab930d22f0d836ae4736c5bc820e262e9092fe8c56f830", + "downloaded_file_path": "pex-2.3.1-py2.py3-none-any.whl" } } }, "recordedRepoMappingEntries": [ [ - "rules_fuzzing+", + "aspect_rules_py+", + "aspect_tools_telemetry_report", + "aspect_tools_telemetry++telemetry+aspect_tools_telemetry_report" + ], + [ + "aspect_rules_py+", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "aspect_rules_py+", "bazel_tools", "bazel_tools" ] ] } }, + "@@aspect_tools_telemetry+//:extension.bzl%telemetry": { + "general": { + "bzlTransitiveDigest": "cl5A2O84vDL6Tt+Qga8FCj1DUDGqn+e7ly5rZ+4xvcc=", + "usagesDigest": "pyph4lSDn5CHIn4s2mtKJTkRaLV/o2zIFgnrpufr/8o=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "aspect_tools_telemetry_report": { + "repoRuleId": "@@aspect_tools_telemetry+//:extension.bzl%tel_repository", + "attributes": { + "deps": { + "aspect_rules_py": "1.8.4", + "aspect_tools_telemetry": "0.3.3" + } + } + } + }, + "recordedRepoMappingEntries": [ + [ + "aspect_tools_telemetry+", + "bazel_lib", + "bazel_lib+" + ], + [ + "aspect_tools_telemetry+", + "bazel_skylib", + "bazel_skylib+" + ] + ] + } + }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { - "bzlTransitiveDigest": "OlvsB0HsvxbR8ZN+J9Vf00X/+WVz/Y/5Xrq2LgcVfdo=", + "bzlTransitiveDigest": "nvW/NrBXlAmiQw99EMGKkLaD2KbNp2mQDlxdfpr+0Ls=", "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -393,245 +553,10 @@ ] } }, - "@@rules_python+//python/extensions:config.bzl%config": { - "general": { - "bzlTransitiveDigest": "xaCns8Qt+8bJqVLy8r6nc/eL2AjEIX/vOdjqoh5xYac=", - "usagesDigest": "ZVSXMAGpD+xzVNPuvF1IoLBkty7TROO0+akMapt1pAg=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "rules_python_internal": { - "repoRuleId": "@@rules_python+//python/private:internal_config_repo.bzl%internal_config_repo", - "attributes": { - "transition_setting_generators": {}, - "transition_settings": [] - } - }, - "pypi__build": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/e2/03/f3c8ba0a6b6e30d7d18c40faab90807c9bb5e9a1e3b2fe2008af624a9c97/build-1.2.1-py3-none-any.whl", - "sha256": "75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__click": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl", - "sha256": "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__colorama": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", - "sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__importlib_metadata": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl", - "sha256": "30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__installer": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl", - "sha256": "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__more_itertools": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl", - "sha256": "686b06abe565edfab151cb8fd385a05651e1fdf8f0a14191e4439283421f8684", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__packaging": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl", - "sha256": "2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__pep517": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/25/6e/ca4a5434eb0e502210f591b97537d322546e4833dcb4d470a48c375c5540/pep517-0.13.1-py3-none-any.whl", - "sha256": "31b206f67165b3536dd577c5c3f1518e8fbaf38cbc57efff8369a392feff1721", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__pip": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl", - "sha256": "ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__pip_tools": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/0d/dc/38f4ce065e92c66f058ea7a368a9c5de4e702272b479c0992059f7693941/pip_tools-7.4.1-py3-none-any.whl", - "sha256": "4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__pyproject_hooks": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/ae/f3/431b9d5fe7d14af7a32340792ef43b8a714e7726f1d7b69cc4e8e7a3f1d7/pyproject_hooks-1.1.0-py3-none-any.whl", - "sha256": "7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__setuptools": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/90/99/158ad0609729111163fc1f674a5a42f2605371a4cf036d0441070e2f7455/setuptools-78.1.1-py3-none-any.whl", - "sha256": "c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__tomli": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl", - "sha256": "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__wheel": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl", - "sha256": "55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - }, - "pypi__zipp": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "url": "https://files.pythonhosted.org/packages/da/55/a03fd7240714916507e1fcf7ae355bd9d9ed2e6db492595f1a67f61681be/zipp-3.18.2-py3-none-any.whl", - "sha256": "dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e", - "type": "zip", - "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" - } - } - }, - "recordedRepoMappingEntries": [ - [ - "rules_python+", - "bazel_tools", - "bazel_tools" - ], - [ - "rules_python+", - "pypi__build", - "rules_python++config+pypi__build" - ], - [ - "rules_python+", - "pypi__click", - "rules_python++config+pypi__click" - ], - [ - "rules_python+", - "pypi__colorama", - "rules_python++config+pypi__colorama" - ], - [ - "rules_python+", - "pypi__importlib_metadata", - "rules_python++config+pypi__importlib_metadata" - ], - [ - "rules_python+", - "pypi__installer", - "rules_python++config+pypi__installer" - ], - [ - "rules_python+", - "pypi__more_itertools", - "rules_python++config+pypi__more_itertools" - ], - [ - "rules_python+", - "pypi__packaging", - "rules_python++config+pypi__packaging" - ], - [ - "rules_python+", - "pypi__pep517", - "rules_python++config+pypi__pep517" - ], - [ - "rules_python+", - "pypi__pip", - "rules_python++config+pypi__pip" - ], - [ - "rules_python+", - "pypi__pip_tools", - "rules_python++config+pypi__pip_tools" - ], - [ - "rules_python+", - "pypi__pyproject_hooks", - "rules_python++config+pypi__pyproject_hooks" - ], - [ - "rules_python+", - "pypi__setuptools", - "rules_python++config+pypi__setuptools" - ], - [ - "rules_python+", - "pypi__tomli", - "rules_python++config+pypi__tomli" - ], - [ - "rules_python+", - "pypi__wheel", - "rules_python++config+pypi__wheel" - ], - [ - "rules_python+", - "pypi__zipp", - "rules_python++config+pypi__zipp" - ] - ] - } - }, "@@rules_python+//python/uv:uv.bzl%uv": { "general": { - "bzlTransitiveDigest": "N8SCcKcL6KnzBLApxvY2jR9vhXjA2VCBZMLZfY3sDRA=", - "usagesDigest": "H8dQoNZcoqP+Mu0tHZTi4KHATzvNkM5ePuEqoQdklIU=", + "bzlTransitiveDigest": "yG9F6L2IZXKRbD/aIUa6sU7uITLUTBKOMWPbIvl1VdM=", + "usagesDigest": "6MjoD3H+netDdhklgMWks3NARpHVXxy8kfsMe9XXPa8=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -668,6 +593,61 @@ ] ] } + }, + "@@tar.bzl+//tar:extensions.bzl%toolchains": { + "general": { + "bzlTransitiveDigest": "x8T4avQwaccwFRDkBObSMray93ZBHwpcjsZTPQOyII0=", + "usagesDigest": "497DxJu9fctxZ2dnODoz4tFt1RfafnAPUyXmmgB6wvM=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "bsd_tar_toolchains": { + "repoRuleId": "@@tar.bzl+//tar/toolchain:toolchain.bzl%tar_toolchains_repo", + "attributes": { + "user_repository_name": "bsd_tar_toolchains" + } + }, + "bsd_tar_toolchains_darwin_amd64": { + "repoRuleId": "@@tar.bzl+//tar/toolchain:platforms.bzl%bsdtar_binary_repo", + "attributes": { + "platform": "darwin_amd64" + } + }, + "bsd_tar_toolchains_darwin_arm64": { + "repoRuleId": "@@tar.bzl+//tar/toolchain:platforms.bzl%bsdtar_binary_repo", + "attributes": { + "platform": "darwin_arm64" + } + }, + "bsd_tar_toolchains_linux_amd64": { + "repoRuleId": "@@tar.bzl+//tar/toolchain:platforms.bzl%bsdtar_binary_repo", + "attributes": { + "platform": "linux_amd64" + } + }, + "bsd_tar_toolchains_linux_arm64": { + "repoRuleId": "@@tar.bzl+//tar/toolchain:platforms.bzl%bsdtar_binary_repo", + "attributes": { + "platform": "linux_arm64" + } + }, + "bsd_tar_toolchains_windows_amd64": { + "repoRuleId": "@@tar.bzl+//tar/toolchain:platforms.bzl%bsdtar_binary_repo", + "attributes": { + "platform": "windows_amd64" + } + }, + "bsd_tar_toolchains_windows_arm64": { + "repoRuleId": "@@tar.bzl+//tar/toolchain:platforms.bzl%bsdtar_binary_repo", + "attributes": { + "platform": "windows_arm64" + } + } + }, + "recordedRepoMappingEntries": [] + } } - } + }, + "facts": {} } diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel deleted file mode 100644 index 8171c4485..000000000 --- a/bazel/BUILD.bazel +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -# Intentionally empty -- exists only so the .bzl files in this package can -# be loaded (Bazel requires every .bzl file to sit under a package). diff --git a/bazel/git_version.bzl b/bazel/git_version.bzl deleted file mode 100644 index fa87038ef..000000000 --- a/bazel/git_version.bzl +++ /dev/null @@ -1,51 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -"""Repository rule computing the current git commit hash, for generating -src/core/NajaVersion.h (mirrors CMakeLists.txt's `configure_file` step, -which substitutes `@NAJA_GIT_HASH@` with `git log -1 --pretty=format:%h` -run at CMake-configure time -- src/core/CMakeLists.txt). - -This value matters beyond a diagnostic string: per the NajaIF snapshot -compatibility work (see CLAUDE.md), `naja::NAJA_GIT_HASH` is one of the -two producer-identity fields `SNLCapnP::load()` checks for an exact match -before deserializing a snapshot. - -Caveat: unlike CMake (which reruns `git log` on every configure), this -value is captured once, when Bazel evaluates this repository rule, and -can go stale relative to the actually-checked-out commit until something -forces Bazel to re-evaluate it (e.g. a clean build, or `bazel sync`). -Bazel's proper version-stamping mechanism (`ctx.info_file`/`--stamp`) only -applies to executable targets (`cc_binary`/`cc_test`), not the `cc_library` -that needs this header compiled in -- getting genuinely fresh-per-build -stamping into a library would need a custom rule reading `.git/HEAD` and -`.git/refs/**` directly as real (unsandboxed) build inputs, which is a -larger undertaking deferred for now. Flagged here rather than silently -accepted. -""" - -def _git_version_impl(repository_ctx): - workspace_root = repository_ctx.workspace_root - git = repository_ctx.which("git") - - git_hash = "unknown" - if git: - result = repository_ctx.execute( - [git, "log", "-1", "--pretty=format:%h"], - working_directory = str(workspace_root), - ) - if result.return_code == 0 and result.stdout.strip(): - git_hash = result.stdout.strip() - - repository_ctx.file( - "git_version.bzl", - 'NAJA_GIT_HASH = "{}"\n'.format(git_hash), - ) - repository_ctx.file("BUILD.bazel", "") - -git_version = repository_rule( - implementation = _git_version_impl, - local = True, - doc = "Computes the current git commit hash for NajaVersion.h.", -) diff --git a/bazel/lefdef_bison.bzl b/bazel/lefdef_bison.bzl deleted file mode 100644 index 4739dcd50..000000000 --- a/bazel/lefdef_bison.bzl +++ /dev/null @@ -1,83 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -"""Custom Bison codegen rule for the vendored lefdef (LEF/DEF) parsers. - -Mirrors thirdparty/lefdef/src/{lef/lef,def/def}/CMakeLists.txt's -BISON_TARGET() calls. Unlike naja-verilog's parser (see -internal/bazel-migration-plan.md), lef.y/def.y use bison's classic C -skeleton (no `%skeleton "lalr1.cc"`), so there's no location.hh-style -auxiliary output to worry about -- just an optional `--defines=` header. - -`def` is a deliberate asymmetry, not a bug: def/def/CMakeLists.txt's -BISON_TARGET call omits DEFINES_FILE, so CMake never names an explicit -header, bison then auto-derives an unused "def.hpp" (confirmed -empirically), and every def/def/*.cpp that needs parser token -definitions instead #includes the *already checked into git* -"def.tab.h" -- a historical artifact of how this vendored SDK was -originally committed (see the flagged finding: def/def/ has 67 compiled -.o files and other build byproducts committed alongside source in the -initial "lefdef" vendoring commit, 2025-02-03). This rule replicates -that exact real behavior rather than "fixing" it: `generate_hdr` is only -set for `lef` (which has a real DEFINES_FILE), and `def.tab.h` is listed -as an ordinary checked-in header instead. -""" - -def _lefdef_bison_impl(ctx): - out_cpp = ctx.actions.declare_file(ctx.attr.name + ".cpp") - outputs = [out_cpp] - - args = ctx.actions.args() - args.add_all(["-Wconflicts-sr", "-p", ctx.attr.name_prefix]) - args.add("--output=" + out_cpp.path) - - out_hdr = None - if ctx.attr.hdr_out: - out_hdr = ctx.actions.declare_file(ctx.attr.hdr_out) - outputs.append(out_hdr) - args.add_all(["-d", "--defines=" + out_hdr.path]) - - args.add(ctx.file.src) - - ctx.actions.run( - executable = ctx.executable._bison, - arguments = [args], - inputs = [ctx.file.src], - tools = [ctx.executable._m4], - outputs = outputs, - env = {"M4": ctx.executable._m4.path}, - mnemonic = "BisonLefDef", - progress_message = "Generating lefdef parser from %s" % ctx.file.src.short_path, - ) - return [DefaultInfo(files = depset(outputs))] - -lefdef_bison_parser = rule( - implementation = _lefdef_bison_impl, - attrs = { - "src": attr.label(mandatory = True, allow_single_file = [".y"]), - "name_prefix": attr.string( - mandatory = True, - doc = "bison -p symbol prefix (e.g. lefyy/defyy), avoids " + - "yylex/yyparse collisions when linking both parsers.", - ), - "hdr_out": attr.string( - doc = "If set, also generate this --defines= header file. " + - "Leave unset to skip header generation entirely (as " + - "for `def` -- see file doc comment).", - ), - "_bison": attr.label( - default = "@bison_tool//:bison", - allow_single_file = True, - executable = True, - cfg = "exec", - ), - "_m4": attr.label( - default = "@m4_tool//:m4", - allow_single_file = True, - executable = True, - cfg = "exec", - ), - }, - doc = "Generates a lefdef parser .cpp (and optionally a --defines= header) via system bison.", -) diff --git a/bazel/registry/README.md b/bazel/registry/README.md new file mode 100644 index 000000000..c63ce96fa --- /dev/null +++ b/bazel/registry/README.md @@ -0,0 +1,56 @@ +# In-tree Bazel registry + +naja's `MODULE.bazel` contains only `bazel_dep`s. Modules that are not +(yet) on the [Bazel Central Registry](https://registry.bazel.build/) are +served from this directory, which `.bazelrc` lists ahead of BCR: + +``` +common --registry=file://%workspace%/bazel/registry +common --registry=https://bcr.bazel.build/ +``` + +| Module | Why it is here | +|---|---| +| `naja-if` | not on BCR | +| `naja-verilog` | not on BCR; the overlay uses BCR `bison`/`flex` instead of host tools | +| `sv-lang` | BCR has slang `f04e815`; naja is developed against `b60d729` | + +The layout is exactly BCR's (`modules//metadata.json`, +`modules///{MODULE.bazel,source.json,presubmit.yml,overlay/,patches/}`), +so publishing a module is a matter of copying its directory into a +[bazel-central-registry](https://github.com/bazelbuild/bazel-central-registry) +pull request, then deleting it here. As in BCR, `overlay/MODULE.bazel` is +a symlink to the version's `MODULE.bazel`. + +## Versions + +Unreleased commits use BCR's `--` scheme, e.g. +`0.0.0-20260909-be6544b1`. naja's own build reads the commit back from +that version string (`src/core/naja_version.bzl`). + +## Updating a module + +1. Add `modules///` with a `MODULE.bazel` whose + `module(version = ...)` matches the directory name, plus any + `overlay/` files or `patches/` (applied with `-p1`). +2. Add the version to `modules//metadata.json`. +3. Write `source.json`: + + ``` + bazel/registry/update_source.py [] + ``` + + Rerun it after editing an overlay file or patch; it records their + integrity hashes too. +4. Point the `bazel_dep` in `MODULE.bazel` at the new version. + +## Depending on naja from another module + +A module that depends on naja needs these registry entries too. Either +copy the module directories into its own registry, or list this one by a +pinned URL: + +``` +common --registry=https://raw.githubusercontent.com/najaeda/naja//bazel/registry/ +common --registry=https://bcr.bazel.build/ +``` diff --git a/bazel/registry/bazel_registry.json b/bazel/registry/bazel_registry.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/bazel/registry/bazel_registry.json @@ -0,0 +1 @@ +{} diff --git a/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/MODULE.bazel b/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/MODULE.bazel new file mode 100644 index 000000000..950bf563f --- /dev/null +++ b/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/MODULE.bazel @@ -0,0 +1,7 @@ +module( + name = "naja-if", + version = "0.0.0-20260723-099677d9", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "capnp-cpp", version = "1.5.0") diff --git a/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/overlay/MODULE.bazel b/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/overlay/MODULE.bazel new file mode 120000 index 000000000..9b599e3ad --- /dev/null +++ b/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/presubmit.yml b/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/presubmit.yml new file mode 100644 index 000000000..efdb8e8f9 --- /dev/null +++ b/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/presubmit.yml @@ -0,0 +1,12 @@ +matrix: + platform: ["debian11", "ubuntu2204", "macos"] + bazel: ["8.x"] +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - "@naja-if//:naja_common_capnp" + - "@naja-if//:naja_nl_interface_capnp" + - "@naja-if//:naja_nl_implementation_capnp" diff --git a/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/source.json b/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/source.json new file mode 100644 index 000000000..6ff0d9da9 --- /dev/null +++ b/bazel/registry/modules/naja-if/0.0.0-20260723-099677d9/source.json @@ -0,0 +1,8 @@ +{ + "url": "https://github.com/najaeda/naja-if/archive/099677d9f52c0db11b12c08d03e32543eebc7888.tar.gz", + "integrity": "sha256-CpgFMMwSoZp99XAgEssJbAGGuW/pMyi/slBBWDT63Ro=", + "strip_prefix": "naja-if-099677d9f52c0db11b12c08d03e32543eebc7888", + "overlay": { + "MODULE.bazel": "sha256-nA7heWTSwkdu0i+fkZuf0o8AXU2vluaGlvBLr+Gac5s=" + } +} diff --git a/bazel/registry/modules/naja-if/metadata.json b/bazel/registry/modules/naja-if/metadata.json new file mode 100644 index 000000000..665c45ff5 --- /dev/null +++ b/bazel/registry/modules/naja-if/metadata.json @@ -0,0 +1,11 @@ +{ + "homepage": "https://github.com/najaeda/naja-if", + "maintainers": [], + "repository": [ + "github:najaeda/naja-if" + ], + "versions": [ + "0.0.0-20260723-099677d9" + ], + "yanked_versions": {} +} diff --git a/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/MODULE.bazel b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/MODULE.bazel new file mode 100644 index 000000000..2457b6a31 --- /dev/null +++ b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/MODULE.bazel @@ -0,0 +1,9 @@ +module( + name = "naja-verilog", + version = "0.0.0-20260909-be6544b1", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "bison", version = "3.8.2.bcr.9") +bazel_dep(name = "flex", version = "2.6.4.bcr.7") +bazel_dep(name = "rules_cc", version = "0.2.25") diff --git a/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/overlay/BUILD.bazel b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/overlay/BUILD.bazel new file mode 100644 index 000000000..18168108f --- /dev/null +++ b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/overlay/BUILD.bazel @@ -0,0 +1,60 @@ +# Replaces upstream's BUILD.bazel, which runs bison/flex found on the +# host PATH, with the hermetic bison/flex modules. + +load("@bison//:bison.bzl", "bison") +load("@flex//:flex.bzl", "flex") +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +# lalr1.cc with %defines also emits location.hh, which VerilogScanner.h +# includes, so it is a declared output. +bison( + name = "verilog_parser", + srcs = ["src/VerilogParser.yy"], + outs = [ + "src/VerilogParser.cpp", + "src/VerilogParser.hpp", + "src/location.hh", + ], + args = [ + "-d", + "-Wconflicts-sr", + "-Wconflicts-rr", + "--output=$(execpath src/VerilogParser.cpp)", + "--defines=$(execpath src/VerilogParser.hpp)", + "$(execpath src/VerilogParser.yy)", + ], +) + +flex( + name = "verilog_scanner", + srcs = ["src/VerilogScanner.ll"], + outs = ["src/VerilogScanner.cpp"], + args = [ + "--c++", + "--outfile=$(execpath src/VerilogScanner.cpp)", + "$(execpath src/VerilogScanner.ll)", + ], +) + +cc_library( + name = "naja_verilog", + srcs = [ + "src/VerilogConstructor.cpp", + "src/VerilogParser.cpp", + "src/VerilogPreprocessor.cpp", + "src/VerilogScanner.cpp", + "src/VerilogTypes.cpp", + ], + hdrs = [ + "src/VerilogConstructor.h", + "src/VerilogException.h", + "src/VerilogParser.hpp", + "src/VerilogPreprocessor.h", + "src/VerilogScanner.h", + "src/VerilogTypes.h", + "src/location.hh", + ], + includes = ["src"], + visibility = ["//visibility:public"], + deps = ["@flex//:headers"], +) diff --git a/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/overlay/MODULE.bazel b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/overlay/MODULE.bazel new file mode 120000 index 000000000..9b599e3ad --- /dev/null +++ b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/presubmit.yml b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/presubmit.yml new file mode 100644 index 000000000..4754142b5 --- /dev/null +++ b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/presubmit.yml @@ -0,0 +1,10 @@ +matrix: + platform: ["debian11", "ubuntu2204", "macos"] + bazel: ["8.x"] +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - "@naja-verilog//:naja_verilog" diff --git a/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/source.json b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/source.json new file mode 100644 index 000000000..75ea9a04c --- /dev/null +++ b/bazel/registry/modules/naja-verilog/0.0.0-20260909-be6544b1/source.json @@ -0,0 +1,9 @@ +{ + "url": "https://github.com/najaeda/naja-verilog/archive/be6544b128e229ce2aee814e795c1e49b02caf5c.tar.gz", + "integrity": "sha256-9vqRPprxmlif5la9UD+eGssfqxHbilY0V1E+dhE7sAM=", + "strip_prefix": "naja-verilog-be6544b128e229ce2aee814e795c1e49b02caf5c", + "overlay": { + "BUILD.bazel": "sha256-OCuY0FdD3VSEvvTe6QhSMUxw0q8nYsNP1dSZCvtxI4U=", + "MODULE.bazel": "sha256-CmLHk4vzbQJDi5hBgw2Yb7jLVI0ou4rZs1R1Mq3PV3g=" + } +} diff --git a/bazel/registry/modules/naja-verilog/metadata.json b/bazel/registry/modules/naja-verilog/metadata.json new file mode 100644 index 000000000..a9985d99f --- /dev/null +++ b/bazel/registry/modules/naja-verilog/metadata.json @@ -0,0 +1,11 @@ +{ + "homepage": "https://github.com/najaeda/naja-verilog", + "maintainers": [], + "repository": [ + "github:najaeda/naja-verilog" + ], + "versions": [ + "0.0.0-20260909-be6544b1" + ], + "yanked_versions": {} +} diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/MODULE.bazel b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/MODULE.bazel new file mode 100644 index 000000000..864e91f27 --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/MODULE.bazel @@ -0,0 +1,25 @@ +"""https://sv-lang.com/""" + +module( + name = "sv-lang", + version = "11.0.0-20260701-b60d729d", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "aspect_bazel_lib", version = "2.21.2") +bazel_dep(name = "aspect_rules_py", version = "1.8.4") +bazel_dep(name = "bazel_skylib", version = "1.8.2") +bazel_dep(name = "boost.unordered", version = "1.90.0.bcr.1") +bazel_dep(name = "fmt", version = "12.2.0") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "pybind11_bazel", version = "3.0.1") +bazel_dep(name = "rules_cc", version = "0.2.9") +bazel_dep(name = "rules_pycross", version = "0.8.3") +bazel_dep(name = "rules_python", version = "1.9.0") +bazel_dep(name = "tomlplusplus", version = "3.4.0") + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain(python_version = "3.13", is_default = True) + +pycross = use_extension("@rules_pycross//pycross/extensions:pycross.bzl", "pycross") +pycross.configure_environments(python_versions = ["3.13"]) diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/BUILD.bazel b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/BUILD.bazel new file mode 100644 index 000000000..7e28a0ba6 --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/BUILD.bazel @@ -0,0 +1,513 @@ + + +load("@aspect_bazel_lib//lib:run_binary.bzl", "run_binary") +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("@pybind11_bazel//:build_defs.bzl", "pybind_library") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") +load("@rules_python//python:defs.bzl", "py_binary") + + +package(default_visibility = ["//visibility:private"]) + + +# This version pins MikePopoloski/slang at the master commit naja is +# developed against (v10.0-401-gb60d729d6, CMake version 11.0). The github +# commit tarball extracts to slang-/, so SOURCES_PREFIX is hard-coded. +SLANG_VERSION_MAJOR = "11" +SLANG_VERSION_MINOR = "0" +SLANG_VERSION_MICRO = "0" +SLANG_VERSION = "{}.{}.{}".format(SLANG_VERSION_MAJOR, SLANG_VERSION_MINOR, SLANG_VERSION_MICRO) + +# The source repo has a top level directory "external" which is reserved by Bazel. +# We don't use `strip_prefix` in source.json so the "external" directory +# is not at the top level. +SOURCES_PREFIX = "slang-b60d729d66b9cdeec158b800f898461a138d505e" + + + +# Python dependencies for the code generation scripts +py_binary( + name = "diagnostic_gen", + srcs = [SOURCES_PREFIX + "/scripts/diagnostic_gen.py"], +) + +py_binary( + name = "syntax_gen", + srcs = [SOURCES_PREFIX + "/scripts/syntax_gen.py"], +) + +py_binary( + name = "grammar_gen", + srcs = [SOURCES_PREFIX + "/scripts/grammar_gen.py"], +) + +# Run diagnostic generation +run_binary( + name = "generate_diagnostics", + srcs = [ + SOURCES_PREFIX + "/scripts/diagnostics.txt", + SOURCES_PREFIX + "/scripts/warning_docs.txt", + ] + glob([SOURCES_PREFIX + "/include/slang/analysis/*"]), + outs = [ + "generated/DiagCode.cpp", + "generated/slang/diagnostics/AllDiags.h", + "generated/slang/diagnostics/AnalysisDiags.h", + "generated/slang/diagnostics/CompilationDiags.h", + "generated/slang/diagnostics/ConstEvalDiags.h", + "generated/slang/diagnostics/DeclarationsDiags.h", + "generated/slang/diagnostics/DriverDiags.h", + "generated/slang/diagnostics/ExpressionsDiags.h", + "generated/slang/diagnostics/GeneralDiags.h", + "generated/slang/diagnostics/LexerDiags.h", + "generated/slang/diagnostics/LookupDiags.h", + "generated/slang/diagnostics/MetaDiags.h", + "generated/slang/diagnostics/NumericDiags.h", + "generated/slang/diagnostics/ParserDiags.h", + "generated/slang/diagnostics/PreprocessorDiags.h", + "generated/slang/diagnostics/StatementsDiags.h", + "generated/slang/diagnostics/SysFuncsDiags.h", + "generated/slang/diagnostics/TypesDiags.h", + ], + args = [ + "--diagnostics=$(location {}/scripts/diagnostics.txt)".format(SOURCES_PREFIX), + "--outDir=$(RULEDIR)/generated/", + "--srcDir={}/scripts/diagnostics/".format(SOURCES_PREFIX), + "--incDir={}/include/slang/analysis/".format(SOURCES_PREFIX), + ], + tool = ":diagnostic_gen", +) + +# Run syntax generation +run_binary( + name = "generate_syntax", + srcs = [ + SOURCES_PREFIX + "/scripts/syntax.txt", + SOURCES_PREFIX + "/scripts/systemnames.txt", + SOURCES_PREFIX + "/scripts/tokenkinds.txt", + SOURCES_PREFIX + "/scripts/triviakinds.txt", + ], + outs = [ + "generated/AllSyntax.cpp", + "generated/KnownSystemName.cpp", + "generated/SyntaxClone.cpp", + "generated/TokenKind.cpp", + "generated/slang/parsing/KnownSystemName.h", + "generated/slang/parsing/TokenKind.h", + "generated/slang/syntax/AllSyntax.h", + "generated/slang/syntax/CSTJsonVisitorGen.h", + "generated/slang/syntax/SyntaxFwd.h", + "generated/slang/syntax/SyntaxKind.h", + ], + args = [ + "--syntax=$(location {}/scripts/syntax.txt)".format(SOURCES_PREFIX), + "--dir=$(RULEDIR)/generated/", + ], + tool = ":syntax_gen", +) + +# Run syntax generation for the python bindings +run_binary( + name = "generate_syntax_python", + srcs = [ + SOURCES_PREFIX + "/scripts/syntax.txt", + ], + outs = [ + "generated/pyslang/PySyntaxBindings0.cpp", + "generated/pyslang/PySyntaxBindings1.cpp", + "generated/pyslang/PySyntaxBindings2.cpp", + "generated/pyslang/PySyntaxBindings3.cpp", + "generated/pyslang/PySyntaxFactory.cpp", + ], + args = [ + "--syntax=$(location {}/scripts/syntax.txt)".format(SOURCES_PREFIX), + "--dir=$(RULEDIR)/generated/pyslang/", + "--python-bindings", + ], + tool = ":syntax_gen", +) + +expand_template( + name = "VersionInfo", + out = "VersionInfo.cpp", + substitutions = { + "@SLANG_VERSION_MAJOR@": SLANG_VERSION_MAJOR, + "@SLANG_VERSION_MINOR@": SLANG_VERSION_MINOR, + "@SLANG_VERSION_PATCH@": SLANG_VERSION_MICRO, + "@SLANG_VERSION_PRERELEASE@": "", + "@SLANG_VERSION_HASH@": "b60d729d", + }, + template = SOURCES_PREFIX + "/source/util/VersionInfo.cpp.in", +) + +# List of generated header files for the slang library +filegroup( + name = "slang_lib_generated_headers", + srcs = [ + "generated/slang/diagnostics/AllDiags.h", + "generated/slang/diagnostics/AnalysisDiags.h", + "generated/slang/diagnostics/CompilationDiags.h", + "generated/slang/diagnostics/ConstEvalDiags.h", + "generated/slang/diagnostics/DeclarationsDiags.h", + "generated/slang/diagnostics/DriverDiags.h", + "generated/slang/diagnostics/ExpressionsDiags.h", + "generated/slang/diagnostics/GeneralDiags.h", + "generated/slang/diagnostics/LexerDiags.h", + "generated/slang/diagnostics/LookupDiags.h", + "generated/slang/diagnostics/MetaDiags.h", + "generated/slang/diagnostics/NumericDiags.h", + "generated/slang/diagnostics/ParserDiags.h", + "generated/slang/diagnostics/PreprocessorDiags.h", + "generated/slang/diagnostics/StatementsDiags.h", + "generated/slang/diagnostics/SysFuncsDiags.h", + "generated/slang/diagnostics/TypesDiags.h", + "generated/slang/parsing/KnownSystemName.h", + "generated/slang/parsing/TokenKind.h", + "generated/slang/syntax/AllSyntax.h", + "generated/slang/syntax/CSTJsonVisitorGen.h", + "generated/slang/syntax/SyntaxFwd.h", + "generated/slang/syntax/SyntaxKind.h", + ], +) + +filegroup( + name = "slang_lib_external_headers", + srcs = glob([ + SOURCES_PREFIX + "/external/**/*.h", + SOURCES_PREFIX + "/external/**/*.hpp", + ]), +) + +filegroup( + name = "slang_lib_internal_include_headers", + srcs = glob([ + SOURCES_PREFIX + "/include/**/*.h", + ]), +) + +filegroup( + name = "slang_lib_internal_source_headers", + srcs = glob([ + SOURCES_PREFIX + "/source/**/*.h", + ]), +) + +filegroup( + name = "slang_ast_sources", + srcs = glob([ + SOURCES_PREFIX + "/source/ast/**/*.cpp", + SOURCES_PREFIX + "/source/ast/**/*.h", + ]), +) + +filegroup( + # Collect all the headers together for the main library + name = "slang_lib_headers", + srcs = [ + ":slang_lib_external_headers", + ":slang_lib_generated_headers", + ":slang_lib_internal_include_headers", + ":slang_lib_internal_source_headers", + ], +) + +cc_library( + name = "libsvlang", + srcs = [ + "generated/AllSyntax.cpp", + "generated/DiagCode.cpp", + "generated/KnownSystemName.cpp", + "generated/SyntaxClone.cpp", + "generated/TokenKind.cpp", + SOURCES_PREFIX + "/source/analysis/AbstractFlowAnalysis.cpp", + SOURCES_PREFIX + "/source/analysis/AnalysisManager.cpp", + SOURCES_PREFIX + "/source/analysis/AnalyzedAssertion.cpp", + SOURCES_PREFIX + "/source/analysis/AnalyzedProcedure.cpp", + SOURCES_PREFIX + "/source/analysis/CaseDecisionDag.cpp", + SOURCES_PREFIX + "/source/analysis/ClockInference.cpp", + SOURCES_PREFIX + "/source/analysis/DataFlowAnalysis.cpp", + SOURCES_PREFIX + "/source/analysis/DFAResults.cpp", + SOURCES_PREFIX + "/source/analysis/DriverTracker.cpp", + SOURCES_PREFIX + "/source/analysis/ValueDriver.cpp", + SOURCES_PREFIX + "/source/diagnostics/DiagnosticClient.cpp", + SOURCES_PREFIX + "/source/diagnostics/DiagnosticEngine.cpp", + SOURCES_PREFIX + "/source/diagnostics/Diagnostics.cpp", + SOURCES_PREFIX + "/source/diagnostics/JsonDiagnosticClient.cpp", + SOURCES_PREFIX + "/source/diagnostics/TextDiagnosticClient.cpp", + SOURCES_PREFIX + "/source/diagnostics/WaiverManager.cpp", + SOURCES_PREFIX + "/source/driver/CompatSettings.cpp", + SOURCES_PREFIX + "/source/driver/Driver.cpp", + SOURCES_PREFIX + "/source/driver/MemoryStats.cpp", + SOURCES_PREFIX + "/source/driver/SourceLoader.cpp", + SOURCES_PREFIX + "/source/driver/UserDefinedSubroutine.cpp", + SOURCES_PREFIX + "/source/numeric/ConstantValue.cpp", + SOURCES_PREFIX + "/source/numeric/SVInt.cpp", + SOURCES_PREFIX + "/source/numeric/Time.cpp", + SOURCES_PREFIX + "/source/parsing/Lexer.cpp", + SOURCES_PREFIX + "/source/parsing/LexerFacts.cpp", + SOURCES_PREFIX + "/source/parsing/NumberParser.cpp", + SOURCES_PREFIX + "/source/parsing/Parser.cpp", + SOURCES_PREFIX + "/source/parsing/ParserBase.cpp", + SOURCES_PREFIX + "/source/parsing/ParserMetadata.cpp", + SOURCES_PREFIX + "/source/parsing/Parser_expressions.cpp", + SOURCES_PREFIX + "/source/parsing/Parser_members.cpp", + SOURCES_PREFIX + "/source/parsing/Parser_statements.cpp", + SOURCES_PREFIX + "/source/parsing/Preprocessor.cpp", + SOURCES_PREFIX + "/source/parsing/Preprocessor_macros.cpp", + SOURCES_PREFIX + "/source/parsing/Preprocessor_pragmas.cpp", + SOURCES_PREFIX + "/source/parsing/Token.cpp", + SOURCES_PREFIX + "/source/syntax/CSTSerializer.cpp", + SOURCES_PREFIX + "/source/syntax/SyntaxFacts.cpp", + SOURCES_PREFIX + "/source/syntax/SyntaxNode.cpp", + SOURCES_PREFIX + "/source/syntax/SyntaxPrinter.cpp", + SOURCES_PREFIX + "/source/syntax/SyntaxTree.cpp", + SOURCES_PREFIX + "/source/syntax/SyntaxRewriter.cpp", + SOURCES_PREFIX + "/source/text/CharInfo.cpp", + SOURCES_PREFIX + "/source/text/Glob.cpp", + SOURCES_PREFIX + "/source/text/Json.cpp", + SOURCES_PREFIX + "/source/text/SourceLocation.cpp", + SOURCES_PREFIX + "/source/text/SourceManager.cpp", + SOURCES_PREFIX + "/source/util/BumpAllocator.cpp", + SOURCES_PREFIX + "/source/util/CommandLine.cpp", + SOURCES_PREFIX + "/source/util/IntervalMap.cpp", + SOURCES_PREFIX + "/source/util/OS.cpp", + SOURCES_PREFIX + "/source/util/SmallVector.cpp", + SOURCES_PREFIX + "/source/util/String.cpp", + SOURCES_PREFIX + "/source/util/ThreadPool.cpp", + SOURCES_PREFIX + "/source/util/TimeTrace.cpp", + SOURCES_PREFIX + "/source/util/Util.cpp", + ":slang_ast_sources", + ":slang_lib_headers", + ":VersionInfo.cpp", + ], + hdrs = [":slang_lib_internal_include_headers"], + copts = [ + "-std=c++20", + "-fvisibility=hidden", + "-fvisibility-inlines-hidden", + "-fPIC", # Position-independent code required for python bindings + ], + includes = [ + "generated", + SOURCES_PREFIX + "/external", + SOURCES_PREFIX + "/include", + ], + visibility = ["//visibility:public"], + # CMake's SLANG_USE_THREADS (default ON) is a public define: it changes + # the layout of classes consumers see. + defines = ["SLANG_USE_THREADS"], + deps = [ + "//private/slang/export_headers:slang_export_headers", + "@boost.unordered", + "@fmt", + "@tomlplusplus", + ], + alwayslink = True, +) + +# Slang driver - the main slang binary +cc_binary( + name = "slang", + srcs = [ + SOURCES_PREFIX + "/tools/driver/slang_main.cpp", + ], + copts = [ + "-std=c++20", + ], + visibility = ["//visibility:public"], + deps = [ + ":libsvlang", + ], +) + +# Slang-tidy linting tool + +cc_library( + name = "slang_tidy_lib", + srcs = [ + SOURCES_PREFIX + "/tools/tidy/src/ASTHelperVisitors.cpp", + SOURCES_PREFIX + "/tools/tidy/src/TidyConfig.cpp", + SOURCES_PREFIX + "/tools/tidy/src/TidyConfigParser.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/AlwaysCombNamed.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/AlwaysCombNonBlocking.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/AlwaysFFBlocking.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/EnforceModuleInstantiationPrefix.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/EnforcePortPrefix.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/EnforcePortSuffix.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/GenerateNamed.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/NoDotStarInPortConnection.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/NoDotVarInPortConnection.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/NoImplicitPortNameInPortConnection.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/NoLegacyGenerate.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/NoOldAlwaysSyntax.cpp", + SOURCES_PREFIX + "/tools/tidy/src/style/OnlyANSIPortDecl.cpp", + SOURCES_PREFIX + "/tools/tidy/src/synthesis/AlwaysFFAssignmentOutsideConditional.cpp", + SOURCES_PREFIX + "/tools/tidy/src/synthesis/CastSignedIndex.cpp", + SOURCES_PREFIX + "/tools/tidy/src/synthesis/NoLatchesOnDesign.cpp", + SOURCES_PREFIX + "/tools/tidy/src/synthesis/OnlyAssignedOnReset.cpp", + SOURCES_PREFIX + "/tools/tidy/src/synthesis/RegisterHasNoReset.cpp", + SOURCES_PREFIX + "/tools/tidy/src/synthesis/UndrivenRange.cpp", + SOURCES_PREFIX + "/tools/tidy/src/synthesis/UnusedSensitiveSignal.cpp", + SOURCES_PREFIX + "/tools/tidy/src/synthesis/XilinxDoNotCareValues.cpp", + ], + hdrs = glob([ + SOURCES_PREFIX + "/tools/tidy/include/**/*.h", + ]), + copts = [ + "-std=c++20", + ], + includes = [ + SOURCES_PREFIX + "/tools/tidy/include", + ], + visibility = ["//visibility:public"], + deps = [ + ":libsvlang", + ], + alwayslink = True, +) + +cc_binary( + name = "slang-tidy", + srcs = [ + SOURCES_PREFIX + "/tools/tidy/src/tidy.cpp", + ], + copts = [ + "-std=c++20", + ], + visibility = ["//visibility:public"], + deps = [ + ":slang_tidy_lib", + ], +) + +cc_binary( + name = "slang-hier", + srcs = [ + SOURCES_PREFIX + "/tools/hier/hier.cpp", + ], + copts = [ + "-std=c++20", + ], + visibility = ["//visibility:public"], + deps = [ + ":libsvlang", + ], +) + +cc_library( + name = "slang_reflect_lib", + srcs = [ + SOURCES_PREFIX + "/tools/reflect/src/SvEnum.cpp", + SOURCES_PREFIX + "/tools/reflect/src/SvLocalParam.cpp", + SOURCES_PREFIX + "/tools/reflect/src/SvStruct.cpp", + SOURCES_PREFIX + "/tools/reflect/src/SvType.cpp", + SOURCES_PREFIX + "/tools/reflect/src/SvTypeReflector.cpp", + SOURCES_PREFIX + "/tools/reflect/src/SvUnion.cpp", + ], + hdrs = glob([SOURCES_PREFIX + "/tools/reflect/include/**/*.h"]), + copts = [ + "-std=c++20", + ], + includes = [SOURCES_PREFIX + "/tools/reflect/include"], + visibility = ["//visibility:public"], + deps = [ + ":libsvlang", + ], + alwayslink = True, +) + +cc_binary( + name = "slang-reflect", + srcs = [ + SOURCES_PREFIX + "/tools/reflect/src/reflect.cpp", + ], + copts = [ + "-std=c++20", + ], + visibility = ["//visibility:public"], + deps = [ + ":slang_reflect_lib", + ], +) + +cc_binary( + name = "rewriter", + srcs = [ + SOURCES_PREFIX + "/tools/rewriter/rewriter.cpp", + ], + copts = [ + "-std=c++20", + ], + visibility = ["//visibility:public"], + deps = [ + ":libsvlang", + ], +) + +# TODO: run threadtest as a test if multithreading is ever enabled +cc_binary( + name = "slang-threadtest", + srcs = [ + SOURCES_PREFIX + "/tools/threadtest/threadtest.cpp", + ], + copts = [ + "-std=c++20", + "-fsanitize=thread", + ], + linkopts = [ + "-fsanitize=thread", + ], + visibility = ["//visibility:public"], + deps = [ + ":libsvlang", + ], +) + +# Add python bindings +pybind_library( + name = "pyslang_bindings_lib", + srcs = [ + SOURCES_PREFIX + "/bindings/python/AnalysisBindings.cpp", + SOURCES_PREFIX + "/bindings/python/ASTBindings.cpp", + SOURCES_PREFIX + "/bindings/python/CompBindings.cpp", + SOURCES_PREFIX + "/bindings/python/ExpressionBindings.cpp", + SOURCES_PREFIX + "/bindings/python/NumericBindings.cpp", + SOURCES_PREFIX + "/bindings/python/pyslang.cpp", + SOURCES_PREFIX + "/bindings/python/StatementBindings.cpp", + SOURCES_PREFIX + "/bindings/python/SymbolBindings.cpp", + SOURCES_PREFIX + "/bindings/python/SyntaxBindings.cpp", + SOURCES_PREFIX + "/bindings/python/TypeBindings.cpp", + SOURCES_PREFIX + "/bindings/python/UtilBindings.cpp", + # Generated + "generated/pyslang/PySyntaxBindings0.cpp", + "generated/pyslang/PySyntaxBindings1.cpp", + "generated/pyslang/PySyntaxBindings2.cpp", + "generated/pyslang/PySyntaxBindings3.cpp", + "generated/pyslang/PySyntaxFactory.cpp", + ], + hdrs = [ + SOURCES_PREFIX + "/bindings/python/PyVisitors.h", + SOURCES_PREFIX + "/bindings/python/pyslang.h", + ], + copts = [ + "-std=c++20", + "-fPIC", + ], + defines = [ + "VERSION_INFO={}".format(SLANG_VERSION), + ], + includes = [ + SOURCES_PREFIX + "/bindings/python", + ], + visibility = ["//:__subpackages__"], + deps = [":libsvlang"], +) + +# Export sources to use in pyslang +filegroup( + name = "pyslang_bindings_srcs", + srcs = [ + SOURCES_PREFIX + "/bindings/python/pyslang.cpp", + SOURCES_PREFIX + "/bindings/python/pyslang.h", + ], + visibility = ["//:__subpackages__"], +) diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/MODULE.bazel b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/MODULE.bazel new file mode 120000 index 000000000..9b599e3ad --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/slang/export_headers/BUILD.bazel b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/slang/export_headers/BUILD.bazel new file mode 100644 index 000000000..a1ae9c056 --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/slang/export_headers/BUILD.bazel @@ -0,0 +1,35 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +# Emit slang/slang_export.h via a genrule. The upstream foreign_cc cmake() +# probe links a test .o with consumer cxxopts in front of it; downstreams +# passing -xc++ make clang read the .o as source and the build fails. + +genrule( + name = "gen_slang_export", + outs = ["slang/slang_export.h"], + cmd = """cat > $@ <<'EOF' +#ifndef SLANG_EXPORT_H +#define SLANG_EXPORT_H + +#ifdef SLANG_STATIC_DEFINE +# define SLANG_EXPORT +# define SLANG_NO_EXPORT +#else +# define SLANG_EXPORT __attribute__((visibility("default"))) +# define SLANG_NO_EXPORT __attribute__((visibility("hidden"))) +#endif + +#ifndef SLANG_DEPRECATED +# define SLANG_DEPRECATED __attribute__((__deprecated__)) +#endif + +#endif +EOF""", +) + +cc_library( + name = "slang_export_headers", + hdrs = [":gen_slang_export"], + includes = ["."], + visibility = ["//:__subpackages__"], +) diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/BUILD.bazel b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/BUILD.bazel new file mode 100644 index 000000000..917b71bc7 --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/BUILD.bazel @@ -0,0 +1,19 @@ +load("@bazel_skylib//rules:build_test.bzl", "build_test") + +# Test builds of binaries and libraries +build_test( + name = "test_slang_builds", + targets = [ + "//:libsvlang", + "//:slang", + "//:slang-hier", + "//:slang-reflect", + "//:rewriter", + "//:slang-tidy", + "//:slang-threadtest", + "//pyslang:pyslang_lib", + ], +) + + +# TODO: wrap up the tests (C++ and Python) in the source repo to be run here as well diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/BUILD.bazel b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/BUILD.bazel new file mode 100644 index 000000000..2d8007b67 --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/BUILD.bazel @@ -0,0 +1,11 @@ +load("@aspect_rules_py//py:defs.bzl", "py_test") + + +py_test( + name = "test", + srcs = ["test.py"], + data = [":test_module.sv"], + deps = [ + "//pyslang:pyslang_wheel_lib", + ], +) diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/test.py b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/test.py new file mode 100644 index 000000000..5c3b937cc --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/test.py @@ -0,0 +1,21 @@ +import pyslang +import os +import sys + +test_dir = os.path.dirname(__file__) + + +def test_pyslang(): + """ + Import pyslang and show that we can load a syntax tree from an RTL file. + """ + tree = pyslang.syntax.SyntaxTree.fromFile(f"{test_dir}/test_module.sv") + mod = tree.root.members[0] + if mod.header.name.value != "test_module": + raise RuntimeError(f"Expected module name 'test_module', got '{mod.header.name.value}'") + + return 0 + + +if __name__ == "__main__": + sys.exit(test_pyslang()) diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/test_module.sv b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/test_module.sv new file mode 100644 index 000000000..849f3b9b2 --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/private/tests/pyslang/test_module.sv @@ -0,0 +1,12 @@ +module test_module( + input wire [3:0] a, // 4-bit input A + input wire [3:0] b, // 4-bit input B + input wire cin, // Carry input + output wire [3:0] sum, // 4-bit sum output + output wire cout // Carry output +); + + // 4-bit adder with carry + assign {cout, sum} = a + b + cin; + +endmodule diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/pyslang/BUILD.bazel b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/pyslang/BUILD.bazel new file mode 100644 index 000000000..681ace2c1 --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/pyslang/BUILD.bazel @@ -0,0 +1,59 @@ +load("@aspect_rules_py//py:defs.bzl", "py_library") +load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") +load("@rules_pycross//pycross:defs.bzl", "pycross_wheel_library") +load("@rules_python//python:packaging.bzl", "py_package", "py_wheel") + +# Slang version is hard-coded because module_version() is e.g. "10.0.bcr.2", +# and ".".join(...split(".")[:3]) yields "10.0.bcr" — not a valid PEP 440 +# version, which py_wheel rejects. The pinned slang source corresponds to +# upstream 10.0, matching SLANG_VERSION_{MAJOR,MINOR,MICRO} in +# private/slang/version_info/BUILD.bazel. +SLANG_VERSION = "10.0.0" + +# TODO: add .pyi stubs for the pybind python + +pybind_extension( + # Must be called "pyslang" to match the underlying C++ + name = "pyslang", + srcs = [ + "//:pyslang_bindings_srcs", + ], + copts = [ + "-std=c++20", + "-fPIC", + ], + defines = [ + "VERSION_INFO={}".format(SLANG_VERSION), + ], + deps = [ + "//:pyslang_bindings_lib", + ], +) + +py_library( + name = "pyslang_lib", + srcs = ["__init__.py"], + data = [":pyslang"], + visibility = ["//visibility:public"], +) + +py_package( + name = "pyslang_pkg", + deps = [":pyslang_lib"], +) + +py_wheel( + name = "pyslang_wheel", + distribution = "pyslang", + strip_path_prefixes = ["pyslang"], + version = SLANG_VERSION, + deps = [":pyslang_pkg"], +) + + +pycross_wheel_library( + name = "pyslang_wheel_lib", + enable_implicit_namespace_pkgs = False, + visibility = ["//visibility:public"], + wheel = ":pyslang_wheel", +) diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/pyslang/__init__.py b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/pyslang/__init__.py new file mode 100644 index 000000000..812ba399c --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/pyslang/__init__.py @@ -0,0 +1 @@ +from .pyslang import * # noqa: F403 diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/patches/toml_single_header.patch b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/patches/toml_single_header.patch new file mode 100644 index 000000000..a0e524c3e --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/patches/toml_single_header.patch @@ -0,0 +1,15 @@ +# BCR tomlplusplus exposes only its single-header build, toml.hpp, at its +# repository root (on the quote include path). +diff --git a/slang-b60d729d66b9cdeec158b800f898461a138d505e/source/diagnostics/WaiverManager.cpp b/slang-b60d729d66b9cdeec158b800f898461a138d505e/source/diagnostics/WaiverManager.cpp +index 54eafd542..60e309b3a 100644 +--- a/slang-b60d729d66b9cdeec158b800f898461a138d505e/source/diagnostics/WaiverManager.cpp ++++ b/slang-b60d729d66b9cdeec158b800f898461a138d505e/source/diagnostics/WaiverManager.cpp +@@ -11,7 +11,7 @@ + #include + #include + #include +-#include ++#include "toml.hpp" + + #include "slang/ast/Symbol.h" + #include "slang/diagnostics/DiagnosticEngine.h" diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/presubmit.yml b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/presubmit.yml new file mode 100644 index 000000000..7dab1db28 --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/presubmit.yml @@ -0,0 +1,60 @@ +# Take default incompatible flags from incompatible_flags.yml except with broken flags disabled +incompatible_flags: + # https://github.com/bazelbuild/bazel/issues/12933 + "--incompatible_config_setting_private_default_visibility": + - 6.x + - 7.x + - 8.x + # https://github.com/bazelbuild/bazel/issues/17032 + "--incompatible_disable_starlark_host_transitions": + - 6.x + - 7.x + - 8.x + # https://github.com/bazelbuild/bazel/issues/22080 + "--incompatible_disable_native_repo_rules": + - 7.x + - 8.x + # https://github.com/bazelbuild/bazel/issues/23043 + "--incompatible_autoload_externally=": + - 7.x + # - 8.x # DISABLED: Not supported by dependencies of sv-lang - TODO: revisit this + # https://github.com/bazelbuild/bazel/issues/23144 + # This flag will be flipped to false + # TODO: enable this after fixing https://github.com/bazelbuild/bazel/issues/23144#issuecomment-2793072689 + # "--noincompatible_enable_deprecated_label_apis": + # - 7.x + # - 8.x + # https://github.com/bazelbuild/bazel/issues/25755 + "--incompatible_disable_autoloads_in_main_repo": + - last_green + - rolling + # https://github.com/bazelbuild/bazel/issues/7026 + "--incompatible_strict_action_env": + - 6.x + - 7.x + - 8.x + + +bcr_test_module: + module_path: "" + matrix: + platform: + # Requires C++20 supported compiler (GCC > 11, clang > 17) + - ubuntu2204 + - ubuntu2404 + - macos_arm64 + bazel: ["7.x", "8.x", "9.x"] + + tasks: + verify_targets: + name: "Run test module" + platform: ${{ platform }} + bazel: ${{ bazel }} + build_flags: + - '--cxxopt=-std=c++20' + test_flags: + - '--cxxopt=-std=c++20' + build_targets: + - "//..." + test_targets: + - "//..." diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/source.json b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/source.json new file mode 100644 index 000000000..a75a3ff24 --- /dev/null +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/source.json @@ -0,0 +1,19 @@ +{ + "url": "https://github.com/MikePopoloski/slang/archive/b60d729d66b9cdeec158b800f898461a138d505e.tar.gz", + "integrity": "sha256-qfZVkMz0/yCDtJ8PQ1KqxT5kWLBLLxpl4kgUq6OgW8I=", + "overlay": { + "BUILD.bazel": "sha256-CTYEV9RDQYgI5QO1vOS3I0WlP4B/zWB+RjFYW203mh0=", + "MODULE.bazel": "sha256-D+Huzpu3pJUB/Ahf7YSZc6EAzB4aWijLXZnJF+WEUIQ=", + "private/slang/export_headers/BUILD.bazel": "sha256-R6Dv/CqeG3BKpy2/F7RraVg/6QpVp9R2+itU1P0jUDE=", + "private/tests/BUILD.bazel": "sha256-szGEhrNgI8xYYT3Dh65sYTxtLgzliigBBI327gTzFnE=", + "private/tests/pyslang/BUILD.bazel": "sha256-kOhB1jkTVq4BZCuXinob8Em29LMXNLPZWEYUtVZzGfo=", + "private/tests/pyslang/test.py": "sha256-wFIT9/C8ioU35gXxN7DL0JxC66krax4jtQUYz95KkAc=", + "private/tests/pyslang/test_module.sv": "sha256-cuFYQHHY3Prq0YX7nIiFIahIEygfrQgiiahgP3EJfFU=", + "pyslang/BUILD.bazel": "sha256-FmDm5VfrGn5NWvHuYlkslgTp2yuEGazBZbSBhthccGQ=", + "pyslang/__init__.py": "sha256-Pv8R9uPWuV98CNTxi8PNVfyJY9K35Vx4xbNcyWgZlfY=" + }, + "patches": { + "toml_single_header.patch": "sha256-IxmglfAK+306WiV2Y2GTb+oC6o5VdONXJNZZ9rAjb2A=" + }, + "patch_strip": 1 +} diff --git a/bazel/registry/modules/sv-lang/metadata.json b/bazel/registry/modules/sv-lang/metadata.json new file mode 100644 index 000000000..27ac4d5b5 --- /dev/null +++ b/bazel/registry/modules/sv-lang/metadata.json @@ -0,0 +1,24 @@ +{ + "homepage": "https://sv-lang.com/", + "maintainers": [ + { + "email": "36563979+ahizzey@users.noreply.github.com", + "github": "ahizzey", + "github_user_id": 36563979, + "name": "Adam Hizzey" + }, + { + "email": "16105468+willkeen@users.noreply.github.com", + "github": "willkeen", + "github_user_id": 16105468, + "name": "Will Keen" + } + ], + "repository": [ + "github:MikePopoloski/slang" + ], + "versions": [ + "11.0.0-20260701-b60d729d" + ], + "yanked_versions": {} +} diff --git a/bazel/registry/update_source.py b/bazel/registry/update_source.py new file mode 100755 index 000000000..611c2a826 --- /dev/null +++ b/bazel/registry/update_source.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2023 The Naja authors +# +# SPDX-License-Identifier: Apache-2.0 +"""(Re)write source.json for one module version in this registry. + +Usage: + update_source.py [] + +Downloads , records its integrity, and records the integrity of +every file under the version's overlay/ and patches/ directories, so +the entry stays valid after editing an overlay or patch. The layout is +the Bazel Central Registry's, so a finished entry can be copied +verbatim into a bazel-central-registry pull request. +""" + +import base64 +import hashlib +import json +import pathlib +import sys +import urllib.request + + +def integrity(data): + return "sha256-" + base64.b64encode(hashlib.sha256(data).digest()).decode() + + +def main(argv): + if len(argv) not in (4, 5): + sys.exit(__doc__) + module, version, url = argv[1:4] + strip_prefix = argv[4] if len(argv) == 5 else "" + root = pathlib.Path(__file__).resolve().parent / "modules" / module / version + if not (root / "MODULE.bazel").is_file(): + sys.exit("{}/MODULE.bazel not found".format(root)) + + with urllib.request.urlopen(url) as response: + source = {"url": url, "integrity": integrity(response.read())} + if strip_prefix: + source["strip_prefix"] = strip_prefix + + for kind in ("overlay", "patches"): + directory = root / kind + if directory.is_dir(): + source[kind] = { + str(path.relative_to(directory)): integrity(path.read_bytes()) + for path in sorted(directory.rglob("*")) + if path.is_file() + } + if "patches" in source: + source["patch_strip"] = 1 + + (root / "source.json").write_text(json.dumps(source, indent=4) + "\n") + + +if __name__ == "__main__": + main(sys.argv) diff --git a/bazel/system_tool.bzl b/bazel/system_tool.bzl deleted file mode 100644 index 162fd54c4..000000000 --- a/bazel/system_tool.bzl +++ /dev/null @@ -1,36 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -"""Repository rule locating a system-installed tool via PATH. - -Used for `bison`/`m4`, the same tools CMake's `find_package(BISON -REQUIRED)` (thirdparty/lefdef/CMakeLists.txt) resolves against. Mirrors -the pragmatic system-wrapping pattern this migration already uses for -TBB/Boost (bazel/thirdparty/{tbb,boost}/repo.bzl) and for naja-verilog's -own Bazel module (see internal/bazel-migration-plan.md) rather than -vendoring/building these toolchains from source under Bazel. -""" - -def _system_tool_repository_impl(repository_ctx): - tool = repository_ctx.attr.tool - found = repository_ctx.which(tool) - if not found: - fail(("{} not found on PATH; required to build naja's vendored " + - "lefdef parser. Is it installed? (brew install {} / " + - "apt install {})").format(tool, tool, tool)) - - repository_ctx.symlink(found, tool) - repository_ctx.file( - "BUILD.bazel", - 'exports_files(["{}"])\n'.format(tool), - ) - -system_tool_repository = repository_rule( - implementation = _system_tool_repository_impl, - attrs = { - "tool": attr.string(mandatory = True, doc = "Tool name to locate on PATH."), - }, - local = True, - doc = "Locates a system-installed tool (bison/m4) via PATH.", -) diff --git a/bazel/thirdparty/BUILD.bazel b/bazel/thirdparty/BUILD.bazel deleted file mode 100644 index 4c1ba2c93..000000000 --- a/bazel/thirdparty/BUILD.bazel +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -# Intentionally empty -- exists only so slang_host_prefixes.bzl can be -# loaded as a repo rule (Bazel requires every .bzl file to sit under a -# package). Deliberately placed here rather than inside -# bazel/thirdparty/slang/ (a dual-purpose directory whose BUILD.bazel is -# also copied into the separately-fetched @slang repo -- see -# bazel/thirdparty/slang/BUILD.bazel and .bazelignore) so this package -# doesn't need to be .bazelignore-d too. diff --git a/bazel/thirdparty/boost_overlay.BUILD b/bazel/thirdparty/boost_overlay.BUILD deleted file mode 100644 index 47a4eb613..000000000 --- a/bazel/thirdparty/boost_overlay.BUILD +++ /dev/null @@ -1,31 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -# Overlay BUILD file for the vendored Boost source (fetched via -# http_archive in MODULE.bazel from the official archives.boost.io -# release tarball, pinned to 1.89.0 -- superseding the earlier -# pkg-config/find_path-style bazel/thirdparty/boost/repo.bzl, which -# wrapped whatever Boost happened to be installed on the local machine. -# That approach meant the exact Boost version (and even which of several -# installed copies got picked, by search-order priority) silently varied -# by host, and a too-broad repo_ctx.symlink of the whole discovered -# include prefix (e.g. /usr/local/include) was found to leak unrelated -# system headers -- including an old libgtest-dev gtest.h that shadowed -# Bazel's own fetched @googletest headers on one machine (see git log). -# Vendoring a pinned release tarball removes both problems: identical -# Boost bits on every machine, and only boost/** ends up on the include -# path. -# -# naja only ever consumes Boost as headers (no compiled Boost:: -# component library is linked anywhere in src/), matching -# CMakeLists.txt's own `find_path(Boost_INCLUDE_DIR NAMES -# boost/version.hpp)` header-only usage -- so, same as fmt/tomlplusplus -# above, only a glob of the headers is needed, no srcs to compile. - -cc_library( - name = "headers", - hdrs = glob(["boost/**"]), - includes = ["."], - visibility = ["//visibility:public"], -) diff --git a/bazel/thirdparty/fmt_overlay.BUILD b/bazel/thirdparty/fmt_overlay.BUILD deleted file mode 100644 index 6a56124ca..000000000 --- a/bazel/thirdparty/fmt_overlay.BUILD +++ /dev/null @@ -1,38 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -# Overlay BUILD file for the vendored fmt repository (fetched via -# git_repository in MODULE.bazel, pinned to the exact 12.2.0 tag commit -# -- matching thirdparty/slang/external/CMakeLists.txt's own -# `GIT_TAG 12.2.0` / `FIND_PACKAGE_ARGS 12.2` requirement exactly). -# -# Supersedes the earlier pkg-config-based bazel/thirdparty/fmt/repo.bzl -# after live Ubuntu CI surfaced a real ABI mismatch: Ubuntu's apt fmt -# (libfmt-dev is v8/v9, both way below 12.2) fails slang's own internal -# find_package(fmt 12.2) version check, so slang's own build falls -# through to *its* FetchContent network fetch and links against a real -# fmt 12.2.0 -- meaning libsvlang.a ends up referencing `fmt::v12::...` -# symbols that the old apt-pkg-config-wrapped @fmt (v8/v9's `fmt::v8`/ -# `fmt::v9` namespace) can never satisfy (undefined reference errors, -# confirmed on live CI: `fmt::v12::detail::allocate`, -# `fmt::v12::detail::print`, etc.). Same root cause and same fix as -# bazel/thirdparty/tomlplusplus_overlay.BUILD's version mismatch: pin our -# own copy to the exact version slang itself requires, everywhere, -# instead of depending on whatever a given platform's package manager -# happens to ship. -# -# Mirrors fmt's own CMakeLists.txt: `add_library(fmt src/format.cc ...)` -# plus `src/os.cc` (FMT_OS, default ON -- slang's OS.cpp needs its -# `fmt::v12::detail::print(FILE*, ...)` overload). - -cc_library( - name = "fmt", - srcs = [ - "src/format.cc", - "src/os.cc", - ], - hdrs = glob(["include/fmt/**"]), - includes = ["include"], - visibility = ["//visibility:public"], -) diff --git a/bazel/thirdparty/python/BUILD.bazel b/bazel/thirdparty/python/BUILD.bazel deleted file mode 100644 index 87f8bbe17..000000000 --- a/bazel/thirdparty/python/BUILD.bazel +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -# Intentionally empty -- exists only so repo.bzl can be loaded as a repo -# rule (Bazel requires every .bzl file to sit under a package). diff --git a/bazel/thirdparty/python/repo.bzl b/bazel/thirdparty/python/repo.bzl deleted file mode 100644 index f66b29682..000000000 --- a/bazel/thirdparty/python/repo.bzl +++ /dev/null @@ -1,97 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -"""Repository rule wrapping the system-installed Python 3, located via -`python3-config` -- the same interpreter CMake's `find_package(Python -REQUIRED COMPONENTS Interpreter Development.Module)` / -`Development.Embed` (CMakeLists.txt) resolves against. Mirrors the -pragmatic system-wrapping pattern this migration already uses throughout -(TBB/Boost/fmt/tomlplusplus in bazel/thirdparty/, bison/m4 in -bazel/system_tool.bzl) rather than pulling in rules_python's hermetic -toolchain -- naja's own CMake build already just uses whatever Python 3 -is on the system, so this matches that exactly instead of introducing a -second, different Python for Bazel builds. - -Exposes: - - `@python//:headers` -- Python.h only, no linking. Correct for - building a Python *extension module* (naja.so): on both macOS and - Linux, extension module symbols are resolved dynamically by the - interpreter at import time, not linked at build time (matches - CMake's `Python3::Module` -- see src/nl/python/naja_wrapping/CMakeLists.txt). - - `@python//:embed` -- headers + linking the full libpython. Correct - for *embedding* an interpreter (matches CMake's `Python3::Python`), - needed by naja_edit's embedded-Python mode (task #22). -""" - -def _python_repository_impl(repository_ctx): - python_config = repository_ctx.which("python3-config") - if not python_config: - fail("python3-config not found on PATH; required to locate the " + - "system Python 3 installation for the @python Bazel repository.") - - def run(args): - result = repository_ctx.execute([python_config] + args) - if result.return_code != 0: - fail("{} {} failed (rc={}): {}".format( - python_config, - " ".join(args), - result.return_code, - result.stderr, - )) - return result.stdout.strip() - - includes = run(["--includes"]).split(" ") - include_dirs = [f[2:] for f in includes if f.startswith("-I")] - if not include_dirs: - fail("python3-config --includes returned no -I flags: {}".format(includes)) - - for i, d in enumerate(include_dirs): - repository_ctx.symlink(d, "include{}".format(i)) - - embed_ldflags = run(["--ldflags", "--embed"]).split(" ") - embed_libdirs = [f[2:] for f in embed_ldflags if f.startswith("-L")] - embed_libs = [f[2:] for f in embed_ldflags if f.startswith("-l")] - embed_other = [f for f in embed_ldflags if f and not f.startswith(("-L", "-l"))] - - include_attr = "[{}]".format(", ".join( - ['"include{}"'.format(i) for i in range(len(include_dirs))] - )) - headers_glob = "[{}]".format(", ".join( - ['"include{}/**/*.h"'.format(i) for i in range(len(include_dirs))] - )) - - embed_linkopts = ["-L" + d for d in embed_libdirs] + \ - ["-l" + l for l in embed_libs] + \ - embed_other - - repository_ctx.file( - "BUILD.bazel", - """\ -# Generated by bazel/thirdparty/python/repo.bzl -- do not edit. -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "headers", - hdrs = glob({headers_glob}), - includes = {include_attr}, -) - -cc_library( - name = "embed", - hdrs = glob({headers_glob}), - includes = {include_attr}, - linkopts = {embed_linkopts}, -) -""".format( - headers_glob = headers_glob, - include_attr = include_attr, - embed_linkopts = repr(embed_linkopts), - ), - ) - -python_repository = repository_rule( - implementation = _python_repository_impl, - local = True, - doc = "Wraps the system-installed Python 3, located via python3-config.", -) diff --git a/bazel/thirdparty/slang_host_prefixes.bzl b/bazel/thirdparty/slang_host_prefixes.bzl deleted file mode 100644 index 6cd244902..000000000 --- a/bazel/thirdparty/slang_host_prefixes.bzl +++ /dev/null @@ -1,40 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -"""Computes a CMAKE_PREFIX_PATH so slang's `FetchContent_MakeAvailable` -calls (external/CMakeLists.txt) resolve fmt/tomlplusplus/boost via their -`FIND_PACKAGE_ARGS` fallback to an already-installed system copy, instead -of actually fetching over the network -- which would fail anyway, since -Bazel actions have no network access by default. - -On macOS with Homebrew, packages install to a versioned Cellar path -symlinked from a stable `$(brew --prefix )` -- not automatically on -CMake's default search path, so it must be added explicitly. On Linux, -apt-installed packages (`libfmt-dev`, etc.) already land on CMake's -default system search path, so no prefix is needed there; this rule -simply produces an empty CMAKE_PREFIX_PATH when `brew` isn't present. -""" - -_PACKAGES = ["fmt", "tomlplusplus", "boost"] - -def _host_prefixes_impl(repository_ctx): - brew = repository_ctx.which("brew") - prefixes = [] - if brew: - for pkg in _PACKAGES: - result = repository_ctx.execute([brew, "--prefix", pkg]) - if result.return_code == 0 and result.stdout.strip(): - prefixes.append(result.stdout.strip()) - - repository_ctx.file( - "prefixes.bzl", - 'CMAKE_PREFIX_PATH = "{}"\n'.format(";".join(prefixes)), - ) - repository_ctx.file("BUILD.bazel", "") - -host_prefixes = repository_rule( - implementation = _host_prefixes_impl, - local = True, - doc = "Computes CMAKE_PREFIX_PATH for slang's find_package() fallbacks.", -) diff --git a/bazel/thirdparty/slang_overlay.BUILD b/bazel/thirdparty/slang_overlay.BUILD deleted file mode 100644 index 035b028cc..000000000 --- a/bazel/thirdparty/slang_overlay.BUILD +++ /dev/null @@ -1,161 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -# Overlay BUILD file for the vendored slang repository (fetched via -# git_repository in MODULE.bazel, pinned to the commit recorded in -# internal/bazel-migration-plan.md). This becomes @slang's own root -# BUILD.bazel (via git_repository's `build_file` attribute). -# -# slang has a Python-codegen-driven CMake build (AST/syntax nodes, -# diagnostics generated via CMake custom commands) plus FetchContent for -# fmt/mimalloc/Catch2/Boost.regex/tomlplusplus -- the single highest-risk -# item in this migration (see internal/bazel-migration-plan.md, task -# #14). Rather than hand-porting all of that to native Bazel rules, this -# shells out to slang's own existing CMake build via rules_foreign_cc, -# exactly as originally scoped in the plan's "Recommended approach". -# -# Every FetchContent_Declare in external/CMakeLists.txt uses -# FIND_PACKAGE_ARGS, so FetchContent_MakeAvailable tries find_package() -# first and only actually fetches over the network on failure. On macOS -# with Homebrew this always succeeds (fmt/tomlplusplus/Boost via -# CMAKE_PREFIX_PATH -- bazel/thirdparty/slang_host_prefixes.bzl -- are -# all new enough), so the cmake() action below needs no network access at -# all there, confirmed empirically (Phase 3, task #14). -# -# Linux is a real, separate case, found while drafting Phase 8's CI -# migration (not yet confirmed against a live Ubuntu runner): slang -# requires `fmt >= 12.2` and `tomlplusplus >= 3.4` -# (external/CMakeLists.txt's FIND_PACKAGE_ARGS), but Ubuntu's own apt -# packages are older or partly missing (libfmt-dev is 8.1.1 on 22.04 / -# 9.1.0 on 24.04 -- both below 12.2; libtomlplusplus-dev only exists -# starting 24.04, at exactly 3.4.0). find_package() genuinely fails -# there, so CMake's *actual current* Ubuntu CI behavior already relies on -# FetchContent's real network fetch for fmt/tomlplusplus -- this was true -# before this migration and isn't a regression, but it does mean the -# no-network-needed property validated on macOS does not hold on Linux. -# `tags = ["requires-network"]` grants (not forces) network access to -# this action so the Linux case keeps working exactly like CMake's own -# CI does today; it's a no-op on macOS, where find_package() already -# succeeds and the action never attempts a fetch. - -load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") -load("@slang_host_prefixes//:prefixes.bzl", "CMAKE_PREFIX_PATH") - -filegroup( - name = "all_srcs", - srcs = glob(["**"], exclude = [".git/**"]), -) - -cmake( - name = "slang_foreign", - # Not add_subdirectory'd by anything -- slang's CMakeLists.txt is - # invoked as its own top-level project, so SLANG_MASTER_PROJECT - # auto-detects ON. Explicitly pin every option naja needs OFF back to - # OFF (they'd otherwise default to ON as master-project), matching - # what naja's own thirdparty/CMakeLists.txt configures when it - # add_subdirectory()s slang instead. - cache_entries = { - "SLANG_INCLUDE_TOOLS": "OFF", - "SLANG_INCLUDE_TESTS": "OFF", - "SLANG_INCLUDE_PYLIB": "OFF", - "SLANG_INCLUDE_DOCS": "OFF", - "SLANG_USE_MIMALLOC": "OFF", - "CMAKE_POSITION_INDEPENDENT_CODE": "ON", - # Pin this regardless of Bazel's own -c dbg/opt/fastbuild: without - # it, rules_foreign_cc's cmake_script.bzl defaults CMAKE_BUILD_TYPE - # to "Debug" whenever Bazel's compilation mode is dbg (true for both - # --config=asan and --config=tsan, since both set `-c dbg`). slang's - # own source/CMakeLists.txt has - # `target_compile_definitions(slang_slang PUBLIC - # $<$:SLANG_DEBUG>)`, and SLANG_DEBUG isn't just an - # assertion switch: it adds real data members (BufferID::name, - # SourceLocation::bufferName -- see - # include/slang/text/SourceLocation.h) that change the size/layout - # of SourceLocation, which every slang::ast::Symbol/Type embeds. - # That PUBLIC define is meant to propagate to consumers via CMake's - # own target_link_libraries (and does, when naja's own top-level - # CMakeLists.txt add_subdirectory()s slang directly -- one shared - # CMAKE_BUILD_TYPE, no mismatch possible). But :slang below wraps - # this nested build's prebuilt libsvlang.a in a plain cc_library - # with no `defines`, so Bazel-native consumers (naja_snl_systemverilog_test, - # snlSVConstructorTests, ...) never see SLANG_DEBUG regardless of - # Bazel's own compilation mode. Left to its default, `-c dbg` alone - # would make *this* nested build define SLANG_DEBUG while every - # Bazel-native TU that also includes these same headers does not -- - # two incompatible layouts of the same classes linked into one - # binary. That silently corrupts memory (confirmed via a minimal - # standalone repro outside Bazel/gtest entirely: linking a - # SLANG_DEBUG-built libsvlang.a against a non-SLANG_DEBUG-compiled - # caller reproduces a clean ASan stack-buffer-overflow on the very - # first slang::ast::Compilation constructed), which is what was - # actually behind the "kind == SymbolKind::TypeAlias" assertion - # failures in slang's Type::resolveCanonical() under - # --config=asan/--config=tsan (task #14 follow-up; see - # internal/bazel-migration-plan.md) -- those crashed on every shard, - # even before any TEST_F ran, because it's a static build-config - # mismatch, not anything test-order- or lifetime-dependent. Pinning - # this to RelWithDebInfo keeps debug symbols (useful under - # asan/tsan/gdb) while never satisfying CONFIG:Debug, so SLANG_DEBUG - # stays off here exactly like it does for every Bazel-native - # consumer, regardless of which -c mode Bazel itself is using. - "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "CMAKE_PREFIX_PATH": CMAKE_PREFIX_PATH, - # slang's own CMakeLists.txt unconditionally does - # find_program(CCACHE_EXECUTABLE ccache) and, if found, sets it as - # CMAKE_{C,CXX}_COMPILER_LAUNCHER -- on a host with a system-wide - # ccache install, this makes the build try to write ccache's temp - # dir under $XDG_RUNTIME_DIR (e.g. /run/user//ccache-tmp), - # which is outside Bazel's sandbox and read-only there, failing - # the whole compile. Pre-seeding this cache variable to the - # standard CMake "not found" sentinel makes find_program() treat - # it as already-searched and skip re-detecting ccache, so - # find_package()'s own result (real or not) is never overridden by - # a nonexistent one -- same idiom as any other pre-seeded - # find_program/find_package cache variable. - "CCACHE_EXECUTABLE": "CCACHE_EXECUTABLE-NOTFOUND", - }, - # Belt-and-suspenders for the same ccache issue: if CCACHE_EXECUTABLE - # somehow still resolves (e.g. a future slang version searches - # differently), CCACHE_DISABLE=1 makes ccache itself a transparent - # passthrough to the real compiler -- no cache, no temp dir, so - # nothing to fail to create. - env = { - "CCACHE_DISABLE": "1", - }, - lib_source = ":all_srcs", - out_static_libs = ["libsvlang.a"], - tags = ["requires-network"], -) - -# external/CMakeLists.txt only `install()`s external/boost_unordered.hpp -# and external/boost_concurrent.hpp `if(NOT Boost_FOUND)` -- but -# include/slang/util/{FlatMap,ConcurrentMap}.h (both public, installed -# headers) #include them *unconditionally* regardless of whether real -# Boost was found. Since our build finds a real system Boost (>=1.87) via -# CMAKE_PREFIX_PATH, `cmake()`'s installed include/ tree above is missing -# both files -- a real gap in slang's own CMake packaging, only exposed by -# consuming it through a real install tree (add_subdirectory consumers, -# like naja's own CMake build today, never hit this: their build-interface -# include path always covers external/ regardless of the install() -# conditional). Rather than patching slang's CMakeLists.txt, supplement -# with these two headers directly from source. -cc_library( - name = "slang_boost_shims", - hdrs = [ - "external/boost_unordered.hpp", - "external/boost_concurrent.hpp", - ], - includes = ["external"], -) - -cc_library( - name = "slang", - deps = [ - ":slang_boost_shims", - ":slang_foreign", - "@fmt//:fmt", - "@tomlplusplus//:tomlplusplus", - ], - visibility = ["//visibility:public"], -) diff --git a/bazel/thirdparty/tbb/BUILD.bazel b/bazel/thirdparty/tbb/BUILD.bazel deleted file mode 100644 index 87f8bbe17..000000000 --- a/bazel/thirdparty/tbb/BUILD.bazel +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -# Intentionally empty -- exists only so repo.bzl can be loaded as a repo -# rule (Bazel requires every .bzl file to sit under a package). diff --git a/bazel/thirdparty/tbb/repo.bzl b/bazel/thirdparty/tbb/repo.bzl deleted file mode 100644 index 6db57fc2b..000000000 --- a/bazel/thirdparty/tbb/repo.bzl +++ /dev/null @@ -1,77 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -"""Repository rule wrapping the system-installed oneTBB (TBB has no Bazel -Central Registry module). Locates the existing installation via -pkg-config -- the same TBB that CMake's `find_package(TBB REQUIRED)` -(CMakeLists.txt:121) resolves against, installed by `brew install tbb` on -macOS or the `libtbb-dev` apt package on Linux (see the Phase 0 CI -dependency matrix in internal/bazel-migration-plan.md). This wraps the -prebuilt system library rather than building oneTBB from source under -Bazel, matching how naja already consumes it via CMake. - -Exposes `@tbb//:tbb` and `@tbb//:tbbmalloc`, mirroring the `TBB::tbb` and -`TBB::tbbmalloc` CMake targets linked by src/dnl/CMakeLists.txt. -""" - -_BUILD_TEMPLATE = """\ -# Generated by bazel/thirdparty/tbb/repo.bzl -- do not edit. -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "tbb", - srcs = ["lib/libtbb{shared_library_suffix}"], - hdrs = glob(["include/**/*.h"]), - includes = ["include"], -) - -cc_library( - name = "tbbmalloc", - srcs = ["lib/libtbbmalloc{shared_library_suffix}"], - hdrs = glob(["include/**/*.h"]), - includes = ["include"], -) -""" - -def _tbb_repository_impl(repository_ctx): - pkgconfig = repository_ctx.which("pkg-config") - if not pkgconfig: - fail("pkg-config not found on PATH; required to locate the system " + - "TBB (oneTBB) installation for the @tbb Bazel repository.") - - def pkgconfig_var(var): - result = repository_ctx.execute([pkgconfig, "--variable=" + var, "tbb"]) - if result.return_code != 0 or not result.stdout.strip(): - fail("pkg-config --variable={} tbb failed (rc={}): {}\n".format( - var, - result.return_code, - result.stderr, - ) + "Is TBB installed? (brew install tbb / apt install libtbb-dev)") - return result.stdout.strip() - - includedir = pkgconfig_var("includedir") - libdir = pkgconfig_var("libdir") - - # Symlink only the two subdirectories oneTBB actually ships (the - # compatibility `tbb/*.h` shims and the real `oneapi/tbb/*.h` - # implementation the shims forward to via "../oneapi/tbb/..."). - # Symlinking the whole includedir (e.g. /usr/include) instead would - # expose every other system header -- including an old libgtest-dev - # gtest.h -- as fair game for any `-isystem .../tbb/include` compile, - # silently shadowing Bazel's own fetched @googletest headers. - repository_ctx.symlink(includedir + "/tbb", "include/tbb") - repository_ctx.symlink(includedir + "/oneapi", "include/oneapi") - shared_library_suffix = ".dylib" if repository_ctx.os.name.startswith("mac") else ".so" - repository_ctx.symlink(libdir + "/libtbb" + shared_library_suffix, "lib/libtbb" + shared_library_suffix) - repository_ctx.symlink(libdir + "/libtbbmalloc" + shared_library_suffix, "lib/libtbbmalloc" + shared_library_suffix) - repository_ctx.file( - "BUILD.bazel", - _BUILD_TEMPLATE.format(shared_library_suffix = shared_library_suffix), - ) - -tbb_repository = repository_rule( - implementation = _tbb_repository_impl, - local = True, - doc = "Wraps the system-installed oneTBB, located via pkg-config.", -) diff --git a/bazel/thirdparty/tomlplusplus_overlay.BUILD b/bazel/thirdparty/tomlplusplus_overlay.BUILD deleted file mode 100644 index 6701f9f0e..000000000 --- a/bazel/thirdparty/tomlplusplus_overlay.BUILD +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -# Overlay BUILD file for the vendored tomlplusplus repository (fetched -# via git_repository in MODULE.bazel, pinned to the v3.4.0 tag's commit -# -- matching the exact version thirdparty/slang/external/CMakeLists.txt -# requires: `FIND_PACKAGE_ARGS 3.4`). -# -# Superseded the earlier pkg-config-based bazel/thirdparty/tomlplusplus/repo.bzl -# after live Ubuntu CI showed `libtomlplusplus-dev` isn't installable via -# apt there at all (only ships from Ubuntu 24.04, and even then exactly -# at 3.4.0 -- no margin) -- the same brittle-host-package trap this -# migration already avoided for naja-if/naja-verilog/slang by vendoring -# a pinned fetch instead. This is that same fix applied here: no system -# package dependency on any platform. -# -# toml++ is normally header-only (TOML_HEADER_ONLY defaults to 1), but -# @slang//:slang links a *compiled* tomlplusplus (found via Homebrew on -# macOS, itself built non-header-only) -- its own object files reference -# out-of-line symbols like `toml::v3::table::table()` as undefined, -# discovered via a real link error (Phase 6/7). Matching that: this -# vendors the tiny upstream-provided single-TU implementation file -# (src/toml.cpp, self-contained -- it `#define`s TOML_IMPLEMENTATION and -# TOML_HEADER_ONLY 0 itself if not already set) as a real compiled -# cc_library, so `-ltomlplusplus`-equivalent symbols exist regardless of -# what any given platform's system package manager ships. - -cc_library( - name = "tomlplusplus", - srcs = ["src/toml.cpp"], - hdrs = glob(["include/toml++/**"]), - includes = ["include"], - visibility = ["//visibility:public"], -) diff --git a/bazel/workspace_root.bzl b/bazel/workspace_root.bzl deleted file mode 100644 index 8fa8f1560..000000000 --- a/bazel/workspace_root.bzl +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -"""Repository rule exposing the absolute workspace root path. - -Needed only for tests that change the process's current working -directory mid-test (e.g. testing "resolve this path relative to CWD" -behavior) and therefore can't rely on a workspace-relative `-D` path -define the way most other ported tests do (see e.g. -test/nl/formats/verilog/frontend/BUILD.bazel) -- once CWD moves, a -relative define no longer resolves. CMake sidesteps this for free since -CMAKE_CURRENT_SOURCE_DIR is already absolute; this replicates that exact -same non-hermetic (build-machine-specific path baked at build time) -behavior deliberately, rather than leaving such tests broken. - -Currently only test/nl/formats/systemverilog/frontend/BUILD.bazel (for -SNLSVConstructorTestSimple.cpp's -parseSimpleModuleUsesDefaultDiagnosticsReportPath, the one test in the -whole ported suite that calls std::filesystem::current_path() to change -CWD) needs this. -""" - -def _workspace_root_impl(repository_ctx): - repository_ctx.file( - "workspace_root.bzl", - 'WORKSPACE_ROOT = "{}"\n'.format(repository_ctx.workspace_root), - ) - repository_ctx.file("BUILD.bazel", "") - -workspace_root = repository_rule( - implementation = _workspace_root_impl, - local = True, - doc = "Exposes the absolute workspace root path as a Starlark constant.", -) diff --git a/ci/check_submodule_bazel_sync.py b/ci/check_submodule_bazel_sync.py index 93c6f485d..100bc1d99 100755 --- a/ci/check_submodule_bazel_sync.py +++ b/ci/check_submodule_bazel_sync.py @@ -3,14 +3,15 @@ # # SPDX-License-Identifier: Apache-2.0 -"""Checks that CMake's git submodule pins and Bazel's MODULE.bazel pins -for the same upstream dependency haven't silently drifted apart. +"""Checks that CMake's git submodule pins and Bazel's pins for the same +upstream dependency haven't silently drifted apart. Naja is built by two independent build systems (CMake, the primary one, and Bazel, kept as a validated smoke test via ubuntu-bazel.yml/ macos-bazel.yml). Each pins its own copy of shared dependencies -- CMake via .gitmodules/git submodule commits under thirdparty/, Bazel via -MODULE.bazel's git_override()/git_repository() commits. Nothing forces +the commit archive that MODULE.bazel's bazel_dep version resolves to in +the in-tree registry (bazel/registry/modules///source.json). Nothing forces these to move together, so bumping one without the other is an easy, silent way for the two build systems to end up testing different upstream code without anyone noticing. @@ -22,13 +23,15 @@ contain (be a descendant of, or equal to) the submodule pin" instead, i.e. bazel-support must never fall behind main. naja-verilog's own `bazel-support` branch was merged into `main` (2026), so it's now -checked for an exact match like cpptrace and slang, all three tracking -one branch instead of two. googletest is deliberately excluded: CMake +checked for an exact match like slang, both tracking one branch instead +of two. cpptrace is not a Bazel dependency at all (naja's use of it is +commented out), so there is nothing to compare. googletest is deliberately excluded: CMake pins an old submodule dev commit while Bazel takes a BCR release (1.17.0.bcr.2) -- a different dependency-sourcing mechanism entirely, not something meant to track in lockstep. """ +import json import re import subprocess import sys @@ -36,13 +39,13 @@ REPO_ROOT = Path(__file__).resolve().parent.parent MODULE_BAZEL = REPO_ROOT / "MODULE.bazel" +REGISTRY_MODULES = REPO_ROOT / "bazel" / "registry" / "modules" -# path under thirdparty/ -> (bazel module/repo name, upstream remote, mode) +# path under thirdparty/ -> (bazel module name, upstream remote, mode) # mode is "exact" (commits must match) or "ancestor" (submodule commit must -# be an ancestor of, or equal to, the MODULE.bazel commit). +# be an ancestor of, or equal to, the Bazel commit). SYNC_SPECS = { - "thirdparty/cpptrace": ("cpptrace", "https://github.com/jeremy-rifkin/cpptrace", "exact"), - "thirdparty/slang": ("slang", "https://github.com/MikePopoloski/slang", "exact"), + "thirdparty/slang": ("sv-lang", "https://github.com/MikePopoloski/slang", "exact"), "thirdparty/naja-if": ("naja-if", "https://github.com/najaeda/naja-if", "ancestor"), "thirdparty/naja-verilog": ("naja-verilog", "https://github.com/najaeda/naja-verilog", "exact"), } @@ -66,12 +69,16 @@ def submodule_commit(path: str) -> str: def module_bazel_commits() -> dict[str, str]: text = MODULE_BAZEL.read_text() commits = {} - for block in re.finditer(r"git_(?:override|repository)\(([^)]*)\)", text, re.DOTALL): - body = block.group(1) - name_match = re.search(r'(?:module_name|name)\s*=\s*"([^"]+)"', body) - commit_match = re.search(r'commit\s*=\s*"([^"]+)"', body) - if name_match and commit_match: - commits[name_match.group(1)] = commit_match.group(1) + for name, version in re.findall( + r'bazel_dep\(name = "([^"]+)", version = "([^"]+)"', text + ): + source = REGISTRY_MODULES / name / version / "source.json" + if not source.is_file(): + continue # served by BCR, not pinned to a commit here + url = json.loads(source.read_text())["url"] + commit_match = re.search(r"/archive/([0-9a-f]{40})\.tar\.gz$", url) + if commit_match: + commits[name] = commit_match.group(1) return commits @@ -106,8 +113,8 @@ def main() -> int: bazel_commit = bazel_commits.get(bazel_name) if bazel_commit is None: failures.append( - f"{path}: no git_override/git_repository commit found for " - f"'{bazel_name}' in MODULE.bazel" + f"{path}: no commit archive found for '{bazel_name}' in " + "bazel/registry for the version MODULE.bazel depends on" ) continue @@ -130,7 +137,7 @@ def main() -> int: f"{path}: MODULE.bazel '{bazel_name}' pin {bazel_commit} does " f"NOT contain submodule pin {sub_commit} -- the bazel-support " "branch has fallen behind the commit CMake tracks. Rebase/" - "update bazel-support and re-pin MODULE.bazel's commit." + "update bazel-support and add a registry version for it." ) else: raise AssertionError(f"unknown sync mode {mode!r}") diff --git a/src/apps/naja_edit/BUILD.bazel b/src/apps/naja_edit/BUILD.bazel index 17ad0847e..12a03f696 100644 --- a/src/apps/naja_edit/BUILD.bazel +++ b/src/apps/naja_edit/BUILD.bazel @@ -31,6 +31,5 @@ cc_binary( "//src/nl/python/pyloader:naja_snl_pyloader", "//src/optimization:naja_opt", "//thirdparty/argparse-3.1:argparse", - "@boost//:headers", ], ) diff --git a/src/bne/BUILD.bazel b/src/bne/BUILD.bazel index ddd9426b7..b0184ae9d 100644 --- a/src/bne/BUILD.bazel +++ b/src/bne/BUILD.bazel @@ -27,7 +27,6 @@ cc_library( visibility = ["//visibility:public"], deps = [ "//src/dnl:naja_dnl", - "//thirdparty/spdlog-1.17.0:spdlog", - "@boost//:headers", + "@spdlog", ], ) diff --git a/src/core/BUILD.bazel b/src/core/BUILD.bazel index 5436f0537..daa353dfd 100644 --- a/src/core/BUILD.bazel +++ b/src/core/BUILD.bazel @@ -13,13 +13,13 @@ # defined anywhere in the CMake tree (a no-op variable expansion) -- # neither is ported either. -load("@naja_git_version//:git_version.bzl", "NAJA_GIT_HASH") +load(":naja_version.bzl", "naja_git_hash") genrule( name = "naja_version_h", srcs = ["NajaVersion.h.in"], outs = ["NajaVersion.h"], - cmd = "sed 's/@NAJA_GIT_HASH@/%s/' $< > $@" % NAJA_GIT_HASH, + cmd = "sed 's/@NAJA_GIT_HASH@/%s/' $< > $@" % naja_git_hash(), ) cc_library( @@ -48,7 +48,7 @@ cc_library( includes = ["."], visibility = ["//visibility:public"], deps = [ - "//thirdparty/spdlog-1.17.0:spdlog", - "@boost//:headers", + "@spdlog", + "@boost.intrusive", ], ) diff --git a/src/core/naja_version.bzl b/src/core/naja_version.bzl new file mode 100644 index 000000000..5554d3468 --- /dev/null +++ b/src/core/naja_version.bzl @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2023 The Naja authors +# +# SPDX-License-Identifier: Apache-2.0 + +"""Git hash compiled into NajaVersion.h (CMake runs `git log` instead).""" + +def naja_git_hash(): + """Returns the commit a registry version of naja was built from. + + Registry entries for unreleased commits use BCR's + `--` version scheme, so the hash is the + last component. Anything else (a release, or naja as the root + module) reports "unknown". Must be called from a BUILD file. + """ + parts = native.module_version().split("-") + if len(parts) == 3: + return parts[2] + return "unknown" diff --git a/src/dnl/BUILD.bazel b/src/dnl/BUILD.bazel index 662220612..c9dc4ca2c 100644 --- a/src/dnl/BUILD.bazel +++ b/src/dnl/BUILD.bazel @@ -21,8 +21,7 @@ cc_library( visibility = ["//visibility:public"], deps = [ "//src/nl/netlist:naja_nl", - "@boost//:headers", - "@tbb//:tbb", - "@tbb//:tbbmalloc", + "@onetbb//:tbb", + "@onetbb//:tbbmalloc", ], ) diff --git a/src/metrics/BUILD.bazel b/src/metrics/BUILD.bazel index f7816a4e9..a6875c878 100644 --- a/src/metrics/BUILD.bazel +++ b/src/metrics/BUILD.bazel @@ -26,7 +26,6 @@ cc_library( deps = [ "//src/bne:naja_bne", "//src/dnl:naja_dnl", - "//thirdparty/spdlog-1.17.0:spdlog", - "@boost//:headers", + "@spdlog", ], ) diff --git a/src/najaeda/examples/BUILD.bazel b/src/najaeda/examples/BUILD.bazel index 221eca895..de2b47ab0 100644 --- a/src/najaeda/examples/BUILD.bazel +++ b/src/najaeda/examples/BUILD.bazel @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 +load("@rules_shell//shell:sh_test.bzl", "sh_test") + # Bazel equivalent of .github/workflows/najaeda-examples.yml: runs # run_regress.py, which walks its own cwd's immediate subdirectories and # executes every *.py example script in each (task #28). @@ -21,16 +23,17 @@ sh_test( "src/najaeda/najaeda", "$(rootpath //src/nl/python/naja_wrapping:naja.so)", "$(rootpath //src/nl/python/naja_wrapping:naja_runtime)", - "$(rootpath @python3_tool//:python3)", + "$(PYTHON3_ROOTPATH)", "src/najaeda/examples", ], + toolchains = ["@rules_python//python:current_py_toolchain"], data = [ ":examples_sources", "//src/najaeda/benchmarks", "//src/najaeda/najaeda:sources", "//src/nl/python/naja_wrapping:naja.so", "//src/nl/python/naja_wrapping:naja_runtime", - "@python3_tool//:python3", + "@rules_python//python:current_py_toolchain", ], # Not gtest/ctest-shaped output; run_regress.py's own logging is the # useful signal, and each example script can take a few seconds diff --git a/src/nl/formats/lefdef/BUILD.bazel b/src/nl/formats/lefdef/BUILD.bazel index 8fcd33b1c..16a2dfc77 100644 --- a/src/nl/formats/lefdef/BUILD.bazel +++ b/src/nl/formats/lefdef/BUILD.bazel @@ -29,7 +29,6 @@ cc_library( "//src/nl/netlist:naja_nl", "//thirdparty/lefdef/src/def/def:def", "//thirdparty/lefdef/src/lef/lef:lef", - "//thirdparty/spdlog-1.17.0:spdlog", - "@boost//:headers", + "@spdlog", ], ) diff --git a/src/nl/formats/systemverilog/BUILD.bazel b/src/nl/formats/systemverilog/BUILD.bazel index 33d54ca11..658352959 100644 --- a/src/nl/formats/systemverilog/BUILD.bazel +++ b/src/nl/formats/systemverilog/BUILD.bazel @@ -25,7 +25,7 @@ _DEPS = [ "//src/nl/formats/hdl:naja_snl_hdl", "//src/core:naja_core", "//src/nl/netlist:naja_nl", - "@slang//:slang", + "@sv-lang//:libsvlang", ] cc_library( diff --git a/src/nl/formats/verilog/BUILD.bazel b/src/nl/formats/verilog/BUILD.bazel index 0953a8602..cd3d96b6c 100644 --- a/src/nl/formats/verilog/BUILD.bazel +++ b/src/nl/formats/verilog/BUILD.bazel @@ -26,6 +26,7 @@ cc_library( deps = [ "//src/core:naja_core", "//src/nl/netlist:naja_nl", + "@boost.dynamic_bitset", "@naja-verilog//:naja_verilog", ], ) diff --git a/src/nl/formats/vhdl/BUILD.bazel b/src/nl/formats/vhdl/BUILD.bazel index 4e657d9a5..dce7fed5c 100644 --- a/src/nl/formats/vhdl/BUILD.bazel +++ b/src/nl/formats/vhdl/BUILD.bazel @@ -11,5 +11,6 @@ cc_library( "//src/nl/formats/hdl:naja_snl_hdl", "//src/nl/netlist:naja_nl", "//src/vhdl:vhdl_frontend", + "@boost.multiprecision", ], ) diff --git a/src/nl/netlist/BUILD.bazel b/src/nl/netlist/BUILD.bazel index 69c04844e..e5cca43fd 100644 --- a/src/nl/netlist/BUILD.bazel +++ b/src/nl/netlist/BUILD.bazel @@ -79,8 +79,8 @@ cc_library( visibility = ["//visibility:public"], deps = [ "//src/core:naja_core", - "//thirdparty/spdlog-1.17.0:spdlog", - "@boost//:headers", + "@spdlog", + "@boost.intrusive", ], ) diff --git a/src/nl/netlist/serialization/capnp/BUILD.bazel b/src/nl/netlist/serialization/capnp/BUILD.bazel index dcdfd7eff..92413bd5f 100644 --- a/src/nl/netlist/serialization/capnp/BUILD.bazel +++ b/src/nl/netlist/serialization/capnp/BUILD.bazel @@ -35,6 +35,7 @@ cc_library( deps = [ "//src/core:naja_core", "//src/nl/netlist:naja_nl", + "@boost.asio", "@naja-if//:naja_common_capnp", "@naja-if//:naja_nl_implementation_capnp", "@naja-if//:naja_nl_interface_capnp", diff --git a/src/nl/python/naja_wrapping/BUILD.bazel b/src/nl/python/naja_wrapping/BUILD.bazel index fa8f67fff..4f73c5bb7 100644 --- a/src/nl/python/naja_wrapping/BUILD.bazel +++ b/src/nl/python/naja_wrapping/BUILD.bazel @@ -10,11 +10,11 @@ load("@rules_cc//cc:cc_shared_library.bzl", "cc_shared_library") # internal/bazel-migration-plan.md (Phase 6, task #21). # # CMake links naja_python against Python3::Module (this Bazel build's -# equivalent, @python//:headers -- no libpython linking, symbols resolve +# equivalent, @rules_python//python/cc:current_py_cc_headers -- no libpython linking, symbols resolve # dynamically at import time) or Python3::Python (Python3::Embed -# equivalent, @python//:embed) depending on BUILD_NAJA_PYTHON. This +# equivalent, @rules_python//python/cc:current_py_cc_libs) depending on BUILD_NAJA_PYTHON. This # target is the Module/extension-module case; naja_edit's embedded mode -# (task #22) needs its own copy linked against @python//:embed instead, +# (task #22) needs its own copy linked against @rules_python//python/cc:current_py_cc_libs instead, # since a single cc_library can't conditionally pick either at build # time the way CMake's option toggle does. @@ -90,7 +90,7 @@ cc_library( "//src/nl/netlist:naja_snl_visual", "//src/nl/netlist/serialization/capnp:naja_nl_dump", "//src/optimization:naja_opt", - "@python//:headers", + "@rules_python//python/cc:current_py_cc_headers", ], ) @@ -134,7 +134,7 @@ cc_binary( # mach-o type) -- CPython's dlopen()-based import also accepts a # plain dylib on modern macOS, so only -undefined dynamic_lookup # (letting Python API symbols resolve at import time, since this - # target links no libpython -- see @python//:headers) is needed. + # target links no libpython -- see @rules_python//python/cc:current_py_cc_headers) is needed. "@platforms//os:macos": ["-undefined", "dynamic_lookup"], "//conditions:default": [], }), @@ -142,6 +142,6 @@ cc_binary( visibility = ["//visibility:public"], deps = [ ":naja_python", - "@python//:headers", + "@rules_python//python/cc:current_py_cc_headers", ], ) diff --git a/src/nl/python/pyloader/BUILD.bazel b/src/nl/python/pyloader/BUILD.bazel index 6440a316f..d036a8e2e 100644 --- a/src/nl/python/pyloader/BUILD.bazel +++ b/src/nl/python/pyloader/BUILD.bazel @@ -6,7 +6,8 @@ # See internal/bazel-migration-plan.md (Phase 6, task #21). CMake links # this PUBLIC against naja_python, which itself defaults to the embedded # (Python3::Python) case (see -# src/nl/python/naja_wrapping/CMakeLists.txt's if/else) -- @python//:embed +# src/nl/python/naja_wrapping/CMakeLists.txt's if/else) -- libpython +# (@rules_python//python/cc:current_py_cc_libs) # is added directly here for the same reason as # test/nl/python/naja_wrapping/BUILD.bazel's najaPythonPropertyTests # (a real executable consumer needs a fully linked libpython; a @@ -25,6 +26,6 @@ cc_library( deps = [ "//src/nl/netlist:naja_nl", "//src/nl/python/naja_wrapping:naja_python", - "@python//:embed", + "@rules_python//python/cc:current_py_cc_libs", ], ) diff --git a/src/optimization/BUILD.bazel b/src/optimization/BUILD.bazel index b2759ae85..e47dfbe7a 100644 --- a/src/optimization/BUILD.bazel +++ b/src/optimization/BUILD.bazel @@ -28,7 +28,6 @@ cc_library( deps = [ "//src/bne:naja_bne", "//src/dnl:naja_dnl", - "//thirdparty/spdlog-1.17.0:spdlog", - "@boost//:headers", + "@spdlog", ], ) diff --git a/test/najaeda/BUILD.bazel b/test/najaeda/BUILD.bazel index e803c182c..f3c6d6578 100644 --- a/test/najaeda/BUILD.bazel +++ b/test/najaeda/BUILD.bazel @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 +load("@rules_shell//shell:sh_test.bzl", "sh_test") + # Bazel equivalent of this directory's CMakeLists.txt: replicates # setup_test_env.cmake's copy-najaeda-sources + symlink-naja.so-in-place # dance inside run_najaeda_tests.sh, since a Bazel sh_test's sandbox has @@ -28,12 +30,13 @@ sh_test( "src/najaeda/najaeda", "$(rootpath //src/nl/python/naja_wrapping:naja.so)", "$(rootpath //src/nl/python/naja_wrapping:naja_runtime)", - "$(rootpath @python3_tool//:python3)", + "$(PYTHON3_ROOTPATH)", "test/najaeda", "test/nl/formats/verilog/benchmarks", "test/nl/formats/systemverilog/benchmarks", "test/nl/formats/liberty/benchmarks", ], + toolchains = ["@rules_python//python:current_py_toolchain"], data = [ ":test_sources", "//src/najaeda/najaeda:sources", @@ -42,6 +45,6 @@ sh_test( "//test/nl/formats/liberty:benchmarks", "//test/nl/formats/systemverilog:benchmarks", "//test/nl/formats/verilog:benchmarks", - "@python3_tool//:python3", + "@rules_python//python:current_py_toolchain", ], ) diff --git a/test/nl/formats/liberty/BUILD.bazel b/test/nl/formats/liberty/BUILD.bazel index 6d4ee1c2c..17ab4adb2 100644 --- a/test/nl/formats/liberty/BUILD.bazel +++ b/test/nl/formats/liberty/BUILD.bazel @@ -16,6 +16,13 @@ filegroup( visibility = ["//test:__subpackages__"], ) +# A Liberty library with scan flip-flops, reused by downstream test +# suites (kepler-formal). +exports_files( + ["benchmarks/tests/FF_scan.lib"], + visibility = ["//visibility:public"], +) + cc_test( name = "snl_liberty_tests", srcs = [ diff --git a/test/nl/formats/systemverilog/frontend/BUILD.bazel b/test/nl/formats/systemverilog/frontend/BUILD.bazel index 04b03b5f0..a048ff05b 100644 --- a/test/nl/formats/systemverilog/frontend/BUILD.bazel +++ b/test/nl/formats/systemverilog/frontend/BUILD.bazel @@ -3,15 +3,10 @@ # SPDX-License-Identifier: Apache-2.0 # Same workspace-relative-path + data pattern as -# test/nl/formats/verilog/frontend/BUILD.bazel, except -# SNL_SV_BENCHMARKS_PATH must be absolute here: SNLSVConstructorTestSimple.cpp's -# parseSimpleModuleUsesDefaultDiagnosticsReportPath calls -# std::filesystem::current_path() to change CWD mid-test, which a -# workspace-relative define wouldn't survive (see bazel/workspace_root.bzl). +# test/nl/formats/verilog/frontend/BUILD.bazel. # ENABLE_SV_CONSTRUCTOR_PERF_REPORT defaults OFF in CMake; not wired up # here either. -load("@naja_workspace_root//:workspace_root.bzl", "WORKSPACE_ROOT") cc_test( name = "snlSVConstructorTests", @@ -26,7 +21,7 @@ cc_test( copts = ["-std=c++20"], data = ["//test/nl/formats/systemverilog:benchmarks"], defines = [ - 'SNL_SV_BENCHMARKS_PATH=\\"%s/test/nl/formats/systemverilog/benchmarks\\"' % WORKSPACE_ROOT, + 'SNL_SV_BENCHMARKS_PATH=\\"test/nl/formats/systemverilog/benchmarks\\"', 'SNL_SV_DUMPER_TEST_PATH=\\".\\"', ], deps = [ diff --git a/test/nl/formats/systemverilog/frontend/SNLSVConstructorTestSimple.cpp b/test/nl/formats/systemverilog/frontend/SNLSVConstructorTestSimple.cpp index bbb057ccc..cb222cf70 100644 --- a/test/nl/formats/systemverilog/frontend/SNLSVConstructorTestSimple.cpp +++ b/test/nl/formats/systemverilog/frontend/SNLSVConstructorTestSimple.cpp @@ -34253,6 +34253,10 @@ TEST_F(SNLSVConstructorTestSimple, parseSimpleModuleUsesDefaultDiagnosticsReport std::filesystem::remove_all(outPath); } std::filesystem::create_directory(outPath); + // Resolve before changing the current directory: the benchmarks path + // may be relative. + const auto benchmarksPath = + std::filesystem::absolute(SNL_SV_BENCHMARKS_PATH); const ScopedCurrentPath scopedCurrentPath(outPath); const auto reportPath = std::filesystem::current_path() / *options.diagnosticsReportPath; @@ -34260,7 +34264,6 @@ TEST_F(SNLSVConstructorTestSimple, parseSimpleModuleUsesDefaultDiagnosticsReport std::filesystem::remove(reportPath, ec); SNLSVConstructor constructor(library_); - const std::filesystem::path benchmarksPath(SNL_SV_BENCHMARKS_PATH); constructor.construct(benchmarksPath / "simple" / "simple.sv"); ASSERT_TRUE(std::filesystem::exists(reportPath)); @@ -34280,10 +34283,13 @@ TEST_F(SNLSVConstructorTestSimple, parseSimpleModuleCanDisableDiagnosticsReport) std::filesystem::remove_all(outPath); } std::filesystem::create_directory(outPath); + // Resolve before changing the current directory: the benchmarks path + // may be relative. + const auto benchmarksPath = + std::filesystem::absolute(SNL_SV_BENCHMARKS_PATH); const ScopedCurrentPath scopedCurrentPath(outPath); SNLSVConstructor constructor(library_); - const std::filesystem::path benchmarksPath(SNL_SV_BENCHMARKS_PATH); EXPECT_NO_THROW(constructor.construct(benchmarksPath / "simple" / "simple.sv", options)); EXPECT_FALSE(std::filesystem::exists(outPath / "naja_sv_diagnostics.log")); } diff --git a/test/nl/python/naja_wrapping/BUILD.bazel b/test/nl/python/naja_wrapping/BUILD.bazel index ca7b78fea..cc08dd56d 100644 --- a/test/nl/python/naja_wrapping/BUILD.bazel +++ b/test/nl/python/naja_wrapping/BUILD.bazel @@ -9,11 +9,11 @@ # najaPythonPropertyTests is a plain C++ executable (not a Python-loaded # extension), so unlike naja.so it can't defer Python API symbol # resolution to a running interpreter via -undefined dynamic_lookup -- -# it needs a real, fully linked libpython, i.e. @python//:embed (matching +# it needs a real, fully linked libpython, i.e. @rules_python//python/cc:current_py_cc_libs (matching # CMake's default, non-BUILD_NAJA_PYTHON `Python3::Python` linkage for # naja_python -- see src/nl/python/naja_wrapping/CMakeLists.txt's -# if/else). @python//:headers (naja_python's own dep, for compiling -# against Python.h) doesn't provide that; adding @python//:embed directly +# if/else). @rules_python//python/cc:current_py_cc_headers (naja_python's own dep, for compiling +# against Python.h) doesn't provide that; adding @rules_python//python/cc:current_py_cc_libs directly # here supplies the missing linkopts at final-link time without needing # a second, embed-linked copy of the whole naja_python library. @@ -23,6 +23,6 @@ cc_test( deps = [ "//src/nl/python/naja_wrapping:naja_python", "@googletest//:gtest_main", - "@python//:embed", + "@rules_python//python/cc:current_py_cc_libs", ], ) diff --git a/thirdparty/lefdef/src/def/def/BUILD.bazel b/thirdparty/lefdef/src/def/def/BUILD.bazel index 8802449d6..ac3abdbfa 100644 --- a/thirdparty/lefdef/src/def/def/BUILD.bazel +++ b/thirdparty/lefdef/src/def/def/BUILD.bazel @@ -4,17 +4,24 @@ # Mirrors this directory's own CMakeLists.txt: builds the `def` static # library naja actually links (src/nl/formats/lefdef/CMakeLists.txt). -# See internal/bazel-migration-plan.md (task #13) and -# bazel/lefdef_bison.bzl for why def.tab.h is treated as an ordinary -# checked-in header (not generated) here, unlike lef.tab.h in -# ../../lef/lef. +# def.tab.h is an ordinary checked-in header here (not generated), +# unlike lef.tab.h in ../../lef/lef. -load("//bazel:lefdef_bison.bzl", "lefdef_bison_parser") +load("@bison//:bison.bzl", "bison") -lefdef_bison_parser( +# No --defines: def/def/*.cpp include the checked-in def.tab.h instead, +# matching CMake's BISON_TARGET, which names no DEFINES_FILE. +bison( name = "def_parser", - src = "def.y", - name_prefix = "defyy", + srcs = ["def.y"], + outs = ["def_parser.cpp"], + args = [ + "-Wconflicts-sr", + "-p", + "defyy", + "--output=$(execpath def_parser.cpp)", + "$(execpath def.y)", + ], ) cc_library( diff --git a/thirdparty/lefdef/src/lef/lef/BUILD.bazel b/thirdparty/lefdef/src/lef/lef/BUILD.bazel index b30b6e75f..1b4a121cd 100644 --- a/thirdparty/lefdef/src/lef/lef/BUILD.bazel +++ b/thirdparty/lefdef/src/lef/lef/BUILD.bazel @@ -4,17 +4,28 @@ # Mirrors this directory's own CMakeLists.txt: builds the `lef` static # library naja actually links (src/nl/formats/lefdef/CMakeLists.txt). -# See internal/bazel-migration-plan.md (task #13) and -# bazel/lefdef_bison.bzl for why lef.tab.h is freshly generated here but -# def (in ../../def/def) uses an already-checked-in def.tab.h instead. +# lef.tab.h is generated here, whereas def (in ../../def/def) uses a +# checked-in def.tab.h. -load("//bazel:lefdef_bison.bzl", "lefdef_bison_parser") +load("@bison//:bison.bzl", "bison") -lefdef_bison_parser( +# -p lefyy keeps yyparse/yylex from colliding with the def parser. +bison( name = "lef_parser", - src = "lef.y", - name_prefix = "lefyy", - hdr_out = "lef.tab.h", + srcs = ["lef.y"], + outs = [ + "lef_parser.cpp", + "lef.tab.h", + ], + args = [ + "-Wconflicts-sr", + "-p", + "lefyy", + "--output=$(execpath lef_parser.cpp)", + "-d", + "--defines=$(execpath lef.tab.h)", + "$(execpath lef.y)", + ], ) cc_library( diff --git a/thirdparty/spdlog-1.17.0/BUILD.bazel b/thirdparty/spdlog-1.17.0/BUILD.bazel deleted file mode 100644 index 7107b863e..000000000 --- a/thirdparty/spdlog-1.17.0/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: 2023 The Naja authors -# -# SPDX-License-Identifier: Apache-2.0 - -# Vendored directly in this repo (not a submodule). naja only ever uses -# it header-only (CMakeLists.txt:67 sets SPDLOG_DIR to this include/ dir -# as a plain include path, no compiled spdlog sources are added to any -# target), so this is just a header-only cc_library. - -cc_library( - name = "spdlog", - hdrs = glob(["include/**/*.h"]), - includes = ["include"], - visibility = ["//visibility:public"], -) From a0aa699c3cdab203af0d89bf6e23a9ba480a3609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 2 Oct 2026 08:39:28 +0200 Subject: [PATCH 02/11] bazel: export TBB and zlib from naja_runtime Binaries that link naja_runtime and also depend on TBB or zlib themselves (kepler-formal) must use the runtime's single statically linked copy; cc_shared_library refuses to link them twice. Match by package, since BCR zlib's target behind @zlib//:z is in a subpackage. Co-Authored-By: Claude Opus 5.5 --- src/nl/python/naja_wrapping/BUILD.bazel | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nl/python/naja_wrapping/BUILD.bazel b/src/nl/python/naja_wrapping/BUILD.bazel index 4f73c5bb7..8ae7c517e 100644 --- a/src/nl/python/naja_wrapping/BUILD.bazel +++ b/src/nl/python/naja_wrapping/BUILD.bazel @@ -112,10 +112,15 @@ cc_shared_library( "//src/nl/netlist/serialization/capnp:naja_nl_dump", "//src/optimization:naja_opt", ], + # The runtime links these statically and exports them, so that + # binaries linking it (naja.so, kepler-formal) use its single copy + # instead of linking their own. Package patterns rather than target + # labels: zlib's BCR target behind @zlib//:z lives in a subpackage. exports_filter = [ "//src:__subpackages__", - "@fmt//:fmt", - "@zlib//:z", + "@fmt//:__subpackages__", + "@onetbb//:__subpackages__", + "@zlib//:__subpackages__", ], user_link_flags = select({ "@platforms//os:macos": ["-undefined", "dynamic_lookup"], From d38a33770ccc058b46d30d916d6622b4e47e598d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 2 Oct 2026 08:40:52 +0200 Subject: [PATCH 03/11] bazel: sv-lang registry entry depends on boost.regex slang's WaiverManager uses boost::regex header-only; with the host toolchain it was silently picked up from /usr/include. Co-Authored-By: Claude Opus 5.5 --- .../modules/sv-lang/11.0.0-20260701-b60d729d/MODULE.bazel | 1 + .../sv-lang/11.0.0-20260701-b60d729d/overlay/BUILD.bazel | 1 + .../modules/sv-lang/11.0.0-20260701-b60d729d/source.json | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/MODULE.bazel b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/MODULE.bazel index 864e91f27..4c4b38779 100644 --- a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/MODULE.bazel +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/MODULE.bazel @@ -9,6 +9,7 @@ module( bazel_dep(name = "aspect_bazel_lib", version = "2.21.2") bazel_dep(name = "aspect_rules_py", version = "1.8.4") bazel_dep(name = "bazel_skylib", version = "1.8.2") +bazel_dep(name = "boost.regex", version = "1.90.0.bcr.1") bazel_dep(name = "boost.unordered", version = "1.90.0.bcr.1") bazel_dep(name = "fmt", version = "12.2.0") bazel_dep(name = "platforms", version = "1.0.0") diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/BUILD.bazel b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/BUILD.bazel index 7e28a0ba6..599036add 100644 --- a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/BUILD.bazel +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/overlay/BUILD.bazel @@ -297,6 +297,7 @@ cc_library( defines = ["SLANG_USE_THREADS"], deps = [ "//private/slang/export_headers:slang_export_headers", + "@boost.regex", "@boost.unordered", "@fmt", "@tomlplusplus", diff --git a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/source.json b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/source.json index a75a3ff24..dedd8fbc3 100644 --- a/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/source.json +++ b/bazel/registry/modules/sv-lang/11.0.0-20260701-b60d729d/source.json @@ -2,8 +2,8 @@ "url": "https://github.com/MikePopoloski/slang/archive/b60d729d66b9cdeec158b800f898461a138d505e.tar.gz", "integrity": "sha256-qfZVkMz0/yCDtJ8PQ1KqxT5kWLBLLxpl4kgUq6OgW8I=", "overlay": { - "BUILD.bazel": "sha256-CTYEV9RDQYgI5QO1vOS3I0WlP4B/zWB+RjFYW203mh0=", - "MODULE.bazel": "sha256-D+Huzpu3pJUB/Ahf7YSZc6EAzB4aWijLXZnJF+WEUIQ=", + "BUILD.bazel": "sha256-wWVM30POC9+QVIH8Tunwa3n614ZLBGLWYNEAIOntlNg=", + "MODULE.bazel": "sha256-LBlDWQd+McQFO4QE5x0mo4dbPH+UlrUyfPS+aMnf3jg=", "private/slang/export_headers/BUILD.bazel": "sha256-R6Dv/CqeG3BKpy2/F7RraVg/6QpVp9R2+itU1P0jUDE=", "private/tests/BUILD.bazel": "sha256-szGEhrNgI8xYYT3Dh65sYTxtLgzliigBBI327gTzFnE=", "private/tests/pyslang/BUILD.bazel": "sha256-kOhB1jkTVq4BZCuXinob8Em29LMXNLPZWEYUtVZzGfo=", From 7477f25647710e12bedc8498d148be19abfce212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 2 Oct 2026 09:47:46 +0200 Subject: [PATCH 04/11] bazel: build under hermetic toolchains; keep libpython in dynamic links - bison 3.8.2.bcr.10 in the in-tree registry: BCR's bcr.9 with gnulib's wrapper headers on -I rather than -isystem. Toolchains that pass libc headers as -isystem (hermetic-llvm) otherwise shadow them and bison fails to compile. naja and naja-verilog ask for it. - pyloader: re-own libpython's linker inputs. current_py_cc_libs forwards a toolchain target's CcInfo, which cc_binary's dynamic_deps filtering cannot see, so a binary linking naja_runtime dynamically silently dropped libpython. - update_source.py keeps source.json fields it does not compute (mirror_urls, patch_strip). Co-Authored-By: Claude Opus 5.5 --- MODULE.bazel | 2 +- MODULE.bazel.lock | 2 - bazel/registry/README.md | 1 + .../modules/bison/3.8.2.bcr.10/MODULE.bazel | 13 + .../bison/3.8.2.bcr.10/overlay/BUILD.bazel | 1108 +++++++++++++++++ .../bison/3.8.2.bcr.10/overlay/MODULE.bazel | 1 + .../bison/3.8.2.bcr.10/overlay/bison.bzl | 131 ++ .../3.8.2.bcr.10/overlay/examples/BUILD.bazel | 47 + .../overlay/examples/bison_test.bzl | 59 + .../overlay/src/bazel_runfiles.cc | 125 ++ .../3.8.2.bcr.10/patches/bison_runfiles.patch | 29 + .../patches/bison_runfiles_main.patch | 12 + .../3.8.2.bcr.10/patches/rpcalc_stdlib.patch | 10 + .../3.8.2.bcr.10/patches/stdint_comment.patch | 12 + .../patches/string_free_decl.patch | 15 + .../patches/wchar_free_decl.patch | 15 + .../patches/xstrndup_strndup_decl.patch | 17 + .../modules/bison/3.8.2.bcr.10/presubmit.yml | 20 + .../modules/bison/3.8.2.bcr.10/source.json | 27 + bazel/registry/modules/bison/metadata.json | 21 + .../0.0.0-20260909-be6544b1/MODULE.bazel | 2 +- .../0.0.0-20260909-be6544b1/source.json | 2 +- bazel/registry/update_source.py | 9 +- src/nl/python/pyloader/BUILD.bazel | 8 +- src/nl/python/pyloader/python_libs.bzl | 43 + 25 files changed, 1721 insertions(+), 10 deletions(-) create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/MODULE.bazel create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/overlay/BUILD.bazel create mode 120000 bazel/registry/modules/bison/3.8.2.bcr.10/overlay/MODULE.bazel create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/overlay/bison.bzl create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/overlay/examples/BUILD.bazel create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/overlay/examples/bison_test.bzl create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/overlay/src/bazel_runfiles.cc create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/patches/bison_runfiles.patch create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/patches/bison_runfiles_main.patch create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/patches/rpcalc_stdlib.patch create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/patches/stdint_comment.patch create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/patches/string_free_decl.patch create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/patches/wchar_free_decl.patch create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/patches/xstrndup_strndup_decl.patch create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/presubmit.yml create mode 100644 bazel/registry/modules/bison/3.8.2.bcr.10/source.json create mode 100644 bazel/registry/modules/bison/metadata.json create mode 100644 src/nl/python/pyloader/python_libs.bzl diff --git a/MODULE.bazel b/MODULE.bazel index d650c3cb8..53f384557 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -18,7 +18,7 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.9.2") -bazel_dep(name = "bison", version = "3.8.2.bcr.9") +bazel_dep(name = "bison", version = "3.8.2.bcr.10") bazel_dep(name = "boost.asio", version = "1.90.0.bcr.1") bazel_dep(name = "boost.dynamic_bitset", version = "1.90.0.bcr.1") bazel_dep(name = "boost.intrusive", version = "1.90.0.bcr.1") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 202e10f7d..226a0a276 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -71,8 +71,6 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7", "https://bcr.bazel.build/modules/bazel_skylib/1.9.2/MODULE.bazel": "8c51259b0f4481475586dbfede7591e57b75702e637f840f6138eec80c34b270", "https://bcr.bazel.build/modules/bazel_skylib/1.9.2/source.json": "41cbde7546542dee2f26e3f10bf1c4ac57909943194b7ac48cc5238a01893aa8", - "https://bcr.bazel.build/modules/bison/3.8.2.bcr.9/MODULE.bazel": "8b9a90d9c44ac5d7dcc351318b10b075620fc0eed1bb5e9c3030a5a86e46794b", - "https://bcr.bazel.build/modules/bison/3.8.2.bcr.9/source.json": "2a59219a64dca807563bb5d2a5fc108ca6e3351da241d9b1f1526d2ad89df878", "https://bcr.bazel.build/modules/boost.algorithm/1.90.0.bcr.1/MODULE.bazel": "2f3447a25fe67ddefa26d39f1eae65d3035fb6faaa77d39cf7742a8f952ceedb", "https://bcr.bazel.build/modules/boost.algorithm/1.90.0.bcr.1/source.json": "f9c995cf5dc0663827484065fb1e76ec4c7091f84476c1a98fa9a4bcf87bcb8f", "https://bcr.bazel.build/modules/boost.align/1.90.0.bcr.1/MODULE.bazel": "dd81d6e7f9dc036ccc06753bb7670c6505bf0b7fab170e22d1b5b83044ac66e8", diff --git a/bazel/registry/README.md b/bazel/registry/README.md index c63ce96fa..11ce3d528 100644 --- a/bazel/registry/README.md +++ b/bazel/registry/README.md @@ -14,6 +14,7 @@ common --registry=https://bcr.bazel.build/ | `naja-if` | not on BCR | | `naja-verilog` | not on BCR; the overlay uses BCR `bison`/`flex` instead of host tools | | `sv-lang` | BCR has slang `f04e815`; naja is developed against `b60d729` | +| `bison` | `3.8.2.bcr.10` is BCR's `bcr.9` with gnulib's wrapper headers on `-I` instead of `-isystem`, so bison builds with toolchains that pass libc headers as `-isystem` (hermetic-llvm); see BCR PR #9600 | The layout is exactly BCR's (`modules//metadata.json`, `modules///{MODULE.bazel,source.json,presubmit.yml,overlay/,patches/}`), diff --git a/bazel/registry/modules/bison/3.8.2.bcr.10/MODULE.bazel b/bazel/registry/modules/bison/3.8.2.bcr.10/MODULE.bazel new file mode 100644 index 000000000..ffdf008fc --- /dev/null +++ b/bazel/registry/modules/bison/3.8.2.bcr.10/MODULE.bazel @@ -0,0 +1,13 @@ +"""https://www.gnu.org/software/bison/""" + +module( + name = "bison", + version = "3.8.2.bcr.10", + bazel_compatibility = [">=7.2.1"], +) + +bazel_dep(name = "bazel_skylib", version = "1.8.2") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "rules_cc_autoconf", version = "0.19.0") +bazel_dep(name = "rules_cc", version = "0.2.4") +bazel_dep(name = "m4", version = "1.4.21.bcr.4") diff --git a/bazel/registry/modules/bison/3.8.2.bcr.10/overlay/BUILD.bazel b/bazel/registry/modules/bison/3.8.2.bcr.10/overlay/BUILD.bazel new file mode 100644 index 000000000..2d6016ab8 --- /dev/null +++ b/bazel/registry/modules/bison/3.8.2.bcr.10/overlay/BUILD.bazel @@ -0,0 +1,1108 @@ +load("@bazel_skylib//rules:write_file.bzl", "write_file") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc_autoconf//autoconf:autoconf.bzl", "autoconf") +load("@rules_cc_autoconf//autoconf:autoconf_hdr.bzl", "autoconf_hdr") +load("@rules_cc_autoconf//autoconf:autoconf_srcs.bzl", "autoconf_srcs") +load("@rules_cc_autoconf//autoconf:checks.bzl", "checks") +load("@rules_cc_autoconf//autoconf:package_info.bzl", "package_info") + +LOCAL_DEFINES = [ + "HAVE_CONFIG_H", +] + select({ + "@platforms//os:macos": [ + "_DARWIN_C_SOURCE", + ], + "//conditions:default": [], +}) + +GENERATED_SRCS = { + "lib/alloca.h": "lib/alloca.in.h", + "lib/fcntl.h": "lib/fcntl.in.h", + "lib/getopt-cdefs.h": "lib/getopt-cdefs.in.h", + "lib/getopt.h": "lib/getopt.in.h", + "lib/iconv.h": "lib/iconv.in.h", + "lib/inttypes.h": "lib/inttypes.in.h", + "lib/limits.h": "lib/limits.in.h", + "lib/locale.h": "lib/locale.in.h", + "lib/malloc/scratch_buffer.gl.h": "lib/malloc/scratch_buffer.h", + "lib/math.h": "lib/math.in.h", + "lib/sched.h": "lib/sched.in.h", + "lib/signal.h": "lib/signal.in.h", + "lib/spawn.h": "lib/spawn.in.h", + "lib/stdalign.h": "lib/stdalign.in.h", + "lib/stddef.h": "lib/stddef.in.h", + "lib/stdint.h": "lib/stdint.in.h", + "lib/stdio.h": "lib/stdio.in.h", + "lib/stdlib.h": "lib/stdlib.in.h", + "lib/string.h": "lib/string.in.h", + "lib/strings.h": "lib/strings.in.h", + "lib/sys/ioctl.h": "lib/sys_ioctl.in.h", + "lib/sys/resource.h": "lib/sys_resource.in.h", + "lib/sys/stat.h": "lib/sys_stat.in.h", + "lib/sys/time.h": "lib/sys_time.in.h", + "lib/sys/times.h": "lib/sys_times.in.h", + "lib/sys/types.h": "lib/sys_types.in.h", + "lib/sys/wait.h": "lib/sys_wait.in.h", + "lib/termios.h": "lib/termios.in.h", + "lib/textstyle.h": "lib/textstyle.in.h", + "lib/time.h": "lib/time.in.h", + "lib/unistd.h": "lib/unistd.in.h", + "lib/unistr.h": "lib/unistr.in.h", + "lib/unitypes.h": "lib/unitypes.in.h", + "lib/uniwidth.h": "lib/uniwidth.in.h", + "lib/wchar.h": "lib/wchar.in.h", + "lib/wctype.h": "lib/wctype.in.h", +} + +BISON_UNIQUE_M4_FILES = [ + "m4/bison-check-compiler-flag.m4", + "m4/bison-cxx-std.m4", + "m4/c-working.m4", + "m4/cxx.m4", + "m4/flex.m4", + "m4/gnulib-comp.m4", + "m4/m4.m4", + "m4/printf-posix-rpl.m4", + "m4/wchar_t.m4", + "m4/year2038.m4", +] + +# Gnulib m4 modules used by bison (from m4/gnulib-comp.m4) +# Note: 00gnulib is required for proper template processing +GNULIB_M4_DEPS = [ + "@rules_cc_autoconf//gnulib/m4/{}".format(file[len("m4/"):-len(".m4")]) + for file in glob( + include = ["m4/*.m4"], + exclude = BISON_UNIQUE_M4_FILES, + ) +] + +# Package information from configure.ac +package_info( + name = "bison_package_info", + package_name = "GNU Bison", + aliases = { + "VERSION": "PACKAGE_VERSION", + }, + module_bazel = "MODULE.bazel", + package_bugreport = "bug-bison@gnu.org", + package_url = "https://www.gnu.org/software/bison/", + strip_bcr_version = True, +) + +autoconf( + name = "m4_bison-check-compiler-flag", + checks = [], +) + +autoconf( + name = "m4_bison-cxx-std", + checks = [ + # BISON_CXXSTD from m4/bison-cxx-std.m4 (configure.ac lines 77-83) + # Tests compiler flags and AC_SUBSTs CXX_CXXFLAGS + # In Bazel, C++ standard is set via toolchain, but we provide flags for Makefile compatibility + checks.AC_SUBST("CXX98_CXXFLAGS", "-std=c++98"), + checks.AC_SUBST("CXX03_CXXFLAGS", "-std=c++03"), + checks.AC_SUBST("CXX11_CXXFLAGS", "-std=c++11"), + checks.AC_SUBST("CXX14_CXXFLAGS", "-std=c++14"), + checks.AC_SUBST("CXX17_CXXFLAGS", "-std=c++17"), + checks.AC_SUBST("CXX20_CXXFLAGS", "-std=c++20"), + checks.AC_SUBST("CXX2B_CXXFLAGS", "-std=c++2b"), + ], +) + +# Checks from m4/c-working.m4 +# BISON_TEST_FOR_WORKING_C_COMPILER - line 233 +# BISON_C_COMPILER_POSIXLY_CORRECT - line 234 +autoconf( + name = "m4_c-working", + checks = [ + # BISON_TEST_FOR_WORKING_C_COMPILER + # Test that C compiler can compile a simple program + # AC_SUBST BISON_C_WORKS to ":" (colon means true in shell) + checks.AC_SUBST("BISON_C_WORKS", ":"), + # BISON_C_COMPILER_POSIXLY_CORRECT + # Check if C compiler supports -g in POSIXLY_CORRECT mode + # AC_SUBST C_COMPILER_POSIXLY_CORRECT to "true" or "false" + checks.AC_SUBST("C_COMPILER_POSIXLY_CORRECT", "true"), + ], +) + +# Checks from m4/cxx.m4 +# BISON_TEST_FOR_WORKING_CXX_COMPILER - line 235 +# BISON_CXX_COMPILER_POSIXLY_CORRECT - line 236 +autoconf( + name = "m4_cxx", + checks = [ + # BISON_TEST_FOR_WORKING_CXX_COMPILER + # Test that C++ compiler can compile and link a simple program + # AC_SUBST BISON_CXX_WORKS to ":" (if works), "false" (if doesn't), or ":" (if cross-compiling) + checks.AC_SUBST("BISON_CXX_WORKS", ":"), + # BISON_CXX_COMPILER_POSIXLY_CORRECT + # Check if C++ compiler supports -g in POSIXLY_CORRECT mode + # AC_SUBST CXX_COMPILER_POSIXLY_CORRECT to "true" or "false" + checks.AC_SUBST("CXX_COMPILER_POSIXLY_CORRECT", "true"), + ], +) + +# Note: m4_bison_cxx_std checks are now in m4_bison-cxx-std (the canonical target name) + +# Checks from m4/flex.m4 +# AC_PROG_LEX - line 258 +autoconf( + name = "m4_flex", + checks = [ + # Look for flex or lex program + # AC_SUBST LEX - path to lex/flex program + checks.AC_SUBST("LEX", "flex"), + # AC_SUBST LEX_IS_FLEX - true or false + checks.AC_SUBST("LEX_IS_FLEX", "true"), + # AC_SUBST FLEX_SUPPORTS_HEADER_OPT - true or false + checks.AC_SUBST("FLEX_SUPPORTS_HEADER_OPT", "true"), + # AC_SUBST LEX_OUTPUT_ROOT - lex.yy or lexyy + checks.AC_SUBST("LEX_OUTPUT_ROOT", "lex.yy"), + # AC_SUBST LEXLIB - -lfl, -ll, or empty + checks.AC_SUBST("LEXLIB", ""), + # AC_DEFINE YYTEXT_POINTER if yytext is a pointer + checks.AC_DEFINE("YYTEXT_POINTER", "1"), + ], +) + +autoconf( + name = "m4_gnulib-comp", + checks = [ + checks.AC_DEFINE( + "GNULIB_XALLOC", + 1, + subst = True, + ), + checks.AC_DEFINE( + "GNULIB_XALLOC_DIE", + 1, + subst = True, + ), + checks.AC_DEFINE( + "GNULIB_STDIO_SINGLE_THREAD", + 1, + subst = True, + ), + checks.AC_DEFINE( + "USE_UNLOCKED_IO", + "GNULIB_STDIO_SINGLE_THREAD", + ), + # ====================================================================== + # Module indicators from gnulib-comp.m4 + # These override the defaults (0) set by upstream header modules to + # activate gnulib module functionality in generated replacement headers. + # ====================================================================== + + # --- gl_MODULE_INDICATOR (AC_DEFINE in config.h) --- + checks.AC_DEFINE("GNULIB_CANONICALIZE", 1), + checks.AC_DEFINE("GNULIB_CANONICALIZE_LGPL", 1), + checks.AC_DEFINE("GNULIB_CLOEXEC", 1), + checks.AC_DEFINE("GNULIB_CLOSE_STREAM", 1), + checks.AC_DEFINE("GNULIB_DIRNAME", 1), + checks.AC_DEFINE("GNULIB_FD_SAFER_FLAG", 1), + checks.AC_DEFINE("GNULIB_FOPEN_GNU", 1), + checks.AC_DEFINE("GNULIB_FOPEN_SAFER", 1), + checks.AC_DEFINE("GNULIB_GETCWD", 1), + checks.AC_DEFINE("GNULIB_LOCK", 1), + checks.AC_DEFINE("GNULIB_MSVC_NOTHROW", 1), + checks.AC_DEFINE("GNULIB_OPENAT", 1), + checks.AC_DEFINE("GNULIB_PIPE2_SAFER", 1), + checks.AC_DEFINE("GNULIB_REALLOCARRAY", 1), + checks.AC_DEFINE("GNULIB_SNPRINTF", 1), + checks.AC_DEFINE("GNULIB_STRERROR", 1), + checks.AC_DEFINE("GNULIB_STRERROR_R_POSIX", 1), + checks.AC_DEFINE("GNULIB_UNISTR_U8_MBTOUCR", 1), + checks.AC_DEFINE("GNULIB_UNISTR_U8_UCTOMB", 1), + checks.AC_DEFINE("GNULIB_FSCANF", 1), + checks.AC_DEFINE("GNULIB_SCANF", 1), + checks.AC_DEFINE("GNULIB_VFPRINTF_POSIX", 1), + checks.AC_DEFINE("GNULIB_FDOPENDIR", 1), + + # --- gl_STDIO_MODULE_INDICATOR (AC_SUBST for stdio.in.h) --- + checks.AC_SUBST("GNULIB_FOPEN", 1), + checks.AC_SUBST("GNULIB_FPRINTF", 1), + checks.AC_SUBST("GNULIB_FPRINTF_POSIX", 1), + checks.AC_SUBST("GNULIB_FGETC", 1), + checks.AC_SUBST("GNULIB_FGETS", 1), + checks.AC_SUBST("GNULIB_FPUTC", 1), + checks.AC_SUBST("GNULIB_FPUTS", 1), + checks.AC_SUBST("GNULIB_FREAD", 1), + checks.AC_SUBST("GNULIB_FSCANF", 1), + checks.AC_SUBST("GNULIB_FWRITE", 1), + checks.AC_SUBST("GNULIB_GETC", 1), + checks.AC_SUBST("GNULIB_GETCHAR", 1), + checks.AC_SUBST("GNULIB_GETDELIM", 1), + checks.AC_SUBST("GNULIB_GETLINE", 1), + checks.AC_SUBST("GNULIB_OBSTACK_PRINTF", 1), + checks.AC_SUBST("GNULIB_PERROR", 1), + checks.AC_SUBST("GNULIB_PRINTF", 1), + checks.AC_SUBST("GNULIB_PRINTF_POSIX", 1), + checks.AC_SUBST("GNULIB_PUTC", 1), + checks.AC_SUBST("GNULIB_PUTCHAR", 1), + checks.AC_SUBST("GNULIB_PUTS", 1), + checks.AC_SUBST("GNULIB_RENAME", 1), + checks.AC_SUBST("GNULIB_SCANF", 1), + checks.AC_SUBST("GNULIB_SNPRINTF", 1), + checks.AC_SUBST("GNULIB_SPRINTF_POSIX", 1), + checks.AC_SUBST("GNULIB_VASPRINTF", 1), + checks.AC_SUBST("GNULIB_VFPRINTF", 1), + checks.AC_SUBST("GNULIB_VFPRINTF_POSIX", 1), + checks.AC_SUBST("GNULIB_VPRINTF", 1), + checks.AC_SUBST("GNULIB_VSNPRINTF", 1), + checks.AC_SUBST("GNULIB_VSPRINTF_POSIX", 1), + + # --- gl_UNISTD_MODULE_INDICATOR (AC_SUBST for unistd.in.h) --- + # Note: GNULIB_ACCESS is set only for Windows (see select below) + # because MSVC's _access() doesn't support X_OK (mode=1), returning + # EINVAL. The gnulib access replacement (lib/access.c) converts + # X_OK to R_OK. On macOS/Linux the system access() works fine, and + # leaving GNULIB_ACCESS=0 avoids an rpl_access redirect conflict. + checks.AC_SUBST("GNULIB_CHDIR", 1), + checks.AC_SUBST("GNULIB_CLOSE", 1), + checks.AC_SUBST("GNULIB_DUP2", 1), + checks.AC_SUBST("GNULIB_ENVIRON", 1), + checks.AC_SUBST("GNULIB_FCHDIR", 1), + checks.AC_SUBST("GNULIB_FSYNC", 1), + checks.AC_SUBST("GNULIB_GETCWD", 1), + checks.AC_SUBST("GNULIB_GETDTABLESIZE", 1), + checks.AC_SUBST("GNULIB_GETOPT_POSIX", 1), + checks.AC_SUBST("GNULIB_PIPE", 1), + checks.AC_SUBST("GNULIB_PIPE2", 1), + checks.AC_SUBST("GNULIB_READLINK", 1), + checks.AC_SUBST("GNULIB_RMDIR", 1), + checks.AC_SUBST("GNULIB_UNLINK", 1), + checks.AC_SUBST("GNULIB_UNISTD_H_GETOPT", 1), + + # --- gl_STDLIB_MODULE_INDICATOR (AC_SUBST for stdlib.in.h) --- + checks.AC_SUBST("GNULIB_CALLOC_POSIX", 1), + checks.AC_SUBST("GNULIB_CANONICALIZE_FILE_NAME", 1), + checks.AC_SUBST("GNULIB_FREE_POSIX", 1), + checks.AC_SUBST("GNULIB_MALLOC_POSIX", 1), + checks.AC_SUBST("GNULIB_REALLOCARRAY", 1), + checks.AC_SUBST("GNULIB_REALLOC_POSIX", 1), + checks.AC_SUBST("GNULIB_REALPATH", 1), + checks.AC_SUBST("GNULIB_STRTOD", 1), + checks.AC_SUBST("GNULIB_UNSETENV", 1), + + # --- gl_STRING_MODULE_INDICATOR (AC_SUBST for string.in.h) --- + checks.AC_SUBST("GNULIB_FFSL", 1), + checks.AC_SUBST("GNULIB_MEMCHR", 1), + checks.AC_SUBST("GNULIB_MEMPCPY", 1), + checks.AC_SUBST("GNULIB_MEMRCHR", 1), + checks.AC_SUBST("GNULIB_RAWMEMCHR", 1), + checks.AC_SUBST("GNULIB_STPCPY", 1), + checks.AC_SUBST("GNULIB_STPNCPY", 1), + checks.AC_SUBST("GNULIB_STRCHRNUL", 1), + checks.AC_SUBST("GNULIB_STRDUP", 1), + checks.AC_SUBST("GNULIB_STRERROR", 1), + checks.AC_SUBST("GNULIB_STRERROR_R", 1), + checks.AC_SUBST("GNULIB_STRNDUP", 1), + checks.AC_SUBST("GNULIB_STRNLEN", 1), + checks.AC_SUBST("GNULIB_STRVERSCMP", 1), + + # --- gl_MATH_MODULE_INDICATOR (AC_SUBST for math.in.h) --- + checks.AC_SUBST("GNULIB_FREXP", 1), + checks.AC_SUBST("GNULIB_FREXPL", 1), + checks.AC_SUBST("GNULIB_ISNAN", 1), + checks.AC_SUBST("GNULIB_ISNAND", 1), + checks.AC_SUBST("GNULIB_ISNANF", 1), + checks.AC_SUBST("GNULIB_ISNANL", 1), + checks.AC_SUBST("GNULIB_LDEXPL", 1), + checks.AC_SUBST("GNULIB_SIGNBIT", 1), + + # --- gl_WCHAR_MODULE_INDICATOR (AC_SUBST for wchar.in.h) --- + checks.AC_SUBST("GNULIB_MBRTOWC", 1), + checks.AC_SUBST("GNULIB_MBSINIT", 1), + checks.AC_SUBST("GNULIB_WCWIDTH", 1), + + # --- gl_WCTYPE_MODULE_INDICATOR (AC_SUBST for wctype.in.h) --- + checks.AC_SUBST("GNULIB_ISWBLANK", 1), + checks.AC_SUBST("GNULIB_ISWDIGIT", 1), + checks.AC_SUBST("GNULIB_ISWXDIGIT", 1), + + # --- gl_SPAWN_MODULE_INDICATOR (AC_SUBST for spawn.in.h) --- + checks.AC_SUBST("GNULIB_POSIX_SPAWN", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWNATTR_DESTROY", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWNATTR_INIT", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWNATTR_SETFLAGS", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWNATTR_SETPGROUP", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWNATTR_SETSIGMASK", 1), + checks.AC_SUBST("GNULIB_POSIX_SPAWNP", 1), + + # --- gl_SIGNAL_MODULE_INDICATOR (AC_SUBST for signal.in.h) --- + checks.AC_SUBST("GNULIB_RAISE", 1), + checks.AC_SUBST("GNULIB_SIGACTION", 1), + checks.AC_SUBST("GNULIB_SIGPROCMASK", 1), + + # --- gl_SYS_STAT_MODULE_INDICATOR (AC_SUBST for sys_stat.in.h) --- + checks.AC_SUBST("GNULIB_FSTAT", 1), + checks.AC_SUBST("GNULIB_FSTATAT", 1), + checks.AC_SUBST("GNULIB_LSTAT", 1), + checks.AC_SUBST("GNULIB_STAT", 1), + + # --- gl_SYS_TIME_MODULE_INDICATOR (AC_SUBST for sys_time.in.h) --- + checks.AC_SUBST("GNULIB_GETTIMEOFDAY", 1), + + # --- gl_SYS_RESOURCE_MODULE_INDICATOR --- + checks.AC_SUBST("GNULIB_GETRUSAGE", 1), + + # --- gl_SYS_WAIT_MODULE_INDICATOR (AC_SUBST for sys_wait.in.h) --- + checks.AC_SUBST("GNULIB_WAITPID", 1), + + # --- gl_FCNTL_MODULE_INDICATOR (AC_SUBST for fcntl.in.h) --- + checks.AC_SUBST("GNULIB_FCNTL", 1), + checks.AC_SUBST("GNULIB_OPEN", 1), + checks.AC_SUBST("GNULIB_OPENAT", 1), + + # --- gl_ICONV_MODULE_INDICATOR --- + checks.AC_SUBST("GNULIB_ICONV", 1), + + # --- gl_DIRENT_MODULE_INDICATOR --- + checks.AC_SUBST("GNULIB_CLOSEDIR", 1), + checks.AC_SUBST("GNULIB_DIRFD", 1), + checks.AC_SUBST("GNULIB_FDOPENDIR", 1), + checks.AC_SUBST("GNULIB_OPENDIR", 1), + checks.AC_SUBST("GNULIB_READDIR", 1), + checks.AC_SUBST("GNULIB_REWINDDIR", 1), + + # --- gl_LOCALE_MODULE_INDICATOR --- + checks.AC_SUBST("GNULIB_SETLOCALE_NULL", 1), + + # --- gl_STRINGS_MODULE_INDICATOR --- + checks.AC_SUBST("GNULIB_FFS", 1), + + # ====================================================================== + # Compatibility substitutions for older gnulib variable names used by + # bison 3.8.2 templates (newer gnulib uses _FOR_*_POSIX suffixed names) + # ====================================================================== + checks.AC_SUBST("REPLACE_CALLOC", 0), + checks.AC_SUBST("REPLACE_MALLOC", 0), + checks.AC_SUBST("REPLACE_REALLOC", 0), + ], +) + +# Checks from m4/m4.m4 +# AC_PROG_GNU_M4 - line 268 +autoconf( + name = "m4_m4", + checks = [ + # Look for GNU M4 1.4.6 or later + # AC_SUBST M4 - path to m4 program (used in Makefiles) + checks.AC_SUBST("M4", "m4"), + # AC_SUBST M4_GNU - --gnu or empty (used in Makefiles) + checks.AC_SUBST("M4_GNU", "--gnu"), + # AC_SUBST M4_DEBUGFILE - --debugfile or --error-output (used in Makefiles) + checks.AC_SUBST("M4_DEBUGFILE", "--debugfile"), + # AC_DEFINE_UNQUOTED M4_GNU_OPTION (configure.ac line 270-271) + # Note: M4 itself is AC_DEFINE_UNQUOTED in configure.ac, but we use AC_SUBST for Makefile compatibility + checks.AC_DEFINE("M4_GNU_OPTION", '"--gnu"'), + ], +) + +# Checks from m4/printf-posix-rpl.m4 +# gl_FUNC_PRINTF_POSIX - may be called via gnulib modules +autoconf( + name = "m4_printf-posix-rpl", + checks = [ + # Check if printf needs POSIX replacement + # AC_SUBST REPLACE_PRINTF - 0 or 1 + checks.AC_SUBST("REPLACE_PRINTF", "0"), + # AC_DEFINE REPLACE_PRINTF_POSIX - 0 or 1 + checks.AC_DEFINE("REPLACE_PRINTF_POSIX", "0"), + ], +) + +# Checks from m4/wchar_t.m4 +# gt_TYPE_WCHAR_T - may be called via gnulib +autoconf( + name = "m4_wchar_t", + checks = [ + # Check if has the wchar_t type + # AC_DEFINE HAVE_WCHAR_T - 1 if found (for C preprocessor) + checks.AC_DEFINE("HAVE_WCHAR_T", "1"), + # AC_SUBST for stddef.in.h template (@HAVE_WCHAR_T@ substitution) + checks.AC_SUBST("HAVE_WCHAR_T", 1), + ], +) + +# Checks from m4/year2038.m4 +# gl_YEAR2038_EARLY and gl_YEAR2038_BODY - may be called via gnulib +autoconf( + name = "m4_year2038", + checks = [ + # Check for time_t past year 2038 support + # On mingw, AC_DEFINE __MINGW_USE_VC2005_COMPAT + # For 32-bit systems, may need _TIME_BITS=64 and _FILE_OFFSET_BITS=64 + # Most 64-bit systems already have 64-bit time_t, so these are typically not needed + # AC_DEFINE _TIME_BITS and _FILE_OFFSET_BITS if needed (left empty for most systems) + ] + select({ + "@platforms//os:windows": [ + checks.AC_DEFINE("__MINGW_USE_VC2005_COMPAT", "1"), + ], + "//conditions:default": [], + }), +) + +BISON_UNIQUE_AUTOCONF_TARGETS = [ + # Strip `m4/` prefix and `.m4` suffix. + "m4_{}".format(file[3:-3]) + for file in BISON_UNIQUE_M4_FILES +] + +# Standard autoconf checks from configure.ac +# AC_CHECK_HEADERS_ONCE([locale.h]) - line 278 +# AC_C_INLINE - line 281 +# AC_CHECK_FUNCS_ONCE([setlocale]) - line 288 +autoconf( + name = "configure_ac", + checks = [ + # checks.AC_C_INLINE(), + checks.AC_CHECK_FUNC("setlocale"), + checks.AC_SUBST("GUARD_PREFIX", "GL"), + checks.AC_SUBST("GNULIB_LOCALENAME", 0), + checks.AC_DEFINE("M4", '"/usr/bin/m4"'), + checks.AC_DEFINE("PACKAGE_COPYRIGHT_YEAR", 2026), + + # Checks from m4/bison-i18n.m4 (BISON_I18N - configure.ac line 295) + # Internationalization support (simplified - assumes no NLS for cross-platform build) + checks.AC_DEFINE("YYENABLE_NLS", "0"), + checks.AC_SUBST("BISON_USE_NLS", "no"), + checks.AC_SUBST("BISON_LOCALEDIR", ""), + + # ================================================================= + # Header availability probes (HAVE_*_H) + # + # The generated lib/.h wrappers expand to `#include_next ` + # when HAVE__H=1, otherwise they fall back to a gnulib-provided + # replacement. rules_cc_autoconf's gnulib *_DEFAULTS targets + # hard-code HAVE__H=1, which breaks on toolchains lacking the + # POSIX header set (most prominently MSVC and clang-cl on Windows, + # where `os:windows` selects can't discriminate from MinGW). + # Probe the real toolchain so subsequent substitutions and config.h + # entries reflect what's actually available. + # ================================================================= + ] + [ + # Bind each HAVE_*_H subst to the cache variable already populated + # by the corresponding gnulib m4 module (transitively in `deps` + # via GNULIB_M4_DEPS). These modules probe the header but don't + # emit the AC_SUBST themselves, so without these overrides the + # subst falls back to the bogus HAVE_*_H=1 baked into the matching + # *_DEFAULTS target — which breaks generated wrappers on + # toolchains lacking the header (notably MSVC and clang-cl on + # Windows, where an `os:windows` select can't discriminate from + # MinGW). + # + # Headers NOT listed here: + # - alloca.h, getopt.h, sched.h, spawn.h, strings.h, sys/ioctl.h, + # sys/resource.h, sys/times.h, unistd.h: the matching gnulib + # m4 module already emits an AC_SUBST tied to the probe — + # re-substing here would collide. + checks.AC_SUBST( + name, + condition = cache, + ) + for name, cache in [ + ("HAVE_FCNTL_H", "ac_cv_header_fcntl_h"), + ("HAVE_ICONV_H", "ac_cv_header_iconv_h"), + ("HAVE_SYS_TIME_H", "ac_cv_header_sys_time_h"), + ("HAVE_SYS_WAIT_H", "ac_cv_header_sys_wait_h"), + ("HAVE_TERMIOS_H", "ac_cv_header_termios_h"), + ] + ] + [ + # ================================================================= + # Gnulib conditional source compilation gates (COMPILE_* variables) + # These determine which replacement sources to compile based on + # function availability. COMPILE_*=1 means the function is MISSING + # and the gnulib replacement should be compiled. + # ================================================================= + + # rawmemchr — GNU extension, missing on macOS + checks.AC_TRY_LINK( + name = "bison_cv_func_rawmemchr", + code = """\ +#define _GNU_SOURCE 1 +#include +int main(void) { (void)rawmemchr; return 0; } +""", + ), + checks.AC_SUBST( + "COMPILE_RAWMEMCHR", + condition = "!bison_cv_func_rawmemchr", + ), + checks.AC_SUBST( + "COMPILE_MEMPCPY", + condition = "!ac_cv_func_mempcpy", + ), + checks.AC_SUBST("COMPILE_REALLOCARRAY", "1"), + checks.AC_TRY_LINK( + name = "bison_cv_func_strverscmp", + code = """\ +#include +int main(void) { return strverscmp("1.0", "2.0"); } +""", + ), + checks.AC_SUBST( + "COMPILE_STRVERSCMP", + condition = "!bison_cv_func_strverscmp", + ), + # Drive HAVE_DECL_STRVERSCMP from the same probe so the gnulib + # string.h wrapper emits a declaration on toolchains that lack it + # (e.g. the Windows CRT under MSVC / clang-cl, where the implicit + # declaration is a C99 error). + checks.AC_SUBST( + "HAVE_DECL_STRVERSCMP", + condition = "bison_cv_func_strverscmp", + ), + checks.AC_TRY_LINK( + name = "bison_cv_func_canonicalize_file_name", + code = """\ +#ifdef __cplusplus +extern "C" +#endif +char *canonicalize_file_name(const char *); +int main(void) { return canonicalize_file_name(".") != 0; } +""", + ), + checks.AC_SUBST( + "COMPILE_CANONICALIZE_LGPL", + condition = "!bison_cv_func_canonicalize_file_name", + ), + + # error.c — compiled when error_at_line() is missing (macOS) + checks.AC_CHECK_FUNC("error_at_line"), + checks.AC_SUBST( + "COMPILE_ERROR", + condition = "!ac_cv_func_error_at_line", + ), + + # fpending.c — compiled when __fpending() is missing (macOS) + checks.AC_TRY_LINK( + name = "bison_cv_func___fpending", + code = """\ +#include +#if HAVE_STDIO_EXT_H +# include +#endif +int main(void) { return ! __fpending(stdin); } +""", + ), + checks.AC_SUBST( + "COMPILE_FPENDING", + condition = "!bison_cv_func___fpending", + ), + + # fseterr.c — compiled when __fseterr() is missing (macOS) + checks.AC_TRY_LINK( + name = "bison_cv_func___fseterr", + code = """\ +#include +#ifdef __cplusplus +extern "C" +#endif +void __fseterr(FILE *); +int main(void) { __fseterr(stdin); return 0; } +""", + ), + checks.AC_SUBST( + "COMPILE_FSETERR", + condition = "!bison_cv_func___fseterr", + ), + checks.AC_SUBST("COMPILE_OBSTACK_PRINTF", "1"), + ] + select({ + "@platforms//os:linux": [ + # getopt: __GETOPT_PREFIX=rpl_ always set → replacement always needed + checks.AC_SUBST("COMPILE_GETOPT", "1"), + checks.AC_SUBST("COMPILE_OPEN", "0"), + checks.AC_SUBST("COMPILE_UNLINK", "0"), + checks.AC_SUBST("COMPILE_STRERROR_OVERRIDE", "0"), + checks.AC_SUBST("COMPILE_MBRTOWC", "1"), + checks.AC_SUBST("COMPILE_SPAWN_FACTION_ADDCHDIR", "1"), + ], + "@platforms//os:macos": [ + checks.AC_SUBST("COMPILE_GETOPT", "1"), + checks.AC_SUBST("COMPILE_OPEN", "1"), + checks.AC_SUBST("COMPILE_UNLINK", "1"), + checks.AC_SUBST("COMPILE_STRERROR_OVERRIDE", "1"), + checks.AC_SUBST("COMPILE_MBRTOWC", "0"), + checks.AC_SUBST("COMPILE_SPAWN_FACTION_ADDCHDIR", "1"), + ], + "@platforms//os:windows": [ + checks.AC_SUBST("COMPILE_GETOPT", "1"), + checks.AC_SUBST("COMPILE_OPEN", "0"), + checks.AC_SUBST("COMPILE_UNLINK", "0"), + checks.AC_SUBST("COMPILE_STRERROR_OVERRIDE", "0"), + checks.AC_SUBST("COMPILE_MBRTOWC", "0"), + checks.AC_SUBST("COMPILE_SPAWN_FACTION_ADDCHDIR", "1"), + # Override string_h toolchain defaults for POSIX functions missing + # on Windows. Without these the generated string.h skips their + # declarations, causing implicit-int errors on MSVC. + checks.AC_SUBST("HAVE_STPCPY", 0), + checks.AC_SUBST("HAVE_STPNCPY", 0), + # MSVC's _access() doesn't support X_OK (mode=1) and returns + # EINVAL. Enable gnulib access replacement (lib/access.c) which + # converts X_OK to R_OK before calling _access(). + checks.AC_SUBST("GNULIB_ACCESS", 1), + ], + "//conditions:default": [ + checks.AC_SUBST("COMPILE_GETOPT", "1"), + checks.AC_SUBST("COMPILE_OPEN", "0"), + checks.AC_SUBST("COMPILE_UNLINK", "0"), + checks.AC_SUBST("COMPILE_STRERROR_OVERRIDE", "0"), + checks.AC_SUBST("COMPILE_MBRTOWC", "0"), + checks.AC_SUBST("COMPILE_SPAWN_FACTION_ADDCHDIR", "1"), + ], + }), + deps = [ + ":bison_package_info", + ] + BISON_UNIQUE_AUTOCONF_TARGETS + GNULIB_M4_DEPS, +) + +# Generate header files from templates using autoconf_hdr +# These templates contain @PLACEHOLDER@ markers that need to be processed +[ + autoconf_hdr( + name = hdr[:-len(".h")] + "_h", + out = hdr, + defaults = True, + inlines = { + "/* The definition of _GL_ARG_NONNULL is copied here. */": "lib/arg-nonnull.h", + "/* The definition of _GL_WARN_ON_USE is copied here. */": "lib/warn-on-use.h", + "/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */": "lib/c++defs.h", + }, + mode = "subst", + substitutions = { + "libc_hidden_proto": "// libc_hidden_proto", + "__always_inline": "inline _GL_ATTRIBUTE_ALWAYS_INLINE", + "__glibc_likely": "_GL_LIKELY", + "__glibc_unlikely": "_GL_UNLIKELY", + }, + template = template, + deps = [":configure_ac"], + ) + for hdr, template in GENERATED_SRCS.items() +] + +autoconf_hdr( + name = "lib/config_h", + out = "lib/config.h", + template = "lib/config.in.h", + deps = [":configure_ac"], +) + +write_file( + name = "configmake_h_src", + out = "lib/configmake.h", + content = [ + "#define LOCALEDIR \"\"", + "#define PKGDATADIR \"bison/data\"", + "", + ], + newline = "unix", + tags = ["manual"], +) + +# Gnulib's wrapper headers (generated lib/stdio.h, lib/fcntl.h, ... plus +# the checked-in lib/*-safer.h helpers) must shadow the libc headers: they +# forward via #include_next and add gnulib decorations +# (_GL_ATTRIBUTE_DEALLOC etc.) that lib/ and src/ sources rely on. +# `includes = ["lib"]` emits -isystem, which loses against toolchains that +# inject libc headers as earlier -isystem entries (e.g. the zero-sysroot +# hermetic-llvm BCR toolchain). Plain -I outranks every -isystem (and a dir +# listed as both -I and -isystem stays -isystem, so the -isystem form must +# go entirely). This restores autotools' AM_CPPFLAGS = -I./lib ordering. +BISON_COPTS = [ + "-Iexternal/" + repo_name() + "/lib", + "-I$(BINDIR)/external/" + repo_name() + "/lib", +] + select({ + "@rules_cc//cc/compiler:clang": [ + "-w", + "-std=c11", + "-Wno-unused-but-set-variable", + ], + "@rules_cc//cc/compiler:gcc": [ + "-w", + "-std=c11", + ], + "@rules_cc//cc/compiler:msvc-cl": [ + # C4116: unnamed type definition in parentheses + "/wd4116", + ], + "//conditions:default": [], +}) + +# Gnulib conditional sources — each file is compiled only when its condition +# variable evaluates to true. Conditions come from three sources: +# - REPLACE_*: upstream gnulib modules (function exists but is buggy/missing) +# - COMPILE_*: configure_ac checks (function absent on platform) +# - ac_cv_define_REPLACE_POSIX_SPAWN: spawn subsystem needs full replacement +autoconf_srcs( + name = "gnulib_conditional_srcs", + srcs = { + # --- REPLACE_* gated (upstream gnulib decides) --- + "lib/asprintf.c": "REPLACE_VASPRINTF", + # --- COMPILE_* gated (function absent → replacement compiled) --- + "lib/canonicalize-lgpl.c": "COMPILE_CANONICALIZE_LGPL", + "lib/error.c": "COMPILE_ERROR", + "lib/fcntl.c": "REPLACE_FCNTL", + "lib/fopen.c": "REPLACE_FOPEN", + "lib/fpending.c": "COMPILE_FPENDING", + "lib/fprintf.c": "REPLACE_FPRINTF", + "lib/free.c": "REPLACE_FREE", + "lib/fseterr.c": "COMPILE_FSETERR", + "lib/fstat.c": "REPLACE_FSTAT", + "lib/getopt.c": "COMPILE_GETOPT", + "lib/getopt1.c": "COMPILE_GETOPT", + "lib/iconv_open.c": "REPLACE_ICONV_OPEN", + "lib/lstat.c": "REPLACE_LSTAT", + "lib/mbrtowc.c": "COMPILE_MBRTOWC", + "lib/mempcpy.c": "COMPILE_MEMPCPY", + "lib/obstack_printf.c": "COMPILE_OBSTACK_PRINTF", + "lib/open.c": "COMPILE_OPEN", + "lib/perror.c": "REPLACE_PERROR", + "lib/printf.c": "REPLACE_PRINTF", + "lib/rawmemchr.c": "COMPILE_RAWMEMCHR", + "lib/readlink.c": "REPLACE_READLINK", + "lib/reallocarray.c": "COMPILE_REALLOCARRAY", + "lib/rename.c": "REPLACE_RENAME", + "lib/snprintf.c": "REPLACE_SNPRINTF", + # --- Spawn replacement (all-or-nothing when REPLACE_POSIX_SPAWN=1) --- + "lib/spawn.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawn_faction_addchdir.c": "COMPILE_SPAWN_FACTION_ADDCHDIR", + "lib/spawn_faction_addclose.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawn_faction_adddup2.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawn_faction_addopen.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawn_faction_destroy.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawn_faction_init.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawnattr_destroy.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawnattr_init.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawnattr_setflags.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawnattr_setpgroup.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawnattr_setsigmask.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawni.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/spawnp.c": "ac_cv_define_REPLACE_POSIX_SPAWN", + "lib/sprintf.c": "REPLACE_SPRINTF", + "lib/stat.c": "REPLACE_STAT", + "lib/strchrnul.c": "REPLACE_STRCHRNUL", + "lib/strerror-override.c": "COMPILE_STRERROR_OVERRIDE", + "lib/strerror.c": "REPLACE_STRERROR", + "lib/strerror_r.c": "REPLACE_STRERROR_R", + "lib/strverscmp.c": "COMPILE_STRVERSCMP", + "lib/unlink.c": "COMPILE_UNLINK", + "lib/vasprintf.c": "REPLACE_VASPRINTF", + "lib/vfprintf.c": "REPLACE_VFPRINTF", + "lib/vsnprintf.c": "REPLACE_VSNPRINTF", + "lib/vsprintf.c": "REPLACE_VSPRINTF", + }, + defaults = True, + deps = [":configure_ac"], +) + +# Shared headers for lib/ targets (mirrors autotools AM_CPPFLAGS = -I./lib) +cc_library( + name = "headers", + hdrs = ["lib/config.h"] + [ + ":{}".format(hdr) + for hdr in GENERATED_SRCS.keys() + ] + glob( + include = ["lib/**/*.h"], + exclude = GENERATED_SRCS.keys() + [ + "lib/config.h", + "lib/configmake.h", + ], + ) + [ + "src/scan-code.c", + "src/scan-gram.c", + "src/scan-skel.c", + ":configmake_h_src", + ], + textual_hdrs = [ + "lib/timevar.def", + "lib/printf-frexp.c", + ], +) + +alias( + name = "libbison", + actual = ":lib/bison", +) + +# Unconditional sources are always compiled on all platforms. +# Conditional sources are gated by autoconf_srcs targets based on actual +# check results (REPLACE_*, HAVE_*), matching native autoconf behavior. +cc_library( + name = "lib/bison", + srcs = [ + # === Unconditional sources (from lib_libbison_a_SOURCES in gnulib.mk) === + "lib/allocator.c", + "lib/areadlink.c", + "lib/argmatch.c", + "lib/asnprintf.c", + "lib/basename.c", + "lib/basename-lgpl.c", + "lib/binary-io.c", + "lib/bitrotate.c", + "lib/bitset.c", + "lib/bitset/array.c", + "lib/bitset/list.c", + "lib/bitset/stats.c", + "lib/bitset/table.c", + "lib/bitset/vector.c", + "lib/bitsetv.c", + "lib/c-ctype.c", + "lib/c-strcasecmp.c", + "lib/c-strncasecmp.c", + "lib/canonicalize.c", + "lib/careadlinkat.c", + "lib/cloexec.c", + "lib/close-stream.c", + "lib/closeout.c", + "lib/concat-filename.c", + "lib/dirname.c", + "lib/dirname-lgpl.c", + "lib/dup-safer.c", + "lib/dup-safer-flag.c", + "lib/execute.c", + "lib/exitfail.c", + "lib/fatal-signal.c", + "lib/fd-safer.c", + "lib/fd-safer-flag.c", + "lib/file-set.c", + "lib/findprog-in.c", + "lib/fopen-safer.c", + "lib/fstrcmp.c", + "lib/get-errno.c", + "lib/gethrxtime.c", + "lib/getprogname.c", + "lib/gettime.c", + "lib/gl_array_list.c", + "lib/gl_hash_map.c", + "lib/gl_linked_list.c", + "lib/gl_list.c", + "lib/gl_map.c", + "lib/gl_oset.c", + "lib/gl_rbtree_oset.c", + "lib/gl_rbtreehash_list.c", + "lib/gl_xlist.c", + "lib/gl_xmap.c", + "lib/glthread/lock.c", + "lib/glthread/threadlib.c", + "lib/glthread/tls.c", + "lib/hash.c", + "lib/hash-pjw.c", + "lib/hash-triple-simple.c", + "lib/ialloc.c", + "lib/integer_length.c", + "lib/integer_length_l.c", + "lib/localcharset.c", + "lib/malloc/scratch_buffer_dupfree.c", + "lib/malloc/scratch_buffer_grow.c", + "lib/malloc/scratch_buffer_grow_preserve.c", + "lib/malloc/scratch_buffer_set_array_size.c", + "lib/math.c", + "lib/mbchar.c", + "lib/mbfile.c", + "lib/mbswidth.c", + "lib/obstack.c", + "lib/path-join.c", + "lib/pipe-safer.c", + "lib/pipe2.c", + "lib/pipe2-safer.c", + "lib/printf-args.c", + "lib/printf-frexp.c", + "lib/printf-frexpl.c", + "lib/printf-parse.c", + "lib/progname.c", + "lib/quotearg.c", + "lib/readline.c", + "lib/sig-handler.c", + "lib/spawn-pipe.c", + "lib/stripslash.c", + "lib/timespec.c", + "lib/timevar.c", + "lib/unicodeio.c", + "lib/unistd.c", + "lib/unistr/u8-mbtoucr.c", + "lib/unistr/u8-uctomb.c", + "lib/unistr/u8-uctomb-aux.c", + "lib/uniwidth/width.c", + "lib/vasnprintf.c", + "lib/wait-process.c", + "lib/wctype-h.c", + "lib/xalloc-die.c", + "lib/xconcat-filename.c", + "lib/xhash.c", + "lib/xmalloc.c", + "lib/xmemdup0.c", + "lib/xreadlink.c", + "lib/xsize.c", + "lib/xstrndup.c", + "lib/xtime.c", + # Always-enabled gnulib modules (gl_GNULIB_ENABLED_* always true for bison) + "lib/hard-locale.c", + "lib/malloca.c", + "lib/setlocale_null.c", + "lib/stat-time.c", + ] + [ + ":gnulib_conditional_srcs", + ] + select({ + "@platforms//os:windows": [ + # gnulib access() replacement: converts X_OK to R_OK for MSVC + "lib/access.c", + # POSIX function replacements (missing on Windows) + "lib/ffsl.c", + "lib/fsync.c", + "lib/getdtablesize.c", + "lib/getrusage.c", + "lib/gettimeofday.c", + "lib/pipe.c", + "lib/sigaction.c", + "lib/sigprocmask.c", + "lib/stpcpy.c", + "lib/stpncpy.c", + "lib/strndup.c", + "lib/waitpid.c", + "lib/wcwidth.c", + # Windows-specific gnulib support + "lib/msvc-inval.c", + "lib/msvc-nothrow.c", + "lib/stat-w32.c", + "lib/windows-mutex.c", + "lib/windows-once.c", + "lib/windows-recmutex.c", + "lib/windows-rwlock.c", + "lib/windows-spawn.c", + "lib/windows-tls.c", + ], + "//conditions:default": [], + }), + copts = BISON_COPTS, + local_defines = LOCAL_DEFINES + [ + "DEFAULT_TEXT_DOMAIN=\\\"bison-gnulib\\\"", + ] + select({ + "@platforms//os:windows": [ + "SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN=1", + ], + "//conditions:default": [], + }), + deps = [":headers"], +) + +alias( + name = "liby", + actual = ":lib/y", +) + +cc_library( + name = "lib/y", + srcs = [ + "lib/main.c", + "lib/yyerror.c", + ], + copts = BISON_COPTS, + implementation_deps = [":headers"], + local_defines = LOCAL_DEFINES, +) + +BISON_SRC_SRCS = glob( + include = [ + "src/*.c", + ], + exclude = [ + "src/bazel_runfiles.cc", + "src/i18n-strings.c", + "src/scan-code.c", + "src/scan-gram.c", + "src/scan-skel.c", + "src/main.c", + ], +) + +BISON_HDRS_SRCS = glob( + include = ["src/*.h"], +) + +cc_library( + name = "bison_bazel_runfiles", + srcs = ["src/bazel_runfiles.cc"], + deps = ["@rules_cc//cc/runfiles"], +) + +# Runfiles for bison binary +filegroup( + name = "bison_data", + srcs = glob(["data/**/*"]) + [ + "@m4", + ], +) + +filegroup( + name = "bison_pkgdata", + srcs = glob(["data/**/*"]), + visibility = ["//visibility:public"], +) + +label_flag( + name = "m4", + build_setting_default = "@m4//:m4", + visibility = ["//visibility:public"], +) + +label_flag( + name = "bison_pkgdatadir", + build_setting_default = ":bison_pkgdata", + visibility = ["//visibility:public"], +) + +# Link options for different compilers +BISON_LINKOPTS = select({ + "@rules_cc//cc/compiler:msvc-cl": [ + # LNK4001: no object files specified; libraries used + "/IGNORE:4001", + ], + "//conditions:default": [], +}) + +# Bison binary +cc_binary( + name = "bin/bison", + srcs = BISON_SRC_SRCS + ["src/main.c"] + BISON_HDRS_SRCS, + copts = BISON_COPTS, + data = [":bison_data"], + includes = ["src"], + linkopts = BISON_LINKOPTS + select({ + "@platforms//os:linux": ["-lpthread"], + "@platforms//os:macos": ["-liconv"], + "//conditions:default": [], + }), + local_defines = LOCAL_DEFINES, + visibility = ["//visibility:public"], + deps = [ + ":bison_bazel_runfiles", + ":headers", + ":libbison", + ":liby", + ], +) + +alias( + name = "bison", + actual = ":bin/bison", + visibility = ["//visibility:public"], +) + +# Yacc binary (alias for bison) +alias( + name = "yacc", + actual = ":bin/bison", + visibility = ["//visibility:public"], +) diff --git a/bazel/registry/modules/bison/3.8.2.bcr.10/overlay/MODULE.bazel b/bazel/registry/modules/bison/3.8.2.bcr.10/overlay/MODULE.bazel new file mode 120000 index 000000000..9b599e3ad --- /dev/null +++ b/bazel/registry/modules/bison/3.8.2.bcr.10/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/bazel/registry/modules/bison/3.8.2.bcr.10/overlay/bison.bzl b/bazel/registry/modules/bison/3.8.2.bcr.10/overlay/bison.bzl new file mode 100644 index 000000000..56fc1d6a8 --- /dev/null +++ b/bazel/registry/modules/bison/3.8.2.bcr.10/overlay/bison.bzl @@ -0,0 +1,131 @@ +"""Rule for running GNU Bison with M4 and PKGDATADIR configured automatically.""" + +def _collect_tool_files(target): + """Collect files and default runfiles from a target into a depset for tools.""" + info = target[DefaultInfo] + transitive = [info.files] + if info.default_runfiles: + transitive.append(info.default_runfiles.files) + return depset(transitive = transitive) + +def _resolve_pkgdatadir(files): + """Derive the bison PKGDATADIR path from the provided files. + + If the label resolves to a single directory (TreeArtifact), its path is + used directly. Otherwise, a file within the data tree is located and its + path is truncated at the ``data`` component. + """ + if len(files) == 1 and files[0].is_directory: + return files[0].path + for f in files: + idx = f.path.find("/data/") + if idx >= 0: + return f.path[:idx + 5] + if f.path.startswith("data/"): + return "data" + fail("Could not determine BISON_PKGDATADIR: no 'data' directory found in provided files") + +def _arg_map_expand_outputs(value): + arg, out_map = value + for part, output in out_map.items(): + arg = arg.replace(part, output.path) + return arg + +def _bison_impl(ctx): + tool = ctx.executable.bison + m4 = ctx.file.m4 + pkgdatadir = _resolve_pkgdatadir(ctx.files.bison_pkgdatadir) + + env = { + "BISON_PKGDATADIR": pkgdatadir, + "M4": m4.path, + } + + out_map = {} + for file, label in zip(ctx.outputs.outs, ctx.attr.outs): + _, _, relative = str(label).partition("//") + out_map["$(execpath {})".format(label)] = file + out_map["$(execpath {})".format(relative)] = file + + args = ctx.actions.args() + for arg in ctx.attr.args: + args.add_all([(ctx.expand_location(arg, ctx.attr.srcs), out_map)], map_each = _arg_map_expand_outputs) + + tools = depset(transitive = [ + _collect_tool_files(ctx.attr.m4), + _collect_tool_files(ctx.attr.bison_pkgdatadir), + ]) + + ctx.actions.run( + executable = tool, + arguments = [args], + inputs = ctx.files.srcs, + tools = tools, + outputs = ctx.outputs.outs, + mnemonic = "Bison", + env = env, + ) + + return [DefaultInfo(files = depset(ctx.outputs.outs))] + +bison = rule( + doc = """\ +Runs GNU Bison on a grammar file to produce parser source and optionally a header. + +This rule configures `BISON_PKGDATADIR` and `M4` environment variables +automatically. The interface follows the same pattern as `bazel_skylib`'s +`run_binary`: provide `srcs`, `outs`, and `args` with `$(execpath ...)` +expansions for input and output paths. + +The m4 binary and bison data directory can be overridden globally via the +`//:m4` and `//:bison_pkgdatadir` label_flags, or per-target via the `m4` +and `bison_pkgdatadir` attrs. + +Example: + load("@bison//:bison.bzl", "bison") + + bison( + name = "parser", + srcs = ["parser.y"], + outs = ["parser.c", "parser.h"], + args = ["-o", "$(execpath parser.c)", "-d", "$(execpath parser.y)"], + ) +""", + implementation = _bison_impl, + attrs = { + "args": attr.string_list( + doc = "Arguments to pass to bison. Supports $(execpath ...) for input and output paths.", + mandatory = True, + ), + "bison": attr.label( + doc = "The bison binary to use.", + default = Label("//:bison"), + cfg = "exec", + executable = True, + ), + "bison_pkgdatadir": attr.label( + doc = """\ +Bison's data directory (containing m4sugar, skeletons, etc.). If this +resolves to a single directory, it is used directly. If it resolves to +files, the path is truncated at the `data` component. Override globally +with --@bison//:bison_pkgdatadir=