Repository navigation
scripts: resolve a relative CARGO_TARGET_DIR before deriving the .s path - #444
Merged
Merged
Conversation
Review follow-up to #443. Cargo resolves a relative CARGO_TARGET_DIR against the directory it runs in, while rustc resolves `--emit=asm=<path>` against the package directory, so a relative target dir made the scripts create the assembly directory in one place and ask rustc to write it in another. codegen-witness.sh runs cargo from ROOT, so a relative TD is resolved against ROOT (and exported); neon-asm-rung3.sh runs cargo from the caller's directory, so it is resolved against PWD. Absolute defaults are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ArVbbq3DsToBM7r79zGeEf
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 15 minutes. View limit details
|
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.
Follow-up to #443, addressing its three review comments (codex P2, two CodeRabbit).
What changes
#443 made both assembly scripts name their output with
--emit=asm=<path>. Cargo resolves a relativeCARGO_TARGET_DIRagainst the directory it runs in, while rustc resolves the--emitpath against the package directory. With a relative target dir, the scripts created the assembly directory in one place and asked rustc to write the file in another.scripts/codegen-witness.shruns cargo from the repository root, so a relativeTDis now resolved against the root and exported asCARGO_TARGET_DIR.scripts/neon-asm-rung3.shruns cargo from the caller's directory, so a relativeTDis now resolved againstPWD(CodeRabbit's suggestion).Absolute paths, including both defaults, are unchanged.
Verification
bash -npasses on both scripts.scripts/withCARGO_TARGET_DIR=target CARGO_ARGS='--config .cargo/config-v3.toml' ./codegen-witness.sh avx2, the witness passes. The assembly lands in<root>/target/codegen-witness/and no strayscripts/targetis created.neon-asm-rung3.shwas not re-run: it needs the aarch64 target.Generated by Claude Code