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

Deal cleanly with malformed default-host #1578

Merged
merged 7 commits into from
Jan 22, 2019

Commits on Jan 16, 2019

  1. Remove panic on malformed default host

    It is better to report errors cleanly rather than panic.  If the
    default-host is set badly then we can end up panicking because
    we're unable to parse it.  Since default-host is user input, it's
    better we don't panic.
    kinnison committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    26972a5 View commit details
    Browse the repository at this point in the history
  2. Allow configuration to smoke-test itself

    In order to have useful early error messages when the configuration
    is unusably broken, allow the Cfg struct to smoke-test itself during
    `Cfg::from_env()`
    kinnison committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    87c36da View commit details
    Browse the repository at this point in the history
  3. Fix minor typo in warning

    kinnison committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    5481115 View commit details
    Browse the repository at this point in the history
  4. Add a log macro at debug level

    It can be useful to debug rustup's operation.  This comit adds a debug
    macro using BRIGHT_BLUE which only displays if RUSTUP_DEBUG is in the
    environment
    kinnison committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    983b5a6 View commit details
    Browse the repository at this point in the history
  5. Verify the provided toolchain and host triple on install

    When rustup-init is running, we need to verify that the provided
    host triple and toolchain channel can be used together to determine
    a full toolchain triple (quadruple?).  If we can't do this during
    the sanity checks, error out early.
    kinnison committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    e6a2dc9 View commit details
    Browse the repository at this point in the history
  6. Permit 'none' as a toolchain

    In order for the user to install rustup and no toolchain, we must support
    the 'none' toolchain which isn't actually a valid name.  As such whitelist
    it in the santiy checks.
    kinnison committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    239b34a View commit details
    Browse the repository at this point in the history
  7. rustup: Prevent setting an invalid default host

    Perform similar checks to when resolving toolchains in order to
    reduce the possibility that the configuration will end up with an
    unusable default-host value.  This finally addresses the initial
    point in rust-lang#745 and thus fixes it.
    
    Signed-off-by: Daniel Silverstone <[email protected]>
    kinnison committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    36ec58f View commit details
    Browse the repository at this point in the history