Xuanwo opened a new pull request, #9300:
URL: https://github.com/apache/opendal/pull/9300
# Which issue does this PR close?
N/A (fixes the ongoing `opendal` docs.rs `SandboxOOM` build failures seen on
`0.59.4` and `0.59.5`).
# Rationale for this change
`opendal` builds on docs.rs have failed across `0.59.0`–`0.59.5` due to
three classes of issues that our existing CI did not catch:
1. **`0.59.4`–`0.59.5` (`SandboxOOM`)**: docs.rs increased builder
concurrency from `-j6` to `-j12` while keeping the default 6 GiB (6.4 GB, no
swap) container memory cap. Because `opendal` sets `[package.metadata.docs.rs]
all-features = true`, docs.rs enables `services-rocksdb` -> `librocksdb-sys`,
whose build script ignores `DOCS_RS=1` and spawns 12 parallel `c++` processes
to compile RocksDB from source. `opendal` consistently OOMs in `cc1plus` after
~12 minutes, while `opendal-service-rocksdb` alone hits the 6.44 GB ceiling.
Core CI missed this because `.github/actions/setup` pre-builds RocksDB and
exports `ROCKSDB_LIB_DIR`.
2. **`0.59.1`–`0.59.3` (nightly breakage)**: docs.rs always builds with a
recent nightly, while `ci_core.yml` runs stable and `docs.yml` pins an older
nightly.
3. **`0.59.0` (missing packaged file)**: `opendal-core` failed to compile
from the packaged `.crate` tarball due to a missing `include_str!` target,
which workspace-level `cargo doc` did not detect.
Because `cargo rustdoc --lib` only needs `bindgen` to generate Rust bindings
and never links `librocksdb`, passing `--config env.ROCKSDB_LIB_DIR="/usr/lib"`
via `[package.metadata.docs.rs].cargo-args` skips compiling RocksDB C++ from
source while keeping `all-features = true` and full `Rocksdb` / `RocksdbConfig`
API documentation intact.
# What changes are included in this PR?
- Configure `cargo-args = ["--config", 'env.ROCKSDB_LIB_DIR="/usr/lib"']`
under `[package.metadata.docs.rs]` in `core/Cargo.toml` and
`core/services/rocksdb/Cargo.toml`.
- Add `.github/scripts/check_docsrs.py` (with unit tests in
`.github/scripts/test_check_docsrs.py`) to simulate docs.rs HTML and JSON
rustdoc builds inside `ghcr.io/rust-lang/crates-build-env/linux:latest` with
the real 6 GiB no-swap cap, `--network none`, read-only source mount,
`DOCS_RS=1`, and `-j12`.
- Add `.github/workflows/ci_docsrs.yml` that verifies `cargo +nightly
package --locked -p opendal-core` and runs `check_docsrs.py` for `opendal` and
`opendal-service-rocksdb`:
- Triggered on PRs touching `core/**/Cargo.toml`, `core/Cargo.lock`, or
the checker/workflow files.
- Wired into `.github/workflows/nightly_tier_a.yml` (including its
`report` job) to catch upstream nightly regressions daily.
- Wired into `.github/workflows/release_rust.yml` for RC / pre-release
checks (skipped on final release tags so an unrelated upstream nightly
regression cannot block a voted release).
- Run `test_check_docsrs.py` in `.github/workflows/ci_check.yml`.
## Verification
Reproduced against `ghcr.io/rust-lang/crates-build-env/linux:latest` with
`rustc 1.102.0-nightly (6c709eb42 2026-11-25)`, `6442450944` bytes memory/swap
cap, `--network none`, and `-j12`:
- Before: `opendal` fails with `c++: fatal error: Killed signal terminated
program cc1plus` inside `librocksdb-sys`.
- After: `check_docsrs.py` passes for both `opendal` (HTML 34s with
`struct.Rocksdb.html` / `struct.RocksdbConfig.html` generated, JSON 1s) and
`opendal-service-rocksdb` (HTML 6s, JSON 0s), and also passes under a 3 GiB
memory cap (36s).
# Are there any user-facing changes?
No public API changes. Starting with the next release, `opendal`
documentation will build and publish on docs.rs again with full `all-features`
coverage.
# Breaking changes
# AI Usage Statement
- **Harness:** pi (`@earendil-works/pi-coding-agent`)
- **Model:** Gemini 4 Neon
- **Effort:** high
- **Role:** Investigated the `0.59.0`–`0.59.5` docs.rs build failures,
reproduced the `SandboxOOM` in the `crates-build-env` container, implemented
the `cargo-args` fix and the docs.rs sandbox checker/workflow, and verified the
fix locally. GitHub Actions execution of the new `ci_docsrs.yml` workflow will
be verified on this PR's CI run.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]