[BUG]: `cargo oxide setup` in a standalone project builds the project instead of the backend
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Read commands/setup_update.rs's setup and update paths, then follow the referenced context and backend functions in commands/context.rs and backend.rs. Reproduce with cargo oxide new setupdemo followed by cargo oxide setup outside the workspace. Done means setup builds and publishes the backend for the standalone project and exits successfully.
Written by the indexing model from the issue text.
Description
Description
Outside the cuda-oxide workspace, cargo oxide setup runs the backend build in the user's own crate. A cargo oxide new project fails with no library targets found in package; a library crate builds, then fails with Cargo reported no librustc_codegen_cuda.so artifact. Both exit non-zero. The backend cache is fine: resolve_context already built or validated it before setup runs, and run/build work.
Error / actual behavior
Project from cargo oxide new setupdemo (binary only):
$ cargo oxide setup
Building cuda-oxide codegen backend...
Building rustc-codegen-cuda backend...
error: no library targets found in package `setupdemo`
Failed to build rustc-codegen-cuda
$ echo $?
101
A standalone no_std kernel library (a [lib] with only cuda-device as a dependency) compiles itself, then:
Compiling t03-fmax v0.0.0 (/…/repros/t03-fmax)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.42s
Backend build succeeded, but Cargo reported no `librustc_codegen_cuda.so` artifact for rustc_codegen_cuda
$ echo $?
1
Expected behavior
setup builds (or rebuilds) and publishes the backend for this project, as cargo oxide update does outside the workspace, and exits 0. cargo oxide doctor tells a standalone user with no cached backend to "run cargo oxide setup" (cuda-oxide-book/gpu-programming/error-handling-and-debugging.md:516), so this is the command new users reach for.
Minimal reproduction example
cargo oxide new setupdemo
cd setupdemo
cargo oxide setup # exits 101
Cause
commands/context.rs:91-100: for a directory with aCargo.tomloutside the workspace,resolve_contextsetscodegen_crate: cwd.clone(), afterbackend::find_or_build_backend(&cwd, …)(context.rs:93) has already resolved the cache from the project'scuda-devicecheckout.commands/setup_update.rs:24:setupcallsbackend::build_backend_from_source(&ctx.codegen_crate), so the backend build command runs in the user's crate (backend.rs:977), andbackend_artifact_from_cargo_outputfinds norustc_codegen_cudadylib (backend.rs:994-997).
Suggested fix: when !ctx.is_workspace, have setup take update's RefreshCache route (backend::refresh_cached_backend(&ctx.workspace_root), setup_update.rs:145-155), which already builds from the dependency checkout and publishes to the cache.
Environment
- cuda-rust
mainat88e52d11707ac66cb263e7c1fdf7bb15ad68e6fc(cargo-oxide 0.3.0); the same code is at least as old as7d9c19405 - rustc 1.99.1 (58cf8f9c3 2026-10-13), LLVM 23.1.1 (toolchain
llvm-toolsllc) - CUDA 13.2 (V13.2.86), driver 595.99.02
- Ubuntu 26.04.1 LTS, x86_64
- GPU: GeForce RTX 5090 (sm_120); no GPU is needed to reproduce
cargo oxide doctor: every check passes, backend "cache built from 88e52d1170, matching this project's dependency".
- Dominant language
- Rust
- Stars
- 3.9k
- Forks
- 349
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 81
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuda-rust
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
cutile-rs supply-chain
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NVIDIA/cuda-rust#1568 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG]: The doc of trait `LoadTileLike` is incorrectPossibly taken @mangeshraut712 claimed this 5 days ago. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
NVIDIA/cuda-rust#1523 · 2 comments ·
Maintainers usually reply within 1 day
All issues in NVIDIA/cuda-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
yunfie-twitter/Palleria#474 ·
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
servo/rust-smallvec#827 ·
Maintainers usually reply within 1 day
-
bug tests
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day