fix(core): give nested eBPF build.rs cargo invocation its own target dir#52
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
oom-watcher/build.rsspawns a nestedcargo +nightly build --package oom-watcher-ebpfwhile the outercargo 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.amd64andarm64runners at the identical point (right asoom-watcher's build.rs fires), confirming it's structural, not a fluke.--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.rscompiles clean (verified viacargo build --no-default-features, which still typechecks build.rs even though it takes the early-return path)