Skip to content

Auto-Generate Tables in platform-support.md - #150571

Draft
qb42 wants to merge 9 commits into
rust-lang:mainfrom
qb42:generate-platform-support-tables
Draft

qb42 wants to merge 9 commits into
rust-lang:mainfrom
qb42:generate-platform-support-tables

Conversation

@qb42

@qb42 qb42 commented Jan 1, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

This is a rough draft inspired by @ChrisDenton in #150501 (comment). I won't have much time to work on it until next month but I wanted to get it out there.

This is implemented as an mdbook preprocessor that pulls data from the rustc_target crate, so it will always be accurate.

Assuming this works as intended (I am not set up to test locally), it's still missing the following:

  • Links to target detail pages
  • Footnotes

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 1, 2026
@rust-log-analyzer

This comment has been minimized.

@Noratrieb

Copy link
Copy Markdown
Member

This is very cool! I started a similar effort a while ago in #120745 but never got to completing it. Maybe some of the code in the linked PR thee may be useful

@qb42

qb42 commented Jan 2, 2026

Copy link
Copy Markdown
Contributor Author

@Noratrieb Thanks, I'll take a look.

@qb42
qb42 force-pushed the generate-platform-support-tables branch from 7908030 to ab9e5d8 Compare January 2, 2026 23:13
@rust-log-analyzer

This comment has been minimized.

@qb42
qb42 force-pushed the generate-platform-support-tables branch from ab9e5d8 to 8c1125f Compare January 3, 2026 07:56
@qb42

qb42 commented Jan 3, 2026

Copy link
Copy Markdown
Contributor Author

Alright, I'm set up properly now so no more failing tidy or pushing obvious mistakes.

Unfortunately it looks like depending on rustc_target directly is a dead-end, I'm getting a variety of errors related to it being a compiler-internal crate that is supposed to be compiled as part of bootstrap. The commit I just pushed (8c1125f) is my last attempt in that direction unless someone else has a solution.

I'm going to switch to pulling data from rustc -Z unstable-options --print all-target-specs-json and see how that goes.

@rust-log-analyzer

This comment has been minimized.

@Noratrieb

Copy link
Copy Markdown
Member

Executing rustc like that seems like the best approach, yes.

@qb42
qb42 force-pushed the generate-platform-support-tables branch from 8c1125f to 25ef1e7 Compare January 5, 2026 18:48
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@Dylan-DPC

Copy link
Copy Markdown
Member

@qb42 any updates on this? thanks

@qb42

qb42 commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor Author

@Dylan-DPC IIRC, the last commit I pushed worked on my machine (though without links or footnotes). I put this to the side after failing to figure out what the issue with the filepath was and forgot about it. I'll revisit in the next couple of days and see if I can get it working now I'm not in school.

@qb42
qb42 force-pushed the generate-platform-support-tables branch from 25ef1e7 to 40440b6 Compare October 9, 2026 00:16
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@qb42
qb42 force-pushed the generate-platform-support-tables branch from c4ee359 to ca4d512 Compare October 9, 2026 19:18
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Oct 9, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@qb42
qb42 force-pushed the generate-platform-support-tables branch from 27c27b9 to 280e74f Compare October 9, 2026 21:59
@rust-log-analyzer

This comment has been minimized.

@qb42
qb42 force-pushed the generate-platform-support-tables branch from 280e74f to ac2c540 Compare October 10, 2026 20:45
@rust-log-analyzer

This comment has been minimized.

@qb42
qb42 force-pushed the generate-platform-support-tables branch 5 times, most recently from 72e64b4 to adba1f3 Compare October 18, 2026 02:38
@rust-log-analyzer

This comment has been minimized.

@qb42
qb42 force-pushed the generate-platform-support-tables branch from adba1f3 to 0e7e428 Compare October 18, 2026 03:46
@rust-log-analyzer

This comment has been minimized.

Noratrieb and others added 9 commits October 18, 2026 13:55
Note: this commit was rebased from c3b05c6 onto ae0fe51
by @qb42 in 2026, the following changes were made:
 - Remove the TargetMetadata additions from compiler/rustc_target/src/spec/targets
   (more recent info had been added to main separately for all of them)
 - Skip csky targets in test-*-gnu-llvm-22 Dockerfiles instead of
   x86_64-gnu-llvm-17 Dockerfile (latter no longer exists)
 - Assorted merge conflicts, with the only non-trivial ones being in
   src/bootstrap/src/lib.rs from the added methods on Builder. The
   contents of lib.rs have also been moved to core/session.rs since the
   original commit.
Stub messages stolen from platform-support/windows-gnu.md
@qb42
qb42 force-pushed the generate-platform-support-tables branch from 0e7e428 to 53d5b3a Compare October 18, 2026 17:59
@qb42

qb42 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Hey @Noratrieb, I've been working on an updated version of your PR from 2024 and I was hoping you could take a look at it. It's still mostly yours, I just brought it up to date, cleaned it up a little, and added a few features (like optional sections). I believe the only blocker listed on your PR (not working on stage 0) is no longer relevant, since docs don't seem to be generated at all on stage 0 anymore.

The high-level of the important changes I made are:

  • Generating the table headers as well as the contents, optionally replacing the whole thing with a message if the table would be empty (I added that bit before i686-pc-windows-msvc got demoted).
  • Moving the file replacement logic in render_static to its own function, which also removes the marker comments when check_only=true. This allows the markers in SUMMARY.md to enclose the existing list, meaning that TARGET_CHECK_ONLY now fully controls whether the old or new docs are shown (instead of old or old and new smashed together).
  • Create a page listing targets without a maintainer on record.
  • Switch to using '-Zunstable-options --print all-target-specs-json' instead of querying each target individually, this sped up that stage by ~10 seconds on my machine. Collecting rustc information is still easily the slowest part, unfortunately.
  • Added support for optional sections, which you had mentioned in a comment. I'm not sure which ones should be optional so there aren't any yet and the optional constructor is commented out.
  • Allowed headers other than h2, for use as subsections. A quick grep showed some existing uses that seemed reasonable to me, but I can drop this if you prefer.

If you can remember any other features you were planning, I'll take a crack at implementing them. Otherwise, I'll get started on converting the existing docs to target_infos.

@rust-bors

rust-bors Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #165002) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants