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

Pass --cfg=bootstrap for rustdoc for proc_macro crates #101921

Merged
merged 1 commit into from
Sep 17, 2022

Conversation

est31
Copy link
Member

@est31 est31 commented Sep 16, 2022

This PR does three things:

  • First, it passes --cfg=bootstrap on stage 0 for rustdoc invocations on proc_macro crates. This mirrors what we do already for rustc invocations of those, and is needed because cargo doesn't respect RUSTFLAGS or RUSTDOCFLAGS when confronted with a proc macro.
  • Second, it marks the bootstrap config variable as expected. This is needed both on later stages where it's not set, but also on stage 0, where it is set.
  • Third, it adjusts the comment in the rustc wrapper to better reflect the reason why we set the bootstrap variable as
    expected: due to recent changes, setting it as expected
    is also required even if the cfg variable is passed: ebf4cc3 .

This commit does three things:

* First, it passes --cfg=bootstrap on stage 0 for rustdoc
  invocations on proc_macro crates. This mirrors what we
  do already for rustc invocations of those, and is needed
  because cargo doesn't respect RUSTFLAGS or RUSTDOCFLAGS
  when confronted with a proc macro.
* Second, it marks the bootstrap config variable as expected.
  This is needed both on later stages where it's not set,
  but also on stage 0, where it is set.
* Third, it adjusts the comment in the rustc wrapper to better
  reflect the reason why we set the bootstrap variable as
  expected: due to recent changes, setting it as expected
  is also required even if the cfg variable is passed: ebf4cc3 .
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Sep 16, 2022
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 16, 2022
@est31
Copy link
Member Author

est31 commented Sep 16, 2022

Earlier work: #83433 and #98147

cc @Urgau

@est31 est31 mentioned this pull request Sep 16, 2022
@est31
Copy link
Member Author

est31 commented Sep 16, 2022

Most importantly, now when you do ./x.py test compiler/rustc_macros it won't give unexpected cfg errors during doctests if you have #![cfg_attr(bootstrap, ...)] in that crate, as was occuring in #93628 (comment). And it will also correctly pass --cfg=boostrap for rustc_macros if you do ./x.py test --stage 0 compiler/rustc_macros.

@joshtriplett
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 17, 2022

📌 Commit 706f0f0 has been approved by joshtriplett

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 17, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2022
Rollup of 8 pull requests

Successful merges:

 - rust-lang#101340 (Adding Fuchsia zxdb debugging walkthrough to docs)
 - rust-lang#101741 (Adding needs-unwind arg to applicable compiler ui tests)
 - rust-lang#101782 (Update `symbol_mangling` diagnostics migration)
 - rust-lang#101878 (More simple formatting)
 - rust-lang#101898 (Remove some unused CSS rules)
 - rust-lang#101911 (rustdoc: remove no-op CSS on `.source .content`)
 - rust-lang#101914 (rustdoc-json-types: Document that ResolvedPath can also be a union)
 - rust-lang#101921 (Pass --cfg=bootstrap for rustdoc for proc_macro crates)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cafca7d into rust-lang:master Sep 17, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants