Skip to content

fix(cli): respect CARGO_TARGET_DIR in openshell wrapper script#2391

Merged
drew merged 1 commit into
NVIDIA:mainfrom
jhjaggars:fix-openshell-wrapper-cargo-target-dir
Jul 21, 2026
Merged

fix(cli): respect CARGO_TARGET_DIR in openshell wrapper script#2391
drew merged 1 commit into
NVIDIA:mainfrom
jhjaggars:fix-openshell-wrapper-cargo-target-dir

Conversation

@jhjaggars

Copy link
Copy Markdown
Contributor

Summary

The scripts/bin/openshell wrapper script hardcodes the binary path to $PROJECT_ROOT/target/debug/openshell. When CARGO_TARGET_DIR is set (e.g. via .bashrc, mise, or CI config), cargo places the binary in a different directory and the wrapper fails with No such file or directory.

This fix uses ${CARGO_TARGET_DIR:-$PROJECT_ROOT/target} so the wrapper resolves the binary path correctly regardless of where build artifacts are configured to live.

Related Issue

N/A — discovered during local development setup.

Changes

  • Replaced the hardcoded $PROJECT_ROOT/target/debug/openshell binary path with ${CARGO_TARGET_DIR:-$PROJECT_ROOT/target}/debug/openshell
  • Falls back to the default target/ directory when CARGO_TARGET_DIR is not set (no behavior change for existing users)

Testing

  • Verified the unpatched wrapper fails with No such file or directory when CARGO_TARGET_DIR is set
  • Verified the patched wrapper correctly finds and executes the binary at the custom target dir
  • mise run pre-commit passes (pre-existing python:proto failure on main unrelated to this change)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

@copy-pr-bot

copy-pr-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

The scripts/bin/openshell wrapper hardcoded the binary path to
$PROJECT_ROOT/target/debug/openshell. When CARGO_TARGET_DIR is set
(e.g. via .bashrc or mise), cargo places the binary elsewhere and the
wrapper fails with 'No such file or directory'.

Use ${CARGO_TARGET_DIR:-$PROJECT_ROOT/target} so the wrapper finds
the binary regardless of where the build artifacts live.

Signed-off-by: Jesse Jaggars <jjaggars@jjaggars-kubevirt.rht.csb>
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
@jhjaggars
jhjaggars force-pushed the fix-openshell-wrapper-cargo-target-dir branch from db706ae to 6363555 Compare July 21, 2026 13:30

@elezar elezar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elezar

elezar commented Jul 21, 2026

Copy link
Copy Markdown
Member

/ok-to-test 6363555

@drew
drew added this pull request to the merge queue Jul 21, 2026
Merged via the queue into NVIDIA:main with commit bdd1ce8 Jul 21, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants