-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
force compiling std from source if modified #127974
Conversation
r? bootstrap |
This comment has been minimized.
This comment has been minimized.
2e97e9f
to
fb5ce7f
Compare
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.
It seems a bit unintuitive to me that x build library
uses this logic, but x build
doesn't. Couldn't this use the same logic as rustdoc
, which checks if the library isn't modified?
We already compile |
I tested it locally, seems to work fine. We should however somehow document (?) that this only makes sense for |
This PR modifies If appropriate, please update |
@@ -136,7 +142,8 @@ impl Step for Std { | |||
compiler: run.builder.compiler(run.builder.top_stage, run.build_triple()), | |||
target: run.target, | |||
crates, | |||
force_recompile: false, | |||
// Force compiling from source as it was explicitly called with `x build library (or std/sysroot)`. | |||
force_recompile: !run.builder.paths.is_empty(), |
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.
It seems like this will be recompilation even if e.g. x.py build compiler
is passed? I'm not sure that gating on just any path is the right call. Shouldn't this use something like "is std modified?" perhaps?
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.
It seems like this will be recompilation even if e.g. x.py build compiler is passed? I'm not sure that gating on just any path is the right call.
No, that shouldn't happen.
Shouldn't this use something like "is std modified?" perhaps?
We can do that but it's not necessary in my opinion. If user explicitly asks for library build, we can do it right away without checking if "is std modified?".
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 think it's pretty confusing -- certainly against my expectations -- that the same source tree can produce different results depending on the command (x.py build vs. x.py build library, for example). I'd expect that to always yield the same results, though the path-less (x.py build
) would perhaps build more.
If we choose whether to rebuild std based on the paths provided, that violates this basic assumption that I think we have so far upheld.
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.
Changed into if modified
logic.
db181e0
to
dc87814
Compare
This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
dc87814
to
6fcc630
Compare
@bors r+ |
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#127655 (turn `invalid_type_param_default` into a `FutureReleaseErrorReportInDeps`) - rust-lang#127974 (force compiling std from source if modified) - rust-lang#128026 (std::thread: available_parallelism implementation for vxWorks proposal.) - rust-lang#128362 (add test for symbol visibility of `#[naked]` functions) - rust-lang#128500 (Add test for updating enum discriminant through pointer) - rust-lang#128630 (docs(resolve): more explain about `target`) - rust-lang#128638 (run-make: enable msvc for `link-dedup`) r? `@ghost` `@rustbot` modify labels: rollup
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#127655 (turn `invalid_type_param_default` into a `FutureReleaseErrorReportInDeps`) - rust-lang#127974 (force compiling std from source if modified) - rust-lang#128026 (std::thread: available_parallelism implementation for vxWorks proposal.) - rust-lang#128309 (Implement cursors for `BTreeSet`) - rust-lang#128500 (Add test for updating enum discriminant through pointer) - rust-lang#128630 (docs(resolve): more explain about `target`) - rust-lang#128631 (handle crates when they are not specified for std docs) - rust-lang#128638 (run-make: enable msvc for `link-dedup`) r? `@ghost` `@rustbot` modify labels: rollup
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#127655 (turn `invalid_type_param_default` into a `FutureReleaseErrorReportInDeps`) - rust-lang#127974 (force compiling std from source if modified) - rust-lang#128026 (std::thread: available_parallelism implementation for vxWorks proposal.) - rust-lang#128309 (Implement cursors for `BTreeSet`) - rust-lang#128500 (Add test for updating enum discriminant through pointer) - rust-lang#128630 (docs(resolve): more explain about `target`) - rust-lang#128638 (run-make: enable msvc for `link-dedup`) r? `@ghost` `@rustbot` modify labels: rollup
…k-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#127655 (turn `invalid_type_param_default` into a `FutureReleaseErrorReportInDeps`) - rust-lang#127907 (built-in derive: remove BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE hack and lint) - rust-lang#127974 (force compiling std from source if modified) - rust-lang#128309 (Implement cursors for `BTreeSet`) - rust-lang#128500 (Add test for updating enum discriminant through pointer) - rust-lang#128623 (Do not fire unhandled attribute assertion on multi-segment `AttributeType::Normal` attributes with builtin attribute as first segment) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#127974 - onur-ozkan:force-std-builds, r=Mark-Simulacrum force compiling std from source if modified This allows the standard library to be compiled even with `download-rustc` enabled. Which means it's no longer a requirement to compile `rustc` in order to compile `std`. Ref. rust-lang#127322 (comment). Blocker for rust-lang#122709.
This allows the standard library to be compiled even with
download-rustc
enabled. Which means it's no longer a requirement to compilerustc
in order to compilestd
.Ref. #127322 (comment).
Blocker for #122709.