Skip to content

[core][gcs] Build vendored RocksDB with Make, not Ninja (fix aarch64 core build) - #64748

Merged
elliot-barn merged 2 commits into
masterfrom
elliot-barn-fix-rocksdb-ninja-aarch64
Jul 16, 2026
Merged

elliot-barn merged 2 commits into
masterfrom
elliot-barn-fix-rocksdb-ninja-aarch64

Conversation

@elliot-barn

Copy link
Copy Markdown
Collaborator

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 #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 #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

🤖 Generated with Claude Code

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]>
@elliot-barn
elliot-barn requested review from a team as code owners July 14, 2026 18:08

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread bazel/rocksdb.BUILD
# "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"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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"],
    }),

@ray-gardener ray-gardener Bot added the core Issues that should be addressed in Ray Core label Jul 14, 2026
@elliot-barn elliot-barn added the go add ONLY when ready to merge, run all tests label Jul 14, 2026
…ocksdb-ninja-aarch64

# Conflicts:
#	bazel/rocksdb.BUILD
@elliot-barn
elliot-barn merged commit 1cba51a into master Jul 16, 2026
3 checks passed
@elliot-barn
elliot-barn deleted the elliot-barn-fix-rocksdb-ninja-aarch64 branch July 16, 2026 02:57
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants