-
Notifications
You must be signed in to change notification settings - Fork 198
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
Pass cfg to build script #1580
Comments
Thanks for the report @dtolnay! @jyn514 what do you think is the right fix here? We could add |
Can't you set it with Hmm, I guess that applies it to all dependencies, too ... is that a problem for your use-case? |
Nope, cfg from |
This seems like it would be incorrect behavior, and doesn't match what I see testing it locally. I also tried building the env DOCS_RS=1 RUSTCFLAGS='--cfg procmacro2_semver_exempt' cargo rustdoc --locked --target x86_64-unknown-linux-gnu -- -Z unstable-options --cfg procmacro2_semver_exempt --cfg doc_cfg --extern-html-root-url quote=https://docs.rs/quote/1.0.10 --extern-html-root-url unicode_xid=https://docs.rs/unicode-xid/0.2.2 |
Shouldn't that be RUSTFLAGS? |
Yep, but using |
I'm really confused, copying the exact command run from the previous successful build while trying to build
|
Ok, found the reason I was having that fail too, After trying a bunch of changes I finally found the difference, the |
And for the specific failure here: rust-lang/cargo#4423. I've always assumed |
Ah, following links a little more I found https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#host-config which might be able to do what we need; |
To clarify what happened and how I think we should fix this: Prior to #1559:
After #1559:
I think we should update to apply the specified |
rust-lang/cargo#10206 has been fixed. |
#1543#1559 broke proc-macro2's documentation build — see dtolnay/proc-macro2#309.As far as I can tell the difference is that
cargo rustdoc -- --cfg mycfg
sets mycfg during both the compilation of the build.rs and the invocation of rustdoc, whereascargo rustdoc --config 'build.rustdocflags=["--cfg", "mycfg"]'
sets it only during rustdoc and not the compilation of build.rs.As far as I can tell there is now no way to set cfg for a build script build on docs.rs.
@willcrichton @jyn514
The text was updated successfully, but these errors were encountered: