Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,21 +368,28 @@ jobs:
# auto-optimize *integration* tests (tests/*.rs — each shells out to
# `perry compile`, ~4–6 min apiece, ~30 of them) are NOT run per-PR;
# they run in the nightly full job, on release tags, and on demand
# via the `run-extended-tests` label. Unit-test binaries are small,
# so builds parallelize safely (no serialization / clean churn) and
# there is no staticlib dependency to build.
# via the `run-extended-tests` label. No staticlib dependency to
# build (no integration tests).
#
# Each crate's test binary statically links the whole runtime, so
# building many at once OOMs the runner (same reason the FULL path
# uses CARGO_BUILD_JOBS=1). Serialize here too, and drop crates with
# no `src/` unit tests (their lib test binary has zero tests yet
# still pays the heavy link).
export CARGO_BUILD_JOBS=1
# perry-runtime first, single-threaded (process-global state); it is
# a lib-only crate, so filter to --lib.
if printf '%s\n' "$scope" | grep -qx 'perry-runtime'; then
RUST_TEST_THREADS=1 cargo test --lib -p perry-runtime
fi
rest="$(printf '%s\n' "$scope" | grep -vx 'perry-runtime' || true)"
rest="$(printf '%s\n' "$scope" | grep -vx 'perry-runtime' \
| python3 scripts/ci_test_scope.py --with-tests || true)"
echo "Crates with unit tests in scope:"; printf '%s\n' "$rest"
if [ -n "$rest" ]; then
# One parallel invocation across the rest of the scope. `cargo test
# --lib` errors if NO selected package has a library (a perry-only
# diff → just the bin-only `perry` crate), so include --lib only
# when some selected crate has one; --bins is always safe.
# One invocation across the rest of the scope. `cargo test --lib`
# errors if NO selected package has a library (a perry-only diff →
# just the bin-only `perry` crate), so include --lib only when some
# selected crate has one; --bins is always safe.
pkg_args="$(printf '%s\n' "$rest" | sed 's/^/-p /' | tr '\n' ' ')"
if printf '%s\n' "$rest" | python3 scripts/ci_test_scope.py --has-lib; then
target_filter="--lib --bins"
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## v0.5.1186 — fix(ci): per-PR cargo-test link-OOM — serialize fast-path links + skip zero-unit-test crates

The #5411 fast per-PR path built every affected crate's unit-test binary in one
unbounded-parallel `cargo test --lib --bins -p ...` invocation. Each test binary
statically links the whole runtime, so a wide-fan-out diff (a perry-runtime change
selects ~50 crates) linked ~50 huge binaries at once and the runner OOMed
(`linking with \`cc\` failed`) — the exact failure the FULL path avoids with
`CARGO_BUILD_JOBS=1`. Surfaced on #5402 (Tier 2 touches perry-runtime).

- `.github/workflows/test.yml` — the fast path now sets `CARGO_BUILD_JOBS=1`
(serialize the heavy links; no OOM) and filters the scope through
`ci_test_scope.py --with-tests`, dropping crates with no `src/` unit tests
(~13 zero-test FFI shims in the wide case) whose lib test binary would link the
runtime for zero tests.
- `scripts/ci_test_scope.py` — new `--with-tests` mode: prints the subset of stdin
package names whose `src/` contains a `#[test]` / `#[tokio::test]` (unit tests
the `--lib --bins` filter actually runs; integration-only crates are excluded).

## v0.5.1185 — perf(ci): make per-PR cargo-test fast (<10 min) — unit tests for affected crates; integration tests move to nightly/tags

The `cargo-test` gate took ~90 min: it built the **entire workspace** in debug,
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and LLVM for code generation.

**Current Version:** 0.5.1185
**Current Version:** 0.5.1186


## TypeScript Parity Status
Expand Down
Loading
Loading