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

rustup allows rustup toolchain link none #3130

Closed
jyn514 opened this issue Jan 3, 2023 · 2 comments · Fixed by #3340
Closed

rustup allows rustup toolchain link none #3130

jyn514 opened this issue Jan 3, 2023 · 2 comments · Fixed by #3340

Comments

@jyn514
Copy link
Member

jyn514 commented Jan 3, 2023

Problem

This is not necessarily a bug, but it seems very confusing.

; rustup default none
info: default toolchain unset
; rustup toolchain link none build/aarch64-unknown-linux-gnu/stage0
; cargo
error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
; cargo +none --version
cargo 1.67.0-beta.3 (f6e737b1e 2022-12-02)

Steps

  1. Clone rust-lang/rust and run `./x.py --help
  2. Run rustup toolchain link none build/aarch64-unknown-linux-gnu/stage0 (as appropriate for your host triple)
  3. Run cargo +none --version

Possible Solution(s)

I think disallowing none for a custom toolchain name would be easier to understand, something like the existing error for reserved channel names:

; rustup toolchain link stable build/aarch64-unknown-linux-gnu/stage0
error: invalid custom toolchain name: 'stable-aarch64-unknown-linux-gnu'

Notes

No response

Rustup version

rustup 1.25.1 (bb60b1e89 2022-07-12)

Installed toolchains

> rustup show -v
Default host: aarch64-unknown-linux-gnu
rustup home:  /home/gh-jyn514/.local/lib/rustup

installed toolchains
--------------------

error: no default toolchain configured

(this seems like a second bug: I definitely have at least nightly installed.)

@ashutoshvarma
Copy link

@rustbot claim
@jyn514 If I understand right, setting none should not be allowed as custom toolchain name and should just simply throw an error?

@jyn514
Copy link
Member Author

jyn514 commented Jan 17, 2023

That's what I would expect, yes.

rbtcollins added a commit to rbtcollins/rustup.rs that referenced this issue May 7, 2023
Relative path overrides permit a freshly downloaded source tree to
execute arbitrary code on any rustup command that executes a binary from
the configured toolchain, and its a reasonable tradeoff for us to remove
this feature. Absolute path overrides are kept intact - these were added
to support users of large monorepo tool systems, and can be kept with
reasonable safety.

Introduce an interior model for toolchain names which allows the
elimination of conditional code for custom vs named vs path based
toolchains. Fixes rust-lang#3130.

Finishes the separation of Toolchain vs DistributableToolchain vs
CustomToolchain started some time ago.

Moves some test support into the src tree in order to keep symbols
private and adds a 'test' feature required for self-testing, ensuring
that that code doesn't affect production builds.
rbtcollins added a commit to rbtcollins/rustup.rs that referenced this issue May 7, 2023
Relative path overrides permit a freshly downloaded source tree to
execute arbitrary code on any rustup command that executes a binary from
the configured toolchain, and its a reasonable tradeoff for us to remove
this feature. Absolute path overrides are kept intact - these were added
to support users of large monorepo tool systems, and can be kept with
reasonable safety.

Introduce an interior model for toolchain names which allows the
elimination of conditional code for custom vs named vs path based
toolchains. Fixes rust-lang#3130.

Finishes the separation of Toolchain vs DistributableToolchain vs
CustomToolchain started some time ago.

Moves some test support into the src tree in order to keep symbols
private and adds a 'test' feature required for self-testing, ensuring
that that code doesn't affect production builds.
rbtcollins added a commit to rbtcollins/rustup.rs that referenced this issue May 7, 2023
Relative path overrides permit a freshly downloaded source tree to
execute arbitrary code on any rustup command that executes a binary from
the configured toolchain, and its a reasonable tradeoff for us to remove
this feature. Absolute path overrides are kept intact - these were added
to support users of large monorepo tool systems, and can be kept with
reasonable safety.

Introduce an interior model for toolchain names which allows the
elimination of conditional code for custom vs named vs path based
toolchains. Fixes rust-lang#3130.

Finishes the separation of Toolchain vs DistributableToolchain vs
CustomToolchain started some time ago.

Moves some test support into the src tree in order to keep symbols
private and adds a 'test' feature required for self-testing, ensuring
that that code doesn't affect production builds.
rbtcollins added a commit to rbtcollins/rustup.rs that referenced this issue May 7, 2023
Relative path overrides permit a freshly downloaded source tree to
execute arbitrary code on any rustup command that executes a binary from
the configured toolchain, and its a reasonable tradeoff for us to remove
this feature. Absolute path overrides are kept intact - these were added
to support users of large monorepo tool systems, and can be kept with
reasonable safety.

Introduce an interior model for toolchain names which allows the
elimination of conditional code for custom vs named vs path based
toolchains. Fixes rust-lang#3130.

Finishes the separation of Toolchain vs DistributableToolchain vs
CustomToolchain started some time ago.

Moves some test support into the src tree in order to keep symbols
private and adds a 'test' feature required for self-testing, ensuring
that that code doesn't affect production builds.

Changes the CI debug builds to use the new test feature and also otel,
so that otel doesn't bitrot.
rbtcollins added a commit to rbtcollins/rustup.rs that referenced this issue May 7, 2023
Relative path overrides permit a freshly downloaded source tree to
execute arbitrary code on any rustup command that executes a binary from
the configured toolchain, and its a reasonable tradeoff for us to remove
this feature. Absolute path overrides are kept intact - these were added
to support users of large monorepo tool systems, and can be kept with
reasonable safety.

Introduce an interior model for toolchain names which allows the
elimination of conditional code for custom vs named vs path based
toolchains. Fixes rust-lang#3130.

Finishes the separation of Toolchain vs DistributableToolchain vs
CustomToolchain started some time ago.

Moves some test support into the src tree in order to keep symbols
private and adds a 'test' feature required for self-testing, ensuring
that that code doesn't affect production builds.

Changes the CI debug builds to use the new test feature and also otel,
so that otel doesn't bitrot.
rbtcollins added a commit to rbtcollins/rustup.rs that referenced this issue May 10, 2023
Relative path overrides permit a freshly downloaded source tree to
execute arbitrary code on any rustup command that executes a binary from
the configured toolchain, and its a reasonable tradeoff for us to remove
this feature. Absolute path overrides are kept intact - these were added
to support users of large monorepo tool systems, and can be kept with
reasonable safety.

Introduce an interior model for toolchain names which allows the
elimination of conditional code for custom vs named vs path based
toolchains. Fixes rust-lang#3130.

Finishes the separation of Toolchain vs DistributableToolchain vs
CustomToolchain started some time ago.

Moves some test support into the src tree in order to keep symbols
private and adds a 'test' feature required for self-testing, ensuring
that that code doesn't affect production builds.

Changes the CI debug builds to use the new test feature and also otel,
so that otel doesn't bitrot.
rbtcollins added a commit to rbtcollins/rustup.rs that referenced this issue May 15, 2023
Relative path overrides permit a freshly downloaded source tree to
execute arbitrary code on any rustup command that executes a binary from
the configured toolchain, and its a reasonable tradeoff for us to remove
this feature. Absolute path overrides are kept intact - these were added
to support users of large monorepo tool systems, and can be kept with
reasonable safety.

Introduce an interior model for toolchain names which allows the
elimination of conditional code for custom vs named vs path based
toolchains. Fixes rust-lang#3130.

Finishes the separation of Toolchain vs DistributableToolchain vs
CustomToolchain started some time ago.

Moves some test support into the src tree in order to keep symbols
private and adds a 'test' feature required for self-testing, ensuring
that that code doesn't affect production builds.

Changes the CI debug builds to use the new test feature and also otel,
so that otel doesn't bitrot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment