-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
'cargo doc --open' seemingly does nothing if target is different from forced-target #11728
Comments
Thanks for the report! Sounds like a good start to push that unstable feature forward. To fix it, we need to make this Note that now Cargo can have multiple |
@rustbot claim I will try to support it. |
For ➜ cargo-doc-forced-target git:(main) cargo doc --target riscv64gc-unknown-none-elf --target aarch64-apple-darwin --open
Finished dev [unoptimized + debuginfo] target(s) in 0.10s
error: only one `--target` argument is supported So probably we can just keep it. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hmm… I don't think so. Perhaps a warning is sufficient. However, I feel like it is out of scope of this issue and not really worth putting effort on the warning for such an unstable feature. |
I'm wondering about what the correct behavior should be for this when there is a mixture of normal and target-specific crates. If cargo generates docs for different targets, then there isn't a way to navigate between them. From the user's perspective, the docs for the other targets are essentially invisible. (And which one gets opened is kinda arbitrary.) I'm wondering if it would instead make sense to ignore the forced-target when generating documentation? A concern would be if there is target-specific documentation differences. But I would not expect those to be too common, and in theory What do people think? |
If we use
I suppose this would be quite confusing that |
I think having all of
I'd clarify that I was mostly looking for any documentation at all. IIUC documentation currently can depend on the triple but it would be pretty rare, and IMHO it's confusing to document anything this way.
|
I think it is. You can see: |
Problem
Currently if you have a
forced-target
(with-Zper-package-target
) that's not the default,cargo doc --open
builds the docs intarget/{target_name}/doc
but doesn't open it, which is confusing.Steps
riscv64gc-unknown-none-elf
cargo doc --open
Possible Solution(s)
cargo doc --target riscv64gc-unknown-none-elf --open
works. Maybe we can havecargo doc
default to that forforced-target
?I originally encountered this in a workspace. I don't really know how this should interact with workspaces, but I think it should at least work if I explicitly choose
cargo doc -p forced_target
or use e.g. a--bin
from itNotes
No response
Version
The text was updated successfully, but these errors were encountered: