Skip to content

refactor(ape): delegate fbuild's APE loader to running-process - #2132

Merged
zackees merged 8 commits into
mainfrom
refactor/ape-running-process-delegation
Nov 21, 2026
Merged

zackees merged 8 commits into
mainfrom
refactor/ape-running-process-delegation

Conversation

@zackees

@zackees zackees commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Supersedes #1638. This is the same migration, ported onto current main instead of the old feat/ape-host-tools stack.

What changes

fbuild stops carrying its own APE (cosmocc) loader and uses the one in running-process, which is already linked into fbuild through kernal-api 0.1.26 (zccache 1.15.8).

  • crates/fbuild-core/src/platform/ape/mod.rs becomes a 389-line adapter over running_process::ape. It keeps fbuild's policy: FBUILD_APE_LOADER, FBUILD_APE_CACHE_DIR, FBCACHE_DIR, FBUILD_CACHE_DIR and the registered cache root, in that fallback order.
  • ape/{install,native,prologue}.rs and platform/{linux,macos,windows}/ape.rs are deleted, along with the private-directory and exec-mount helpers only they used. fbuild-core drops its flate2 dependency.
  • Embedded zccache now receives the original compiler path. zccache_embedded.rs no longer swaps an APE compiler for a generated #!/bin/sh shim; it passes the loader and cache settings through the compile environment and kernal-api plans the launch.
  • platform/process.rs drops fbuild's own FORK_LOCK. shared_fork_guard() now returns running-process's fork guard, so there is one lock for loader writes and spawns instead of two that did not know about each other.
  • The workspace running-process pin gains the ape-loader feature. Versions are unchanged (running-process =4.10.16, zccache =1.15.8); no git pin.

Net: 24 files, +443 / -1800.

One behaviour change, in its own commit

fix(process): resolve relative tools against child working directory (f3f8f643): an explicit relative program path (./tool) passed to run_command with a child cwd is now resolved against that cwd before the spawn. Windows otherwise resolves it against the parent's cwd. Bare names keep PATH lookup and absolute paths are untouched. It comes with a unit test and a symlink-traversal regression test. The original PR needed it to pass on Windows (run 37146132601 failed without it, 37148075175 passed with it).

Provenance

Seven commits are cherry-picked (-x) from resume/fbuild-pr1638, authorship preserved: 6ea7f1b8, 9533dc7a, 0841f49a, 9f4b3223, 5435b4b7, c0d51a86, 7ab97c98. The only conflicts were Cargo.lock and six Cargo.toml files, all resolved to main (the old zccache git pin is not needed). One new commit refreshes Cargo.lock and ci/platform_boundary_research.tsv.

Validation (local, Linux x86_64, NixOS, no APE binfmt_misc handler)

  • soldr cargo test -p fbuild-core: 438 + 34 + 2 passed, 0 failed.
  • soldr cargo clippy -p fbuild-core -p fbuild-build-engine --all-targets -- -D warnings: clean.
  • uv run --no-sync python -m ci.run_dylint --package fbuild-core: exit 0.
  • uv run --no-project python ci/platform_boundary_research.py --check: clean.
  • Real cosmocc 4.0.2, FBUILD_TEST_COSMOCC=... soldr cargo test -p fbuild-build --test it -- ape_ --ignored: both pass, ape_gcc_compiles_through_run_command_in_hostile_env and ape_gcc_compiles_through_embedded_zccache_and_hits_cache (cold miss then warm hit, hostile PATH, unusable preferred cache dir).

Not verified

  • No hosted workflow runs the two cosmocc tests (they are #[ignore], 440 MB toolchain). On macOS and Windows this PR is covered by ci-full unit and integration lanes and the bundled hello.com APE fixture tests only, not by a real cosmocc compile.
  • macOS arm64 loader compilation (ape-m1.c via host cc) is exercised only if the hosted macOS lanes run the hello.com fixture tests.
  • A local daemon end-to-end build (fbuild build tests/platform/uno -e uno) was not run. Another agent's dev daemon held ~/.fbuild/dev/daemon/root-owner.lock for the whole session, and the daemon root is derived from the home directory with no override, so a second dev daemon could not be isolated. fbuild-cli and fbuild-daemon build, and the freshly built daemon starts and reaches the root-ownership phase through the changed detached-spawn path. Real builds are covered by the hosted ci-full build lanes.
  • soldr cargo test -p fbuild-build-engine: 597 + 1 passed, 0 failed (added after the first draft of this description).

@zackees zackees added the ci-full Run the complete release-equivalent CI matrix on this PR SHA label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zackees
zackees added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 141c60f Nov 21, 2026
159 of 167 checks passed
@zackees
zackees deleted the refactor/ape-running-process-delegation branch November 21, 2026 09:15
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run the complete release-equivalent CI matrix on this PR SHA

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant