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

handle no_std targets on std builds #128182

Merged
merged 4 commits into from
Jul 29, 2024
Merged

Conversation

onur-ozkan
Copy link
Member

This PR unifies the Step::run_make logic and improves it by skipping std specific crates for no_std targets. In addition, since we now handle library crates properly, bootstrap is capable of running x doc library even for no_std targets as it is able to generate documentation for alloc crate from the standard library.

Resolves #128027

cc @ChrisDenton

@rustbot
Copy link
Collaborator

rustbot commented Jul 25, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 25, 2024
@rust-log-analyzer

This comment has been minimized.

@ChrisDenton
Copy link
Member

ChrisDenton commented Jul 25, 2024

This seems to work locally on individual targets but I am getting ICEs when checking a lot of targets at once. E.g. ./x check std aarch64-kmc-solid_asp3 works on its own but when included with a large number of other targets I get:

thread 'rustc' panicked at compiler\rustc_codegen_ssa\src\back\link.rs:86:13:
compiler\rustc_codegen_ssa\src\back\link.rs:86:13: invalid output type `Executable` for target os `aarch64-kmc-solid_asp3`

I've not managed to narrowed it down but it could be there's a specific other target that's causing issues when they're used together.

@onur-ozkan
Copy link
Member Author

it could be there's a specific other target that's causing issues when they're used together.

Probably.

@onur-ozkan onur-ozkan added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2024
Comment on lines +425 to +429
// FIXME: Extend builder tests to cover the `crates` field of `Std` instances.
if cfg!(feature = "bootstrap-self-test") {
return vec![];
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional context:

macro_rules! std {
($host:ident => $target:ident, stage = $stage:literal) => {
compile::Std::new(

That above and doc_std helper macros needs to be improved to mock crates field in Std with relevant values.

@onur-ozkan
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 26, 2024
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 28, 2024

📌 Commit 47122e3 has been approved by Mark-Simulacrum

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 Jul 28, 2024
tgross35 added a commit to tgross35/rust that referenced this pull request Jul 28, 2024
…rk-Simulacrum

handle no_std targets on std builds

This PR unifies the `Step::run_make` logic and improves it by skipping std specific crates for no_std targets. In addition, since we now handle library crates properly, bootstrap is capable of running `x doc library` even for no_std targets as it is able to generate documentation for `alloc` crate from the standard library.

Resolves rust-lang#128027

cc `@ChrisDenton`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 28, 2024
Rollup of 4 pull requests

Successful merges:

 - rust-lang#109174 (Replace `io::Cursor::{remaining_slice, is_empty}`)
 - rust-lang#128147 (migrate fmt-write-bloat to rmake)
 - rust-lang#128182 (handle no_std targets on std builds)
 - rust-lang#128310 (Add missing periods on `BTreeMap` cursor `peek_next` docs)

Failed merges:

 - rust-lang#128269 (improve cargo invocations on bootstrap)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 29, 2024
Rollup of 4 pull requests

Successful merges:

 - rust-lang#109174 (Replace `io::Cursor::{remaining_slice, is_empty}`)
 - rust-lang#128147 (migrate fmt-write-bloat to rmake)
 - rust-lang#128182 (handle no_std targets on std builds)
 - rust-lang#128310 (Add missing periods on `BTreeMap` cursor `peek_next` docs)

Failed merges:

 - rust-lang#128269 (improve cargo invocations on bootstrap)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 29, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#109174 (Replace `io::Cursor::{remaining_slice, is_empty}`)
 - rust-lang#127290 (Fully document `rustdoc-json-types`)
 - rust-lang#128055 (std: unsafe-wrap personality::dwarf::eh)
 - rust-lang#128269 (improve cargo invocations on bootstrap)
 - rust-lang#128310 (Add missing periods on `BTreeMap` cursor `peek_next` docs)

Failed merges:

 - rust-lang#127543 (More unsafe attr verification)
 - rust-lang#128182 (handle no_std targets on std builds)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jul 29, 2024

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

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 29, 2024
This change unifies the `Step::run_make` logic and improves it by skipping
std specific crates for no_std targets.

Signed-off-by: onur-ozkan <[email protected]>
Since we now handle library crates properly, there's no need to panic for `no_std`
targets anymore.

`x doc library` now generates documentation for the `alloc` crate from standard library.

Signed-off-by: onur-ozkan <[email protected]>
`crates` field is handled in the `Step::make_run` just like in any other
`Std` implementation, so we don't need to resolve them in `Std::new`.

Signed-off-by: onur-ozkan <[email protected]>
@onur-ozkan onur-ozkan added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 29, 2024
@onur-ozkan
Copy link
Member Author

Rebased.

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Jul 29, 2024

📌 Commit f56d58e has been approved by Mark-Simulacrum

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 Jul 29, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 29, 2024
…rk-Simulacrum

handle no_std targets on std builds

This PR unifies the `Step::run_make` logic and improves it by skipping std specific crates for no_std targets. In addition, since we now handle library crates properly, bootstrap is capable of running `x doc library` even for no_std targets as it is able to generate documentation for `alloc` crate from the standard library.

Resolves rust-lang#128027

cc `@ChrisDenton`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 29, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#128182 (handle no_std targets on std builds)
 - rust-lang#128277 (miri: fix offset_from behavior on wildcard pointers)
 - rust-lang#128304 (Isolate the diagnostic code that expects `thir::Pat` to be printable)
 - rust-lang#128307 (Clean and enable `rustdoc::unescaped_backticks` for `core/alloc/std/test/proc_macro`)
 - rust-lang#128322 (CI: move RFL job forward to v6.11-rc1)
 - rust-lang#128333 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7e6943d into rust-lang:master Jul 29, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Jul 29, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 29, 2024
Rollup merge of rust-lang#128182 - onur-ozkan:fix-no-std-crates, r=Mark-Simulacrum

handle no_std targets on std builds

This PR unifies the `Step::run_make` logic and improves it by skipping std specific crates for no_std targets. In addition, since we now handle library crates properly, bootstrap is capable of running `x doc library` even for no_std targets as it is able to generate documentation for `alloc` crate from the standard library.

Resolves rust-lang#128027

cc ``@ChrisDenton``
@onur-ozkan onur-ozkan deleted the fix-no-std-crates branch July 29, 2024 12:32
onur-ozkan added a commit to onur-ozkan/rust that referenced this pull request Aug 4, 2024
onur-ozkan added a commit to onur-ozkan/rust that referenced this pull request Aug 4, 2024
onur-ozkan added a commit to onur-ozkan/rust that referenced this pull request Aug 4, 2024
This fixes a regression from rust-lang#128182.

Signed-off-by: onur-ozkan <[email protected]>
onur-ozkan added a commit to onur-ozkan/rust that referenced this pull request Aug 4, 2024
This fixes a regression from rust-lang#128182.

Signed-off-by: onur-ozkan <[email protected]>
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 4, 2024
handle crates when they are not specified for std docs

Fixes a regression from rust-lang#128182.

Resolves rust-lang#128610
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 4, 2024
handle crates when they are not specified for std docs

Fixes a regression from rust-lang#128182.

Resolves rust-lang#128610
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 5, 2024
handle crates when they are not specified for std docs

Fixes a regression from rust-lang#128182.

Resolves rust-lang#128610
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 5, 2024
Rollup merge of rust-lang#128631 - onur-ozkan:hotfix, r=Mark-Simulacrum

handle crates when they are not specified for std docs

Fixes a regression from rust-lang#128182.

Resolves rust-lang#128610
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.

./x check std should not try to check no_std targets
6 participants