Skip to content

Commit 37d0486

Browse files
authored
ci: cap clippy peak memory by serializing the --tests lint pass (#1528)
The :rust: Lint step's `cargo clippy --tests --all` pass overlaps several ~4.5 GiB macro-heavy crates (the wp_api family) and peaks ~9 GiB. Run that pass with --jobs 1 to cap the peak at a single crate (~4.7 GiB). The first pass stays parallel — its heavy libs serialize by dependency anyway, so -j1 there would only add wall time.
1 parent 6d910f9 commit 37d0486

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
- **BREAKING:** `ShoppingCart.coupon` changed from `String` to `CouponCode`, and `ShoppingCartCostOverride.override_code` from `String` to `CostOverrideCode`, so the shopping cart and site plans describe these values with the same types. Callers will need to wrap/unwrap with `CouponCode(...)` / `CostOverrideCode(...)`.
2525
- Documented `GET /all-domains/` subtypes and parameters. `DomainSubtypeId::DefaultAddress` covers staging and garden subdomains as well as the free WordPress.com address, and is the set v1.1's `no_wpcom=true` excluded; v1.2 has no equivalent parameter, so clients filter this subtype out instead.
2626
- **Internal:** Corrected `GET /all-domains/` fixtures that claimed subtypes the endpoint never returns (`site_redirect`, `domain_mapping`).
27+
- **Internal:** Run clippy's `--tests` lint pass with `--jobs 1` to cap the Rust lint step's peak memory at ~4.7 GiB (down from ~9 GiB) on CI.
2728
- **Internal:** Build the Android JNI libraries with `cargo-ndk` instead of the `rust-android-gradle` Gradle plugin.
2829
- **Internal:** Upgraded the Android/Kotlin build to Android Gradle Plugin `9.3.0` / Gradle `9.5.0` (Kotlin `2.3.21`, `compileSdk` 36), migrating `api/android` to the AGP 9 variant APIs and splitting the example app into a `com.android.kotlin.multiplatform.library` shared module and a standalone `com.android.application` module.
2930
- **Internal:** Bumped `syn` from `2.0` to `3.0`, updating the proc-macro crates for its breaking changes.

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,16 @@ stop-server:
283283
lint: lint-rust lint-swift
284284
@# Help: Run the linter for all languages.
285285

286+
# `--jobs 1` on the --tests pass caps clippy's peak RAM. Each crate in the wp_api
287+
# family (wp_api, wp_mobile, the integration-test crates, the CLIs) costs ~4.5GB
288+
# to lint because of the wp_contextual/UniFFI macro-generated code. The first
289+
# pass's heavy libs form a dependency chain and can't overlap (peak ~4.7GB even
290+
# at the default -j), so it stays parallel. But the --tests pass builds their
291+
# independent test targets all at once, spiking to ~9GB — serializing just that
292+
# pass caps it back at one crate (~4.7GB) without paying serial-dep time twice.
286293
lint-rust:
287294
@# Help: Run the linter for Rust.
288-
$(rust_docker_run) /bin/bash -c "rustup component add clippy && cargo clippy --all -- -D warnings && cargo clippy --tests --all -- -D warnings"
295+
$(rust_docker_run) /bin/bash -c "rustup component add clippy && cargo clippy --all -- -D warnings && cargo clippy --tests --all --jobs 1 -- -D warnings"
289296

290297
lint-swift:
291298
@# Help: Run the linter for Swift.

0 commit comments

Comments
 (0)