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

patch rust-lld and ld.lld on NixOS #126692

Merged
merged 2 commits into from
Jun 27, 2024
Merged

Conversation

DianQK
Copy link
Member

@DianQK DianQK commented Jun 19, 2024

When rustc uses its self-contained lld, we also need to patch rust-lld and ld.lld.
The rpath for rust-lld is $ORIGIN/../../../:$ORIGIN/../lib, so I use --add-rpath instead of --set-rpath, which should be easier to maintain.

I also changed src/bootstrap/src/core/download.rs, even this doesn't fix any known issues.

For the lld-wrapper.sh of lld, refer to: rust-lang/rustc-dev-guide#1999.

@rustbot
Copy link
Collaborator

rustbot commented Jun 19, 2024

r? @clubby789

rustbot has assigned @clubby789.
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 Jun 19, 2024
@WaffleLapkin
Copy link
Member

cc @lqd

This does fix the "bootstrap doesn't work on nixos" issue for me.

@DianQK
Copy link
Member Author

DianQK commented Jun 25, 2024

r? @WaffleLapkin or other NixOS users

Just trying to speed up this PR. Although we can configure an external linker, we might need to develop other platforms, like Wasm, for debugging. :)

@rustbot rustbot assigned WaffleLapkin and unassigned clubby789 Jun 25, 2024
@Noratrieb
Copy link
Member

your desired nixos user is here
nixos truly is the worst operating system, this is such a mess lol
@bors r+

@bors
Copy link
Contributor

bors commented Jun 26, 2024

📌 Commit 80e43c1 has been approved by Nilstrieb

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 Jun 26, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 26, 2024
patch `rust-lld` and `ld.lld` on NixOS

When `rustc` uses its self-contained lld, we also need to patch `rust-lld` and `ld.lld`.
The `rpath` for `rust-lld` is `$ORIGIN/../../../:$ORIGIN/../lib`, so I use `--add-rpath` instead of `--set-rpath`, which should be easier to maintain.

I also changed `src/bootstrap/src/core/download.rs`, even this doesn't fix any known issues.

For the `lld-wrapper.sh` of lld, refer to: rust-lang/rustc-dev-guide#1999.
@DianQK
Copy link
Member Author

DianQK commented Jun 26, 2024

your desired nixos user is here nixos truly is the worst operating system, this is such a mess lol

But we still chose the worst operating system. 🤣

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 26, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#125016 (Update compiler_builtins to 0.1.113)
 - rust-lang#126571 (Less `maybe_whole_expr`, take 2)
 - rust-lang#126692 (patch `rust-lld` and `ld.lld` on NixOS)
 - rust-lang#126721 (coverage: Make `#[coverage(..)]` apply recursively to nested functions)
 - rust-lang#126928 (Some `Nonterminal` removal precursors)
 - rust-lang#126929 (Remove `__rust_force_expr`.)
 - rust-lang#126970 (Simplify `str::clone_into`)
 - rust-lang#126980 (set self.is_known_utf8 to false in extend_from_slice)
 - rust-lang#126983 (Remove `f16` and `f128` ICE paths from smir)

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

bors commented Jun 27, 2024

⌛ Testing commit 80e43c1 with merge 1def498...

@bors
Copy link
Contributor

bors commented Jun 27, 2024

☀️ Test successful - checks-actions
Approved by: Nilstrieb
Pushing 1def498 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 27, 2024
@bors bors merged commit 1def498 into rust-lang:master Jun 27, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 27, 2024
@DianQK DianQK deleted the nixos-patchelf branch June 27, 2024 05:53
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1def498): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 694.579s -> 696.052s (0.21%)
Artifact size: 326.68 MiB -> 326.74 MiB (0.02%)

@lqd
Copy link
Member

lqd commented Jun 27, 2024

My understanding is that the issue will be fixed by any stage0 bump, as that will disable rust-lld, but it’s great to have it already fixed for the future when it’s purposefully enabled on beta. Thanks a bunch @DianQK!

@Noratrieb
Copy link
Member

your desired nixos user is here nixos truly is the worst operating system, this is such a mess lol

But we still chose the worst operating system. 🤣

well, the other ones are worse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

8 participants