Skip to content

fix(core): give nested eBPF build.rs cargo invocation its own target dir#52

Merged
sirantd merged 2 commits into
mainfrom
fix/ebpf-build-lock-deadlock
Jul 8, 2026
Merged

fix(core): give nested eBPF build.rs cargo invocation its own target dir#52
sirantd merged 2 commits into
mainfrom
fix/ebpf-build-lock-deadlock

Conversation

@sirantd

@sirantd sirantd commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • oom-watcher/build.rs spawns a nested cargo +nightly build --package oom-watcher-ebpf while the outer cargo build --package oom-watcher (which triggers build.rs) is still holding the workspace target-dir lock. The nested process blocks acquiring that lock; build.rs blocks waiting on the nested process. Permanent deadlock.
  • Surfaced today: the release workflow's new native-arch cold-cache build hung indefinitely on both amd64 and arm64 runners at the identical point (right as oom-watcher's build.rs fires), confirming it's structural, not a fluke.
  • Fix: give the nested build its own --target-dir (target/ebpf-subbuild) so it never contends for the outer build's lock. Updated the eBPF-binary search paths and the diagnostic fallback listing to match.

Test plan

  • build.rs compiles clean (verified via cargo build --no-default-features, which still typechecks build.rs even though it takes the early-return path)
  • Merge and confirm the Release workflow's native-arch build jobs complete instead of hanging

sirantd added 2 commits July 8, 2026 12:35
The outer `cargo build` holds the workspace target-dir lock for the
whole session; build.rs's nested `cargo build --package oom-watcher-ebpf`
invocation targeted the same dir and blocked acquiring that lock, while
build.rs blocked waiting on the nested process — a permanent deadlock.
Surfaced by the release workflow's cold-cache native-arch builds hanging
indefinitely on both amd64 and arm64 at the same point (compiling
oom-watcher, right as build.rs fires).
The debug_assertions branch in source.rs still pointed at the pre-move
target/bpfel-unknown-none/... location; the previous commit relocated
the nested eBPF build to target/ebpf-subbuild/... to avoid the cargo
lock deadlock, which broke this hardcoded path for dev/test builds
(clippy and cargo test both use the debug_assertions branch).
@sirantd sirantd merged commit e028e7f into main Jul 8, 2026
6 checks passed
@sirantd sirantd deleted the fix/ebpf-build-lock-deadlock branch July 8, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant