-
Notifications
You must be signed in to change notification settings - Fork 203
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
Use --config build.rustdocflags instead of cargo rustdoc -- <flags> #1543
Conversation
9cb0382
to
540f290
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing this to all invocations of rustdoc is fine, but using RUSTDOCFLAGS is not the right approach, because it mangles whitespace. Please use -Zconfig, like rustcflags uses. This should also have the benefit that you don't need to change the API, just the implementation.
540f290
to
7f68e26
Compare
Ohh I understand. @jyn514 does the latest commit look like what you expect then? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, can you just remove the "this will always contain --
" comment? https://github.com/rust-lang/docs.rs/pull/1543/files#diff-8d09c60bb352ed9bc4b67f0b237ac3255c69a598110de8358647452efee1d4e3R229
7f68e26
to
6eb12ef
Compare
Done. |
I believe this has resulted in all dependencies receiving the flags specified in Most notably a commonly used |
Perhaps the solution is to carve off a whitelist of flags like |
…Actually, nevermind. I missed the distinction between |
For the --scrape-examples feature, it's important that rustdoc flags like
--static-root-path
be passed to all rustdoc invocations. This way, sources generated for reverse dependencies have the correct root path.To fix this issue, this PR changes the call to
cargo rustdoc
to move flags that were previously passed via-- <flags>
toRUSTDOCFLAGS=<flags>
.