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

[WIP] Significant Refactor #18

Closed
wants to merge 2 commits into from
Closed

[WIP] Significant Refactor #18

wants to merge 2 commits into from

Conversation

naftulikay
Copy link
Owner

@naftulikay naftulikay commented Feb 13, 2019

Some of this is waiting on rust-lang/rustup#1658.

TODO

  • Support a default toolchain.
  • Support multiple toolchains.
  • Support multiple components.
  • Get rid of intermediate rustup.sh file.
  • Generate rustup completions.
  • Generate rustup man page.

@naftulikay
Copy link
Owner Author

naftulikay commented Feb 13, 2019

CLI parsing is happening here in rustup and it's clap.

@naftulikay
Copy link
Owner Author

naftulikay commented Feb 13, 2019

Some of the facts we'll need to determine:

rust_host_platform 👍 👎

rustup show will yield a first line like this:

Default host: x86_64-unknown-linux-gnu

In Jinja, we could grab this via something like

rustup_show.stdout_lines | 
    first | 
    regex_replace('(?<=^Default host\:\s)([^-]+)-([^-]+)-([^-]+)-([^-]+)', '\\1-\\2-\\3-\\4')

Or, in grep:

$ rustup show | grep -oP '(?<=^Default host\:\s)([^-]+)-([^-]+)-([^-]+)-([^-]+)'
x86_64-unknown-linux-gnu

A better way to do this would be to add a feature to rustup which just simply emits this host string directly, as changing the output of rustup would break the ability to detect this.

rustup_installed_components 🚫

Blocked on rust-lang/rustup#1659. Once this is merged and released, we can easily harvest installed components for selective installation.

rustup_installed_toolchains 👍

We can detect this now by using rustup toolchain list.

For searching within this list, we need rust_host_platform for extensions, as rustup toolchain list yields:

stable-x86_64-unknown-linux-gnu (default)
1.31.0-x86_64-unknown-linux-gnu

We want to support passing stable, nightly, 1.31.0, as well as the longer forms of stable-{{ rust_host_platform }}, etc. We can check if either {{ toolchain }} or {{ toolchain }}-{{ rust_host_platform }}.

@naftulikay naftulikay closed this Sep 16, 2019
@naftulikay naftulikay deleted the feature/conform branch September 16, 2019 23:29
@naftulikay
Copy link
Owner Author

Until rustup and cargo export JSON APIs, not worth the effort.

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.

1 participant