Repository navigation
Fix cargo oxide debug executable discovery - #330
Merged
nihalpasham merged 3 commits intoJul 4, 2026
Merged
Conversation
Collaborator
|
Thanks @mohamedsamirx - using cargo’s reported executable path makes sense, and the normal single-package cases work. A couple of things to fix before this can merge:
Please add one regression test for each case. The existing artifact-path and toolkit-lookup work can stay as it is. |
Reuse Cargo compiler-artifact JSON parsing for debug builds so the debugger launches the executable Cargo actually produced instead of guessing target/release/<example>. Add debug --bin/--features parity with run and sanitize, and resolve cuda-gdb through configured CUDA toolkit roots. Signed-off-by: Mohamed Samir <[email protected]>
Signed-off-by: Mohamed Samir <[email protected]>
mohamedsamirx
force-pushed
the
fix-debug-cargo-artifact-path
branch
from
July 3, 2026 15:10
dee19c8 to
af5820f
Compare
Contributor
Author
|
Thanks @nihalpasham, addressed in the latest push. What changed:
Added regression coverage for each requested case:
Validation: cargo fmt --check
cargo test -p cargo-oxide
cargo clippy -p cargo-oxide -- -D warnings
git diff --check origin/main..HEAD |
Signed-off-by: nihalp <[email protected]>
Collaborator
|
The update version looks good. I added a quick follow-up for a few workspace and host-target edge cases we found during adversarial testing. The final branch now follows cargo's
|
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
Make
cargo oxide debuglaunch the executable Cargo actually built instead of guessing a path undertarget/release. The same artifact-selection helper is also used by the run and sanitizer paths.This also adds
debug --bin/--featuressupport and resolvescuda-gdbthrough the configured CUDA toolkit.What changed
Executable selection
package_idand target name.package.default-runand an explicit--binonly when Cargo emitted that exact artifact.--binto disambiguate multiple default members.required-featuresare handled correctly.Backend build isolation
rustc_codegen_cudaexplicitly for Cargo's host tuple in its own absolute target directory.CARGO_BUILD_TARGETsettings from the backend build.target/debugpath.cargo oxide doctorreport the corresponding host-triple path.CLI and documentation
cargo oxide debug --bin <name>and--features <features>.cuda-gdb.Safety and failure behavior
The selection rule is deliberately strict:
This prevents a successful build from causing cuda-oxide to debug a stale binary, a build-tool artifact, or a different workspace member.
Testing
cargo fmt --all -- --checkcargo test -p cargo-oxide(72 tests)cargo clippy -p cargo-oxide --all-targets -- -D warningscargo check --workspace --lockedgit diff --checksetupwith an invalid inheritedCARGO_BUILD_TARGETand a separate applicationCARGO_TARGET_DIRcargo oxide doctorresolves the host-triple backend pathRegression coverage includes configured target directories, custom bin names, virtual and non-virtual workspace defaults, multiple default members,
default-run, library-only members, dependency artifacts, duplicate bin names, missing requested targets,required-features, and stale backend-path rejection.