Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash completions don't work #12409

Closed
sealor opened this issue Jul 29, 2023 · 2 comments
Closed

Bash completions don't work #12409

sealor opened this issue Jul 29, 2023 · 2 comments
Labels
A-completions Area: shell completions C-bug Category: bug S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

Comments

@sealor
Copy link

sealor commented Jul 29, 2023

Problem

The Bash completions don't work because they are not be sourced correctly.

Steps

Rustup expects Bash completions in ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/etc/bash_completion.d/cargo:

$ rustup completions bash cargo
if command -v rustc >/dev/null 2>&1; then
        source "$(rustc --print sysroot)"/etc/bash_completion.d/cargo
fi

Unfortunately, the completions are not there:

$ ls -d "$(rustc --print sysroot)"/etc/bash_completion.d/cargo
ls: cannot access '/home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/etc/bash_completion.d/cargo': No such file or directory

But, the completions are here:

$ file "$(rustc --print sysroot)"/src/etc/bash_completion.d/cargo
/home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/src/etc/bash_completion.d/cargo: ASCII text

Note the /src/etc instead of just /etc.

Possible Solution(s)

The Bash completions should be placed in /etc/bash_completion.d/cargo instead of /src/etc/bash_completion.d/cargo.

Notes

No response

Version

$ cargo --version
cargo 1.71.0 (cfd3bbd8f 2023-06-08)
@sealor sealor added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Jul 29, 2023
@weihanglo
Copy link
Member

weihanglo commented Jul 29, 2023

Thanks for the report, and sorry for the inconvenience. This is a regression and planned to get a stable backport soon. See rust-lang/rustup#3407. Will keep this issue open till a new point release comes out (presumbly 1.71.1).

@rustbot label -S-triage +S-blocked-external +A-completions

@rustbot rustbot added A-completions Area: shell completions S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix and removed S-triage Status: This issue is waiting on initial triage. labels Jul 29, 2023
@weihanglo
Copy link
Member

Fixed in 1.71.1 with rust-lang/rust#113579. Thanks you for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completions Area: shell completions C-bug Category: bug S-blocked-external Status: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Projects
None yet
Development

No branches or pull requests

3 participants