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

fix(complete): Harden --target completions #14564

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Commits on Sep 18, 2024

  1. fix(complete): Fallback to rustc if rustup fails for --target complet…

    …ions
    
    If there is any problem with rustup, we should fallback to rustc.
    
    (this also removes some extra allocations)
    epage committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    397a180 View commit details
    Browse the repository at this point in the history
  2. fix(complete): Always check rustup for --target

    clap-rs/clap#5733 removed the rustup proxy so that
    `CARGO_COMPLETE=bash cargo +nightly` works
    (with a side benefit of removing the proxy overhead).
    
    As a downside, cargo no longer knows it is running within rustup, so we
    aren't reading `--target` candidates from rustup.
    
    This changes the code to always try rustup.  It is likely a good enough
    source, even if the user isn't currently using it.
    The candidates should be about the same, just rustup hides some by
    default.
    Hiding just means it isn't shown by default but if only hidden
    candidates match, then we show them.
    epage committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    a5c25f3 View commit details
    Browse the repository at this point in the history