Stream: t-compiler/help

Topic: How do I pass rustdoc flags to x.py?


Joshua Nelson (Aug 07 2020 at 13:06, on Zulip):

Specifically I want -Z treat-err-as-bug, I'm having trouble replicating a bug with anything smaller than libproc_macro

Joshua Nelson (Aug 07 2020 at 13:09, on Zulip):

ugh, looks like there's no equivalent of RUSTFLAGS_NOT_BOOTSTRAP in bootstrap/builder.rs :face_palm: @simulacrum do you mind if I add that?

simulacrum (Aug 07 2020 at 13:09, on Zulip):

I'm confused

simulacrum (Aug 07 2020 at 13:09, on Zulip):

RUSTFLAGS_NOT_BOOTSTRAP is a thing?

Joshua Nelson (Aug 07 2020 at 13:09, on Zulip):

:laughing:

simulacrum (Aug 07 2020 at 13:10, on Zulip):

oh you want RUSTDOCFLAGS_NOT_BOOTSTRAP?

Joshua Nelson (Aug 07 2020 at 13:10, on Zulip):
        let mut rustflags = Rustflags::new(target);
        if stage != 0 {
            if let Ok(s) = env::var("CARGOFLAGS_NOT_BOOTSTRAP") {
                cargo.args(s.split_whitespace());
            }
            rustflags.env("RUSTFLAGS_NOT_BOOTSTRAP");
        } else {
            if let Ok(s) = env::var("CARGOFLAGS_BOOTSTRAP") {
                cargo.args(s.split_whitespace());
            }
            rustflags.env("RUSTFLAGS_BOOTSTRAP");
            rustflags.arg("--cfg=bootstrap");
        }
Joshua Nelson (Aug 07 2020 at 13:10, on Zulip):

yeah I want a way to pass custom arguments to rustdoc

simulacrum (Aug 07 2020 at 13:10, on Zulip):

you should be able to just use RUSTDOCFLAGS -- we'd never run rustdoc in more than one stage

simulacrum (Aug 07 2020 at 13:11, on Zulip):

(or at least not in local builds etc)

Joshua Nelson (Aug 07 2020 at 13:11, on Zulip):

nope, it was ignored :(

simulacrum (Aug 07 2020 at 13:11, on Zulip):

what do you mean? -vv doesn't show it being passed?

simulacrum (Aug 07 2020 at 13:11, on Zulip):

we don't hide it from cargo...

Joshua Nelson (Aug 07 2020 at 13:12, on Zulip):

correct

/home/joshua/rustc/build/bootstrap/debug/rustdoc --edition=2018 --crate-type lib --crate-name proc_macro library/proc_macro/src/lib.rs --target x86_64-unknown-linux-gnu -o /home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc --error-format=json --json=diagnostic-rendered-ansi --markdown-css rust.css --markdown-no-toc -Z unstable-options --resource-suffix 1.47.0 --index-page /home/joshua/rustc/src/doc/index.md -L dependency=/home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage1-std/release/deps --extern std=/home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libstd-425be41ab116c46d.rmeta -Dwarnings -Winvalid_codeblock_attributes
simulacrum (Aug 07 2020 at 13:12, on Zulip):

oh I see the problem

simulacrum (Aug 07 2020 at 13:12, on Zulip):

we do pass it

simulacrum (Aug 07 2020 at 13:12, on Zulip):

we just never read values into it from an env variable?

simulacrum (Aug 07 2020 at 13:13, on Zulip):

try using RUSTFLAGS_NOT_BOOTSTRAP -- if there's no errors in rustc that should still work

simulacrum (Aug 07 2020 at 13:13, on Zulip):

and i'd be happy to take a patch doing similar for rustdocflags

Joshua Nelson (Aug 07 2020 at 13:13, on Zulip):

oof that's rebuilding libstd

Joshua Nelson (Aug 07 2020 at 13:14, on Zulip):

ok great, I'll work on that when I get a chance

Joshua Nelson (Aug 07 2020 at 13:15, on Zulip):

opened https://github.com/rust-lang/rust/issues/75256 so I don't forget

Last update: Sep 28 2020 at 15:15UTC