Repository navigation
fix(ops): handle host rustup cargo shims correctly - #601
Rahulstark2 wants to merge 2 commits into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ce103f7. Configure here.
|
Thanks @Rahulstark2! Was there an original issue / bug report attached to this? |
|
@khaliqgant There wasn’t an original issue attached. I found the bug while testing |

Summary
RUSTUP_HOMEbefore resolving CargoProblem
ops/cargo.shcurrently setsRUSTUP_HOMEto the private toolchain directory before checking for an existing Cargo installation.On machines where Cargo is provided through a rustup shim,
command -v cargocan succeed even when the selected rustup environment cannot actually run Cargo.Because
RUSTUP_HOMEhas already been changed to the private toolchain location, the host rustup shim can look for a default toolchain in an unpopulated privateRUSTUP_HOMEand fail with:This can happen even when the host Rust installation is correctly configured and:
works normally outside the wrapper.
Changes
The wrapper now:
RUSTUP_HOMEunchanged while checking existing Cargo installationscargo --versioninstead of only checking whether the command existsRUSTUP_HOMEonly when using or bootstrapping the private toolchainThe resulting resolution order is:
Validation
rustup showrustc --versionandcargo --versionwork correctly outside the wrappercargo.shRUSTUP_HOMEwhen using the host CargoNote
Low Risk
Scoped to the Cargo wrapper’s env and discovery logic; fixes CI/dev false negatives without changing application runtime behavior.
Overview
ops/cargo.shno longer exportsRUSTUP_HOMEto the private toolchain home at startup. That early override made host rustup shims look in an empty private tree and fail with “no default toolchain configured” even when the machine’s Rust install worked outside the wrapper.Cargo resolution now treats a candidate as valid only if
cargo --versionsucceeds (PATH,CARGO_INSTALL_ROOT,~/.cargo,/usr/local/cargo, then privateCARGO_HOME).RUSTUP_HOMEis set only when probing or bootstrapping the private toolchain underRELAYFLOWS_TOOLCHAIN_HOME. If nothing usable is found, the existing bootstrap path (private install outside the propagated workspace) is unchanged.Reviewed by Cursor Bugbot for commit 617babd. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes
ops/cargo.shso the hostRUSTUP_HOMEisn't overridden before Cargo detection, which made rustup-shimmed Cargo fail with "no default toolchain configured" even when the host toolchain worked fine.cargo --versioninstead of only checking the command exists.RUSTUP_HOMEonly when using or bootstrapping the private toolchain.Written for commit ce103f7. Summary will update on new commits.