-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 syntax errors reported when loading cargo shell completions #6874
Comments
The The feature was actually introduced in bash 2.02, controlled by the |
I'm apparently using the version that comes installed on the latest macOS. I could have sworn I used to have a more recent version installed via Homebrew... In any case, I can fix upgrade/enable the option, but if this script will fail in the same way for everyone else on stock macOS, that doesn't seem acceptable. |
Fixes #6874 Bash completion for cargo on the latest version of stock macOS produced syntax errors. More info in #6874 . This PR should fix that, but as I don't have any apple devices, I can't test it. Pinging @jimmycuadra or anyone who runs macOS: If you have the time, could you please check if applying the commit in this PR fixes the syntax error when running the stock bash that comes with macOS? Quick one-liner to apply the commit would be: ```bash patch -d "$(rustc --print sysroot)/etc/bash_completion.d/" cargo <(curl https://github.com/rust-lang/cargo/commit/e2c519dd7ac61e4d2f94cad60ef920ce4aa1718f.patch) ``` Once this PR is confirmed to work, it can marked as ready.
Update cargo 12 commits in beb8fcb5248dc2e6aa488af9613216d5ccb31c6a..759b6161a328db1d4863139e90875308ecd25a75 2019-04-30 23:58:00 +0000 to 2019-05-06 20:47:49 +0000 - Small things (rust-lang/cargo#6910) - Fix skipping over invalid registry packages (rust-lang/cargo#6912) - Fixes rust-lang/cargo#6874 (rust-lang/cargo#6905) - doc: Format examples of version to ease reading (rust-lang/cargo#6907) - fix more typos (codespell) (rust-lang/cargo#6903) - Parse less JSON on null builds (rust-lang/cargo#6880) - chore: Update opener to 0.4 (rust-lang/cargo#6902) - Update documentation for auto-discovery. (rust-lang/cargo#6898) - Update some doc links. (rust-lang/cargo#6897) - Default Cargo.toml template provide help for completing the metadata (rust-lang/cargo#6881) - Run 'cargo fmt --all' (rust-lang/cargo#6896) - Refactor command definition (rust-lang/cargo#6894)
This is a re-report of rust-lang/rustup#1799, per the comment it received.
Problem
The cargo command completion shell script produces syntax errors when loaded:
Steps
source $(rustc --print sysroot)/etc/bash_completion.d/cargo
in a shell.Possible Solution(s)
Notes
Output of
bash --version
:GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.
Output of
rustup --version
: rustup 1.18.0 (8603e2c56 2019-04-22)Output of
cargo --version
: cargo 1.34.0 (6789d8a 2019-04-01)The text was updated successfully, but these errors were encountered: