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

Document "cargo +toolchain" syntax in cargo book? #8058

Closed
RalfJung opened this issue Mar 31, 2020 · 4 comments · Fixed by #8455
Closed

Document "cargo +toolchain" syntax in cargo book? #8058

RalfJung opened this issue Mar 31, 2020 · 4 comments · Fixed by #8455
Labels
A-documenting-cargo-itself Area: Cargo's documentation

Comments

@RalfJung
Copy link
Member

Describe the problem you are trying to solve

We got some feedback that the cargo +toolchain syntax is hard to find.

Describe the solution you'd like

It might be a good idea to mention this syntax somewhere more prominently in the cargo book.

Notes

I am aware it is a rustup feature, but that is not where people will expect it. OTOH I am not sure how the cargo team feels about having this in their docs.

Cc @ssomers

@RalfJung RalfJung added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Mar 31, 2020
@ehuss
Copy link
Contributor

ehuss commented Mar 31, 2020

Seems like a good idea to at least mention it. Is there any particular location in the documentation that you think would be a good place? A new chapter or an existing one?

Maybe Cargo could detect it is running under rustup, and include it in the help output?

@ehuss ehuss added A-documenting-cargo-itself Area: Cargo's documentation and removed C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` labels Mar 31, 2020
@ssomers
Copy link

ssomers commented Mar 31, 2020

I looked for it with "cargo --help", in the online documentation listing options, which on closer look copies the man page. I can understand the syntax doesn't belong in that static documentation, but surely the program able to handle the syntax is able to advertise it in its help (regardless of what "running under rustup" actually means)?

@RalfJung
Copy link
Member Author

RalfJung commented Mar 31, 2020

but surely the program able to handle the syntax is able to advertise it in its help (regardless of what "running under rustup" actually means)?

And it does, but that program is rustup. That's why the help appears in rustup run --help.

Your cargo binary is just a symlink to rustup. rustup then figures out the current toolchain, parsing +toolchain, and then invokes that toolchain's cargo (with +toolchain stripped).

@ssomers
Copy link

ssomers commented Apr 1, 2020

Good to know. But when disguising as cargo, and getting a --help request, rustup doesn't announce itself and doesn't squeeze in its extra option. Browsing through rustup's issues, the latest issue is clearly also about help, and the only other thing I find is another name for the syntax: toolchain keyword. So who's going to file an issue there? Meanwhile I'm looking into the help code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants