From 26beba774a87448756d158dbf7642141e703150f Mon Sep 17 00:00:00 2001 From: Martin Nygren Date: Tue, 21 Jul 2026 11:58:41 +0100 Subject: [PATCH] Point the docs at .bazelversion instead of hardcoded versions The prerequisite sections named three different Bazel versions (7.x in the Python and WASM guides, 8.x in the JNI guide) and none matched the 9.1.0 pinned in .bazelversion. Defer to that file, and recommend bazelisk, which reads it automatically, so the docs cannot drift on the next bump. Also replace the hardcoded 9.1.0 in the BUILD_SYSTEM.md lockfile merge-driver URL with $(cat .bazelversion), and drop the JNI guide's claim that MODULE.bazel.lock uses lockFileVersion 28 -- it is 26, and --lockfile_mode=error already surfaces a mismatched Bazel. Co-Authored-By: Claude Opus 4.8 --- .github/copilot-instructions.md | 2 +- docs/BUILD_SYSTEM.md | 3 ++- docs/jni_interface.md | 6 +++++- docs/python_interface.md | 4 +++- docs/wasm_build.md | 6 ++++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 7a482c61..a9723ea7 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -12,7 +12,7 @@ **Current State**: Work in progress towards version 3.0. The project has been refactored from the legacy 2.9.0 codebase to use modern C++ features, Bazel build system, and modular architecture. -**Languages & Tools**: C++20, Bazel 7.x, GoogleTest for testing +**Languages & Tools**: C++20, Bazel (version pinned in `.bazelversion`), GoogleTest for testing **Repository Size**: ~50 C++ source files in library/src, ~20 test files, several examples diff --git a/docs/BUILD_SYSTEM.md b/docs/BUILD_SYSTEM.md index a4787089..41d0469f 100644 --- a/docs/BUILD_SYSTEM.md +++ b/docs/BUILD_SYSTEM.md @@ -42,8 +42,9 @@ file (do not embed it in git config) and pin the URL to the Bazel version in ```bash mkdir -p "${HOME}/.local/share/bazel" +# Run from the repo root so .bazelversion supplies the pin. curl -fsSL \ - "https://raw.githubusercontent.com/bazelbuild/bazel/9.1.0/scripts/bazel-lockfile-merge.jq" \ + "https://raw.githubusercontent.com/bazelbuild/bazel/$(cat .bazelversion)/scripts/bazel-lockfile-merge.jq" \ -o "${HOME}/.local/share/bazel/bazel-lockfile-merge.jq" # Optionally inspect: less "${HOME}/.local/share/bazel/bazel-lockfile-merge.jq" git config --global merge.bazel-lockfile-merge.name \ diff --git a/docs/jni_interface.md b/docs/jni_interface.md index 0d157248..b4509581 100644 --- a/docs/jni_interface.md +++ b/docs/jni_interface.md @@ -28,7 +28,11 @@ bindings work — see [python_interface.md](python_interface.md), `--enable-preview` is needed. The Bazel build is hermetic: `rules_java` supplies the JDK (currently pinned to `remotejdk_25` in [`.bazelrc`](../.bazelrc)); you do **not** need a system JDK installed. -- **Bazel 8.x or later.** (The committed `MODULE.bazel.lock` uses lockFileVersion 28; Bazel 7 users must delete/regenerate the lock file.) +- **Bazel as pinned in [`.bazelversion`](../.bazelversion).** Use + [bazelisk](https://github.com/bazelbuild/bazelisk), which reads that file and + fetches the matching Bazel automatically. Other versions may reject the + committed `MODULE.bazel.lock`. See + [Bazel version and MODULE.bazel.lock](BUILD_SYSTEM.md#bazel-version-and-modulebazellock). - **JVM runtime.** These FFM bindings presume a 64-bit JVM No `jextract` install is required — the bindings are hand-written (see diff --git a/docs/python_interface.md b/docs/python_interface.md index c583e889..507b28b4 100644 --- a/docs/python_interface.md +++ b/docs/python_interface.md @@ -8,7 +8,9 @@ The DDS (Double Dummy Solver) library provides a Python interface for analyzing ### Prerequisites - Python 3.10+ (tested with 3.10, 3.11, 3.12, 3.14) -- Bazel 7.x +- Bazel as pinned in [`.bazelversion`](../.bazelversion) (use + [bazelisk](https://github.com/bazelbuild/bazelisk), which picks it up + automatically) - C++ compiler (clang 15+ or GCC 11+) ### Build Instructions diff --git a/docs/wasm_build.md b/docs/wasm_build.md index 561192fa..fd850204 100644 --- a/docs/wasm_build.md +++ b/docs/wasm_build.md @@ -6,8 +6,10 @@ This document explains how to build DDS examples for WebAssembly using Bazel. ### Bazel -Bazel 7.x or later is required. Install using your package manager or download from: -https://bazel.build/install +The Bazel version is pinned in [`.bazelversion`](../.bazelversion). Use +[bazelisk](https://github.com/bazelbuild/bazelisk), which reads that file and +fetches the matching Bazel automatically: +https://github.com/bazelbuild/bazelisk The Emscripten SDK (emsdk) does NOT need to be manually installed. Bazel downloads and caches a hermetic Emscripten toolchain when you build a `wasm_cc_binary` target.