From 746d60eb0498417425f7ef40493733cd23c3e526 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Franco Date: Sun, 11 Oct 2026 15:22:18 +0300 Subject: [PATCH 1/2] fix(cargo-oxide): scaffold and clone from NVIDIA/cuda-rust `cargo oxide new` wrote git = "https://github.com/NVlabs/cuda-oxide.git" into every new project's manifest. Each Cargo.lock it produced then recorded the old repository as the dependency source. The backend fallback clone, used when no cuda-device or cuda-host dependency pins a commit, fetched the same URL. Both reached the repository only through GitHub's redirect. Cached backends and existing projects are unaffected. Backend discovery reads the checkout's manifest path and never its URL, and it already handles the nested cuda-oxide/crates layout. Signed-off-by: Alejandro Soto Franco --- cuda-oxide/crates/cargo-oxide/README.md | 2 +- cuda-oxide/crates/cargo-oxide/src/backend.rs | 2 +- cuda-oxide/crates/cargo-oxide/src/backend_source.rs | 4 ++-- cuda-oxide/crates/cargo-oxide/src/commands/scaffold.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cuda-oxide/crates/cargo-oxide/README.md b/cuda-oxide/crates/cargo-oxide/README.md index ce725327f0..d4ac3610e1 100644 --- a/cuda-oxide/crates/cargo-oxide/README.md +++ b/cuda-oxide/crates/cargo-oxide/README.md @@ -418,7 +418,7 @@ When `cargo oxide` needs the `librustc_codegen_cuda.so` backend, it searches in Outside the repository the backend follows the project's `Cargo.lock`: ```text -Cargo.lock cuda-device = git+https://github.com/NVlabs/cuda-oxide.git#a1b4f118... +Cargo.lock cuda-device = git+https://github.com/NVIDIA/cuda-rust.git#a1b4f118... │ ▼ ~/.cargo/git/checkouts/cuda-oxide-*/a1b4f11/ Cargo's checkout of that commit diff --git a/cuda-oxide/crates/cargo-oxide/src/backend.rs b/cuda-oxide/crates/cargo-oxide/src/backend.rs index 321e0b5aaa..923cafdf14 100644 --- a/cuda-oxide/crates/cargo-oxide/src/backend.rs +++ b/cuda-oxide/crates/cargo-oxide/src/backend.rs @@ -1247,7 +1247,7 @@ fn auto_fetch_and_build() -> PathBuf { "clone", "--depth", "1", - "https://github.com/NVlabs/cuda-oxide.git", + "https://github.com/NVIDIA/cuda-rust.git", src_dir.to_str().unwrap(), ]) .status() diff --git a/cuda-oxide/crates/cargo-oxide/src/backend_source.rs b/cuda-oxide/crates/cargo-oxide/src/backend_source.rs index b3a9286951..db84b5c389 100644 --- a/cuda-oxide/crates/cargo-oxide/src/backend_source.rs +++ b/cuda-oxide/crates/cargo-oxide/src/backend_source.rs @@ -17,7 +17,7 @@ //! dependency instead of from a separately cloned `main`: //! //! ```text -//! Cargo.lock cuda-device = git+https://github.com/NVlabs/cuda-oxide.git# +//! Cargo.lock cuda-device = git+https://github.com/NVIDIA/cuda-rust.git# //! │ cargo metadata: package.manifest_path //! ▼ //! ~/.cargo/git/checkouts/cuda-oxide-//crates/cuda-device/Cargo.toml @@ -316,7 +316,7 @@ mod tests { use serde_json::json; use std::time::SystemTime; - const REPO: &str = "https://github.com/NVlabs/cuda-oxide.git"; + const REPO: &str = "https://github.com/NVIDIA/cuda-rust.git"; const SHA: &str = "a1b4f11882592fae9d022c86a9d8d1a4c9426980"; /// Lays out what Cargo's checkout of the repository looks like: the crate diff --git a/cuda-oxide/crates/cargo-oxide/src/commands/scaffold.rs b/cuda-oxide/crates/cargo-oxide/src/commands/scaffold.rs index 599dd86344..b6318bc438 100644 --- a/cuda-oxide/crates/cargo-oxide/src/commands/scaffold.rs +++ b/cuda-oxide/crates/cargo-oxide/src/commands/scaffold.rs @@ -11,7 +11,7 @@ use super::*; // cargo oxide new -- standalone project scaffolding // ========================================================================= -const GIT_REPO: &str = "https://github.com/NVlabs/cuda-oxide.git"; +const GIT_REPO: &str = "https://github.com/NVIDIA/cuda-rust.git"; /// crates.io release of the host-side runtime (`cuda-core`, `cuda-async`). /// In-tree examples and `cuda-host` path-depend on the git-root copies; From 3280e67c61438fb754e0f6f992662f7ac027f35b Mon Sep 17 00:00:00 2001 From: nihalpasham Date: Thu, 15 Oct 2026 13:01:48 +0530 Subject: [PATCH 2/2] cargo-oxide: finish the discovery diagrams and assert the scaffold repository URL The two backend-discovery diagrams named the new repository on the lockfile line but still showed Cargo's old checkout directory and the flat crate layout. Show the checkout as cuda-rust-/ with the backend crate and toolchain pin under cuda-oxide/, and use one placeholder throughout the README block. Add a scaffold test that both templates name https://github.com/NVIDIA/cuda-rust.git and never the old owner. It fails on the previous template and passes here. Signed-off-by: nihalpasham --- cuda-oxide/crates/cargo-oxide/README.md | 8 ++++---- .../crates/cargo-oxide/src/backend_source.rs | 8 ++++---- .../crates/cargo-oxide/src/commands/tests.rs | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/cuda-oxide/crates/cargo-oxide/README.md b/cuda-oxide/crates/cargo-oxide/README.md index d4ac3610e1..24fcf30d91 100644 --- a/cuda-oxide/crates/cargo-oxide/README.md +++ b/cuda-oxide/crates/cargo-oxide/README.md @@ -418,13 +418,13 @@ When `cargo oxide` needs the `librustc_codegen_cuda.so` backend, it searches in Outside the repository the backend follows the project's `Cargo.lock`: ```text -Cargo.lock cuda-device = git+https://github.com/NVIDIA/cuda-rust.git#a1b4f118... +Cargo.lock cuda-device = git+https://github.com/NVIDIA/cuda-rust.git# │ ▼ -~/.cargo/git/checkouts/cuda-oxide-*/a1b4f11/ Cargo's checkout of that commit - │ crates/rustc-codegen-cuda → cargo build +~/.cargo/git/checkouts/cuda-rust-*// Cargo's checkout of that commit + │ cuda-oxide/crates/rustc-codegen-cuda → cargo build ▼ -~/.cargo/cuda-oxide/librustc_codegen_cuda.so + source-rev.txt = a1b4f118... +~/.cargo/cuda-oxide/librustc_codegen_cuda.so + source-rev.txt = ``` The kernels compile against the crates at that commit and the backend that diff --git a/cuda-oxide/crates/cargo-oxide/src/backend_source.rs b/cuda-oxide/crates/cargo-oxide/src/backend_source.rs index db84b5c389..ce5888cf7c 100644 --- a/cuda-oxide/crates/cargo-oxide/src/backend_source.rs +++ b/cuda-oxide/crates/cargo-oxide/src/backend_source.rs @@ -20,11 +20,11 @@ //! Cargo.lock cuda-device = git+https://github.com/NVIDIA/cuda-rust.git# //! │ cargo metadata: package.manifest_path //! ▼ -//! ~/.cargo/git/checkouts/cuda-oxide-//crates/cuda-device/Cargo.toml -//! │ walk up to the repository root +//! ~/.cargo/git/checkouts/cuda-rust-//cuda-oxide/crates/cuda-device/Cargo.toml +//! │ walk up to the checkout root that holds the backend crate //! ▼ -//! ~/.cargo/git/checkouts/cuda-oxide-//crates/rustc-codegen-cuda built -//! ~/.cargo/git/checkouts/cuda-oxide-//rust-toolchain.toml nightly it needs +//! ~/.cargo/git/checkouts/cuda-rust-//cuda-oxide/crates/rustc-codegen-cuda built +//! ~/.cargo/git/checkouts/cuda-rust-//cuda-oxide/rust-toolchain.toml nightly it needs //! ``` //! //! The checkout's `rust-toolchain.toml` matters as much as the code: the diff --git a/cuda-oxide/crates/cargo-oxide/src/commands/tests.rs b/cuda-oxide/crates/cargo-oxide/src/commands/tests.rs index 1af0d71637..c7feab42b2 100644 --- a/cuda-oxide/crates/cargo-oxide/src/commands/tests.rs +++ b/cuda-oxide/crates/cargo-oxide/src/commands/tests.rs @@ -4878,6 +4878,21 @@ fn scaffold_gitignore_covers_every_clean_artifact_suffix() { } } +#[test] +fn scaffold_names_the_canonical_repository() { + // Both templates must name the repository the crates live in now; the + // pre-move URL resolves only through GitHub's redirect. + for async_mode in [false, true] { + let files = scaffold_files("demo_kernel", async_mode); + assert!( + files + .cargo_toml + .contains("git = \"https://github.com/NVIDIA/cuda-rust.git\"") + ); + assert!(!files.cargo_toml.contains("NVlabs")); + } +} + #[test] fn device_debug_env_value_matches_the_backend_parser() { // The exported strings must round-trip through the shared