-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Fix handling of no_std targets in doc::Std
step
#143615
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
Conversation
This comment has been minimized.
This comment has been minimized.
I think some tests need reblessing tho. |
Yeah, I'll actually need to reimplement the tests, the way I did host normalization was not working outside x64. |
Yeah, looks like that did the trick. |
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.
Thanks, a few nits
/// Additional opaque string printed in the metadata | ||
metadata: Option<String>, |
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.
Remark: I'm not so fussed about this, but maybe crates
more specifically? Though of course I suppose for many Step
s crates
doesn't make sense anyway. We'll see if more specific use cases warrant changing this.
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.
Metadata is a bit silly name here, but I just wanted this to be an opaque string that steps could just use as additional snapshot data.
@rustbot author |
Thanks! @rustbot ready |
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.
Thanks, you can r=me once PR CI is green.
@bors r=jieyouxu |
Rollup of 9 pull requests Successful merges: - #143446 (use `--dynamic-list` for exporting executable symbols) - #143590 (Fix weird rustdoc output when single and glob reexport conflict on a name) - #143599 (emit `.att_syntax` when global/naked asm use that option) - #143615 (Fix handling of no_std targets in `doc::Std` step) - #143632 (fix: correct parameter names in LLVMRustBuildMinNum and LLVMRustBuildMaxNum FFI declarations) - #143640 (Constify `Fn*` traits) - #143651 (Win: Use exceptions with empty data for SEH panic exception copies instead of a new panic) - #143660 (Disable docs for `compiler-builtins` and `sysroot`) - #143665 ([rustdoc-json] Add tests for `#[doc(hidden)]` handling of items.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #143615 - Kobzol:doc-std, r=jieyouxu Fix handling of no_std targets in `doc::Std` step The previous logic was wrong for no_std targets, it just didn't do anything. The logic was added there because by default, the `Std` step would otherwise have a list of all std crates to check, but these would fail for no_std targets. What has to happen instead is to select the default set of packages to check/doc/build, which currently happens in the `std_cargo` function, but the `self.crates` list was overriding that. In general, using `crates: Vec<String>` in the `Std` steps is quite fishy, because it's difficult to distinguish between all crates (either they are all enumerated or `crates` is empty) and the default (e.g. `x <kind> [library]`) vs a subset (e.g. `x <kind> core`). I wanted to improve that using an enum that would distinguish these situations, avoid passing `-p` for all of the crates explicitly, and unify the selection of packages to compile/check/... in `std_cargo`, based on this enum. However, I found out from some other bootstrap comments that when you pass `-p` explicitly for all crates, cargo behaves differently (apparently for check it will also check targets/examples etc. with `-p`, but not without it). Furthermore, the doc step has a special case where it does not document the `sysroot` package. So as usually, unifying this logic would get into some edge cases... So instead I opted for a seemingly simpler solution, where I try to prefilter only two allowed crates (core and alloc) for no_std targets in the `std_crates_for_run_make` function. It's not perfect, but I think it's better than the status quo (words to live by when working on bootstrap...). Fixes [this Zulip topic](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/docs.20for.20non-host.20targets.3F). r? `@jieyouxu`
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143446 (use `--dynamic-list` for exporting executable symbols) - rust-lang/rust#143590 (Fix weird rustdoc output when single and glob reexport conflict on a name) - rust-lang/rust#143599 (emit `.att_syntax` when global/naked asm use that option) - rust-lang/rust#143615 (Fix handling of no_std targets in `doc::Std` step) - rust-lang/rust#143632 (fix: correct parameter names in LLVMRustBuildMinNum and LLVMRustBuildMaxNum FFI declarations) - rust-lang/rust#143640 (Constify `Fn*` traits) - rust-lang/rust#143651 (Win: Use exceptions with empty data for SEH panic exception copies instead of a new panic) - rust-lang/rust#143660 (Disable docs for `compiler-builtins` and `sysroot`) - rust-lang/rust#143665 ([rustdoc-json] Add tests for `#[doc(hidden)]` handling of items.) r? `@ghost` `@rustbot` modify labels: rollup
The previous logic was wrong for no_std targets, it just didn't do anything. The logic was added there because by default, the
Std
step would otherwise have a list of all std crates to check, but these would fail for no_std targets. What has to happen instead is to select the default set of packages to check/doc/build, which currently happens in thestd_cargo
function, but theself.crates
list was overriding that.In general, using
crates: Vec<String>
in theStd
steps is quite fishy, because it's difficult to distinguish between all crates (either they are all enumerated orcrates
is empty) and the default (e.g.x <kind> [library]
) vs a subset (e.g.x <kind> core
). I wanted to improve that using an enum that would distinguish these situations, avoid passing-p
for all of the crates explicitly, and unify the selection of packages to compile/check/... instd_cargo
, based on this enum.However, I found out from some other bootstrap comments that when you pass
-p
explicitly for all crates, cargo behaves differently (apparently for check it will also check targets/examples etc. with-p
, but not without it). Furthermore, the doc step has a special case where it does not document thesysroot
package. So as usually, unifying this logic would get into some edge cases... So instead I opted for a seemingly simpler solution, where I try to prefilter only two allowed crates (core and alloc) for no_std targets in thestd_crates_for_run_make
function.It's not perfect, but I think it's better than the status quo (words to live by when working on bootstrap...).
Fixes this Zulip topic.
r? @jieyouxu