-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Introduce infrastructure for generating target docs #121051
base: master
Are you sure you want to change the base?
Conversation
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
1623f03
to
1b9afad
Compare
This comment has been minimized.
This comment has been minimized.
this is a very funny failure, sadly I cannot reproduce it locally. |
@Nilstrieb The issue is when it runs It tries to print the error "No available targets are compatible with triple "csky-unknown-linux-gnuabiv2"". However, one of the arguments is a SmallCStr which is created from a CStr. I believe there is a bug here where I can maybe try to post a fix for the panic later tonight. I don't know how best to handle the problem with LLVM 16 not supporting the target. Perhaps |
Posted #121125 so it at least doesn't ICE. |
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.
I really like this approach. I think the only feedback I've got is about where some of the specific bits of information go.
This approach shines with the overlapping documentation based with patterns, but if you need to have some information for each target (like tier, maintainers, descriptive name, supports std, etc.) and have to make documentation for every target anyway, then you lose some of that benefit.
I think I'd like to see us experiment with putting some of that information into the target specification, and then have a way of dumping that from the compiler (like you do with the cfgs now).
I like that. We could even print the short description with |
…idtwco Add a `description` field to target definitions Starts addressing rust-lang#121051 (review) This is the short description (`64-bit MinGW (Windows 7+)`) including the platform requirements. The reason for doing it like this is that this PR will be quite prone to conflicts whenever targets get added, so it should be as simple as possible to get it merged. Future PRs which migrate targets are scoped to groups of targets, so they will not conflict as they can just touch these. This moves some of the information from the rustc book into the compiler. It cannot be queried yet, that is future work. It is also future work to fill out all the descriptions, which will coincide with the work of moving over existing target docs to the new format. r? `@davidtwco` but anyone is also free to steal it
…idtwco Add a `description` field to target definitions Starts addressing rust-lang#121051 (review) This is the short description (`64-bit MinGW (Windows 7+)`) including the platform requirements. The reason for doing it like this is that this PR will be quite prone to conflicts whenever targets get added, so it should be as simple as possible to get it merged. Future PRs which migrate targets are scoped to groups of targets, so they will not conflict as they can just touch these. This moves some of the information from the rustc book into the compiler. It cannot be queried yet, that is future work. It is also future work to fill out all the descriptions, which will coincide with the work of moving over existing target docs to the new format. r? ``@davidtwco`` but anyone is also free to steal it
…idtwco Add a `description` field to target definitions Starts addressing rust-lang#121051 (review) This is the short description (`64-bit MinGW (Windows 7+)`) including the platform requirements. The reason for doing it like this is that this PR will be quite prone to conflicts whenever targets get added, so it should be as simple as possible to get it merged. Future PRs which migrate targets are scoped to groups of targets, so they will not conflict as they can just touch these. This moves some of the information from the rustc book into the compiler. It cannot be queried yet, that is future work. It is also future work to fill out all the descriptions, which will coincide with the work of moving over existing target docs to the new format. r? ```@davidtwco``` but anyone is also free to steal it
…twco Add a `description` field to target definitions Starts addressing rust-lang#121051 (review) This is the short description (`64-bit MinGW (Windows 7+)`) including the platform requirements. The reason for doing it like this is that this PR will be quite prone to conflicts whenever targets get added, so it should be as simple as possible to get it merged. Future PRs which migrate targets are scoped to groups of targets, so they will not conflict as they can just touch these. This moves some of the information from the rustc book into the compiler. It cannot be queried yet, that is future work. It is also future work to fill out all the descriptions, which will coincide with the work of moving over existing target docs to the new format. r? `@davidtwco` but anyone is also free to steal it
This comment was marked as resolved.
This comment was marked as resolved.
this is blocked on work on the tracking issue |
These commits modify compiler targets. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#120557 (Add rust-lldb pretty printing for Path and PathBuf) - rust-lang#121051 (Introduce infrastructure for generating target docs) - rust-lang#122892 (fix(bootstrap/dist): use versioned dirs when vendoring) - rust-lang#122896 (Update stdarch submodule) - rust-lang#122923 (In `pretty_print_type()`, print `async fn` futures' paths instead of spans.) - rust-lang#122970 (Use `chunk_by` when building `ReverseSccGraph`) - rust-lang#123003 (CFI: Handle dyn with no principal) r? `@ghost` `@rustbot` modify labels: rollup
#123010 (comment) @Nilstrieb I think this was yours, unfortunately. @bors r- |
@rollup=iffy |
Checking this change out on Windows was failing - |
I see, Windows exists. Good point. I changed the filename to use |
…ng, r=compiler-errors Let nils know about changes to target docs i'll probably expand the paths and add a message after rust-lang#121051 but i honestly don't expect that to land very soon lol, so it would be nice to get notified about changes already and watch what's happening there approve this pr if you're cool
…ng, r=compiler-errors Let nils know about changes to target docs i'll probably expand the paths and add a message after rust-lang#121051 but i honestly don't expect that to land very soon lol, so it would be nice to get notified about changes already and watch what's happening there approve this pr if you're cool
Rollup merge of rust-lang#123142 - Nilstrieb:nils-knows-whats-happening, r=compiler-errors Let nils know about changes to target docs i'll probably expand the paths and add a message after rust-lang#121051 but i honestly don't expect that to land very soon lol, so it would be nice to get notified about changes already and watch what's happening there approve this pr if you're cool
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.
Changes in the last push seems solid. Can we add unit test in parse/tests.rs
for the logic here?
rust/src/tools/target-docs/src/parse.rs
Lines 87 to 93 in 1219d99
let expected_file_name = frontmatter.pattern.replace('*', "_"); | |
if expected_file_name != file_name { | |
bail!( | |
"`target pattern does not match file name. file name must be pattern with `*` replaced with `_`.\n\ | |
Expected file name `{expected_file_name}.md`" | |
); | |
} |
Well, why |
r=me with this comment resolved and if it isn't hard to use |
@onur-ozkan lol, thanks for mentioning the tests, I completely forgot about them and had to fix them Another thing: I had to add this check: It was already kinda broken, lint-docs emitted warnings about things not quite matching up, so I don't think this should break anything and if it does it's good that it's broken. |
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #125023) made this pull request unmergeable. Please resolve the merge conflicts. |
This behavior was intentional, and I'm a little concerned about changing it. We want to be able to build documentation with stage 0 (#73964 has some more context on that). The lint docs were designed to handle that case. Changing that causes Is it possible to have the target docs also just generate degraded output if using stage 0? |
For now, we could just skip building target docs at |
@Noratrieb Any updates on this? Thanks |
See #120745
It's highly unlikely that the format is optimal, but it's okay at least and can always be improved. Mostly posting this to get something working so we can continue.
Use
TARGET_CHECK_ONLY=0
to actually build the book instead of just checking the new docs.r? @davidtwco