Repository navigation
[core][gcs] Build vendored RocksDB with Make, not Ninja (fix aarch64 core build) - #64748
Conversation
rocksdb.BUILD built RocksDB via rules_foreign_cc's cmake() with generate_args = ["-G Ninja"]. rules_foreign_cc 0.9.0 has no system ninja, so it bootstraps ninja from source, invoking `c++` under a scrubbed PATH (/bin:/usr/bin:/usr/local/bin). The aarch64 manylinux image has no `c++` on that PATH, so the ninja bootstrap fails with 'c++: command not found' whenever the ninja tool is not served from the Bazel remote cache -- which intermittently breaks the aarch64 'core binary parts' wheel build (green on cache hit, red on cache miss; a latent landmine once the cache entry is evicted or invalidated). Switch to CMake's Unix Makefiles generator. Make uses the preinstalled toolchain (as jemalloc/openssl already do) and needs no source bootstrap, so the build is deterministic across cache states on all architectures. The RocksDB build output (librocksdb.a) is unchanged. Regression introduced by #63657 (embedded RocksDB GCS backend, REP-64). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: elliot-barn <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request switches the CMake generator for RocksDB from Ninja to Unix Makefiles to prevent bootstrap failures on aarch64 manylinux environments. The reviewer noted that hardcoding 'Unix Makefiles' will break Windows builds where 'make' is typically unavailable, and suggested using a select statement to conditionally apply the generator based on the target operating system.
| # "c++: command not found" whenever the tool isn't served from the Bazel | ||
| # remote cache -- breaking the aarch64 core wheel build. Make uses the | ||
| # preinstalled toolchain (like jemalloc/openssl) and needs no bootstrap. | ||
| generate_args = ["-G", "Unix Makefiles"], |
There was a problem hiding this comment.
Hardcoding "Unix Makefiles" as the generator will break Windows builds if RocksDB is compiled on Windows, as make is typically not available in the standard Windows build environment (which uses MSVC).
Using a select statement allows us to safely apply Unix Makefiles on Unix-like platforms (Linux, macOS) while falling back to CMake's default generator (e.g., Visual Studio) on Windows.
generate_args = select({
"@platforms//os:windows": [],
"//conditions:default": ["-G", "Unix Makefiles"],
}),
…ocksdb-ninja-aarch64 # Conflicts: # bazel/rocksdb.BUILD
…core build) (ray-project#64748) ## Why The aarch64 `wanda: core binary parts py3.{10..14}` postmerge jobs fail intermittently with: ``` ERROR: .../rules_foreign_cc/toolchains/BUILD.bazel: BootstrapNinjaBuild ... failed /bin/sh: c++: command not found ``` ### Root cause `bazel/rocksdb.BUILD` (added in ray-project#63657, embedded RocksDB GCS backend / REP-64) builds RocksDB via `rules_foreign_cc`'s `cmake()` with `generate_args = ["-G Ninja"]`. It's the repo's only foreign_cc target using the Ninja generator. rules_foreign_cc 0.9.0 has no system ninja, so it **bootstraps ninja from source**, invoking a bare `c++` under a scrubbed `PATH=/bin:/usr/bin:/usr/local/bin`. The aarch64 manylinux2014 image has no `c++` on that PATH, so the bootstrap fails. ### Why it's intermittent The failure only bites on a Bazel **remote-cache miss** for the ninja tool. Full-suite (release-automation) postmerge history: | build | commit | aarch64 core | |-------|--------|--------------| | 18544 | `914e1a06e1` (parent of ray-project#63657) | PASS | | 18547 / 18549 / 18557 | — | FAIL | | 18561 | `3ba205c1b0` | PASS (`5932 remote cache hit`, no bootstrap) | | 18565 / 18567 | — | FAIL | Cache hit → no bootstrap → pass; cache miss → compile ninja → `c++ not found` → fail. This becomes a permanent failure once the cache entry is evicted or invalidated by a config-hash change. ## What Switch the RocksDB build from the Ninja generator to CMake's Unix Makefiles generator. Make uses the preinstalled toolchain (as the jemalloc/openssl foreign_cc builds already do) and needs no source bootstrap, so the build is deterministic across cache states on every architecture. Build output (`librocksdb.a`) is unchanged. Only the ninja *tool bootstrap* was the problem — the RocksDB compile itself uses Bazel's configured toolchain regardless of generator. ## Notes - Not caused by, but surfaced alongside, the recent deps-unification work; independent fix. - cc the ray-project#63657 / REP-64 authors — this is your build rule. If keeping Ninja is preferred, the alternative is pre-installing `ninja` in the aarch64 manylinux image (heavier: image rebuild + `MANYLINUX_VERSION` bump). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: 400Ping <[email protected]>
Why
The aarch64
wanda: core binary parts py3.{10..14}postmerge jobs fail intermittently with:Root cause
bazel/rocksdb.BUILD(added in #63657, embedded RocksDB GCS backend / REP-64) builds RocksDB viarules_foreign_cc'scmake()withgenerate_args = ["-G Ninja"]. It's the repo's only foreign_cc target using the Ninja generator. rules_foreign_cc 0.9.0 has no system ninja, so it bootstraps ninja from source, invoking a barec++under a scrubbedPATH=/bin:/usr/bin:/usr/local/bin. The aarch64 manylinux2014 image has noc++on that PATH, so the bootstrap fails.Why it's intermittent
The failure only bites on a Bazel remote-cache miss for the ninja tool. Full-suite (release-automation) postmerge history:
914e1a06e1(parent of #63657)3ba205c1b05932 remote cache hit, no bootstrap)Cache hit → no bootstrap → pass; cache miss → compile ninja →
c++ not found→ fail. This becomes a permanent failure once the cache entry is evicted or invalidated by a config-hash change.What
Switch the RocksDB build from the Ninja generator to CMake's Unix Makefiles generator. Make uses the preinstalled toolchain (as the jemalloc/openssl foreign_cc builds already do) and needs no source bootstrap, so the build is deterministic across cache states on every architecture. Build output (
librocksdb.a) is unchanged.Only the ninja tool bootstrap was the problem — the RocksDB compile itself uses Bazel's configured toolchain regardless of generator.
Notes
ninjain the aarch64 manylinux image (heavier: image rebuild +MANYLINUX_VERSIONbump).🤖 Generated with Claude Code