Reject embedded sandbox paths in Rust compiler outputs - #36
Merged
Conversation
dzbarsky
force-pushed
the
codex/reject-embedded-sandbox-paths
branch
4 times, most recently
from
August 5, 2026 04:58
b06be59 to
79963e6
Compare
dzbarsky
marked this pull request as ready for review
August 5, 2026 05:08
dzbarsky
force-pushed
the
codex/reject-embedded-sandbox-paths
branch
4 times, most recently
from
August 5, 2026 05:58
34e4da0 to
d940f17
Compare
Scan code-generating rustc outputs for the resolved ${pwd} value after successful compilation. Reject embedded CARGO_MANIFEST_DIR, OUT_DIR, and other sandbox paths while preserving compile-time include_str! and relative paths.
Inspect cargo_build_script OUT_DIR through test runfiles instead of retaining compile-action paths.
Assisted-by: OpenAI Codex
dzbarsky
force-pushed
the
codex/reject-embedded-sandbox-paths
branch
from
August 5, 2026 06:06
d940f17 to
231d94c
Compare
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
CARGO_MANIFEST_DIRandOUT_DIRcan contain Bazel's action working directory during compilation. Retaining either value in a Rust executable, library, or object embeds an absolute sandbox path that is invalid outside that action.${pwd}value inprocess_wrapper, using a streaming, binary-safe matcher.cc_common.linkand distributed ThinLTO objects, while excluding metadata-only actions.include_str!/include_bytes!and relative paths.OUT_DIRrunfiles instead of embedding stale compile-action paths.Validation
cc_common.linkintegration tests.CARGO_MANIFEST_DIRandOUT_DIRvalues while accepting compile-time file inclusion and relative manifest paths.AI assistance: OpenAI Codex.