Skip to content

Remove rustc's std copy#128986

Closed
Zoxc wants to merge 1 commit into
rust-lang:masterfrom
Zoxc:prune-rustc-std-copy
Closed

Remove rustc's std copy#128986
Zoxc wants to merge 1 commit into
rust-lang:masterfrom
Zoxc:prune-rustc-std-copy

Conversation

@Zoxc

@Zoxc Zoxc commented Aug 11, 2024

Copy link
Copy Markdown
Contributor

This removes rustc's std copy if we're statically linking std into rustc_driver. This copy is not needed after #122362.

try-job: dist-x86_64-linux
try-job: dist-x86_64-msvc

@rustbot

rustbot commented Aug 11, 2024

Copy link
Copy Markdown
Collaborator

r? @Kobzol

rustbot has assigned @Kobzol.
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 Aug 11, 2024
@Kobzol

Kobzol commented Aug 12, 2024

Copy link
Copy Markdown
Member

Could you please comment this line in this PR, to enable post-optimization tests in the x64 Linux dist runner? Then we can try the dist tests in try builds.

@lqd

lqd commented Aug 12, 2024

Copy link
Copy Markdown
Member

This PR is still a WIP in order to run tests/debug/try alternatives on builders, right? As it currently looks like dd3f757 which failed in the previous PR.

@Zoxc

Zoxc commented Aug 12, 2024

Copy link
Copy Markdown
Contributor Author

I haven't tracked down the reason for the test failure yet. Does post-optimization tests specify the final binary as stage0-sysroot? Then runs tests as stage0 with a new std build?

@Kobzol

Kobzol commented Aug 12, 2024

Copy link
Copy Markdown
Member

Yeah, post-optimization tests essentially take the sysroot created in the dist step, and try to run tests with it (using the "allow stage0 sysroot" hack). It is implemented here.

@Kobzol

Kobzol commented Sep 4, 2024

Copy link
Copy Markdown
Member

It seems like this could progress after #129941. I tried it locally and we can remove the stage != "0" check and do this. And then see what tests break :)

@Kobzol

Kobzol commented Sep 30, 2024

Copy link
Copy Markdown
Member

I tried to move forward with this in #112049. Currently, incremental dist tests fail on Windows when the libstd.dll file is missing (maybe it's due to some bug, e.g. too many DLL files are being removed). Trying to investigate.

@Kobzol

Kobzol commented Oct 3, 2024

Copy link
Copy Markdown
Member

Posted #131188 with some additional modifications.

@lqd

lqd commented Oct 3, 2024

Copy link
Copy Markdown
Member

Ah so we still don’t really know what’s going on to fix it "properly" on windows as well?

@Kobzol

Kobzol commented Oct 3, 2024

Copy link
Copy Markdown
Member

I have no idea why the tests fail on Windows :( https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Failing.20incr.20tests.20on.20Windows.20when.20std.2Edll.20is.20missing/near/474507064

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2024
…, r=onur-ozkan

Do not copy libstd dynamic library to sysroot

Since rust-lang#122362, rustc links statically to libstd.[so|dll]. Which means that the libstd.[so|dll] file no longer has to be in the rustc sysroot. However, we are currently still shipping this file, in every new release of Rust, for no reason, it's just wasted bytes.

This PR removes the dynamic library file from the built sysroot.

However, it is not yet performed on Windows, because stage0 incremental tests start failing there (see description of the issue [here](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Failing.20incr.20tests.20on.20Windows.20when.20std.2Edll.20is.20missing/near/474507064)).

This is an extended version of rust-lang#128986.
CC `@Zoxc`
@Kobzol

Kobzol commented Oct 5, 2024

Copy link
Copy Markdown
Member

Probably can be closed now that #131188 was merged.

@Kobzol Kobzol closed this Oct 5, 2024
@bors

bors commented Oct 5, 2024

Copy link
Copy Markdown
Collaborator

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

RalfJung pushed a commit to RalfJung/miri that referenced this pull request Oct 14, 2024
…ozkan

Do not copy libstd dynamic library to sysroot

Since rust-lang/rust#122362, rustc links statically to libstd.[so|dll]. Which means that the libstd.[so|dll] file no longer has to be in the rustc sysroot. However, we are currently still shipping this file, in every new release of Rust, for no reason, it's just wasted bytes.

This PR removes the dynamic library file from the built sysroot.

However, it is not yet performed on Windows, because stage0 incremental tests start failing there (see description of the issue [here](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Failing.20incr.20tests.20on.20Windows.20when.20std.2Edll.20is.20missing/near/474507064)).

This is an extended version of rust-lang/rust#128986.
CC `@Zoxc`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants