Skip to content

Conversation

RossComputerGuy
Copy link
Member

Description of changes

Follow up to #320432

This is necessary to get some rust packages building with LLVM, notably mesa.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. label Jul 26, 2024
@RossComputerGuy RossComputerGuy force-pushed the fix/pkgsllvm/rustc-wrapper branch 5 times, most recently from b1d7c36 to 751864f Compare July 26, 2024 01:54
@ofborg ofborg bot requested review from tjni and Mic92 July 26, 2024 04:43
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jul 26, 2024
@RossComputerGuy RossComputerGuy marked this pull request as draft August 3, 2024 02:24
@RossComputerGuy RossComputerGuy force-pushed the fix/pkgsllvm/rustc-wrapper branch from 751864f to e99b72c Compare August 3, 2024 02:28
@RossComputerGuy RossComputerGuy changed the base branch from master to staging August 3, 2024 02:28
@RossComputerGuy RossComputerGuy marked this pull request as ready for review August 3, 2024 02:29
@RossComputerGuy RossComputerGuy force-pushed the fix/pkgsllvm/rustc-wrapper branch from e99b72c to 02551bf Compare August 3, 2024 02:43
@RossComputerGuy
Copy link
Member Author

rusti-cal builds, mesa which this is mainly needed for doesn't build until the deps are fixed.

@@ -26,4 +26,5 @@ if (( "${NIX_DEBUG:-0}" >= 1 )); then
printf " %q\n" "${extraAfter[@]}" >&2
fi

export NIX_LDFLAGS="@ldflags@ $NIX_LDFLAGS"
Copy link
Member

Choose a reason for hiding this comment

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

NIX_LDFLAGS_@suffixSalt@ is sometimes used for cross compiling, but it's not clear to me if we need it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I can't tell either. Maybe it'll be good to check how CC wrapper works and see if this could affect cross compiled LLVM Rust packages and if it does then add the suffix?

Copy link
Member

Choose a reason for hiding this comment

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

@Ericson2314 probably knows. But not sure if his GitHub feed is too swamped as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a blocker or can it be resolved later?

Copy link
Member

Choose a reason for hiding this comment

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

Not if nix-build -A tests.rust-hooks still succeeds.

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 10, 2024
@RossComputerGuy RossComputerGuy force-pushed the fix/pkgsllvm/rustc-wrapper branch 2 times, most recently from 4ad8701 to 38a1443 Compare January 2, 2025 22:08
@github-actions github-actions bot removed 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Jan 2, 2025
@RossComputerGuy RossComputerGuy removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 2, 2025
@RossComputerGuy RossComputerGuy force-pushed the fix/pkgsllvm/rustc-wrapper branch 2 times, most recently from 6cd78d3 to 195ebac Compare January 2, 2025 22:58
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Apr 18, 2025
@RossComputerGuy RossComputerGuy marked this pull request as draft April 18, 2025 21:06
@RossComputerGuy RossComputerGuy force-pushed the fix/pkgsllvm/rustc-wrapper branch from 18b9e2f to 9972ad4 Compare April 18, 2025 21:08
@RossComputerGuy RossComputerGuy changed the base branch from staging to master April 18, 2025 21:08
@RossComputerGuy RossComputerGuy marked this pull request as ready for review April 18, 2025 21:08
@ofborg ofborg bot added 2.status: merge conflict This PR has merge conflicts with the target branch and removed 2.status: merge conflict This PR has merge conflicts with the target branch labels Apr 18, 2025
@RossComputerGuy RossComputerGuy changed the title wrapRustcWith: fix linking with libgcc_s with llvm llvmPackages.libunwind: add fake libgcc Apr 18, 2025
Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

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

Makes sense to me. Up to you whether it makes sense to merge before #329995 is sorted.

@RossComputerGuy
Copy link
Member Author

Not sure how that PR is related but I'll sort out that PR after this one is merged. I have some ideas to improve things.

@alyssais
Copy link
Member

You mentioned it in #330037 (comment).

@RossComputerGuy
Copy link
Member Author

Oh yeah, both PR's are needed so musl builds.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 26, 2025
@RossComputerGuy RossComputerGuy requested a review from getchoo May 5, 2025 12:12
@RossComputerGuy RossComputerGuy force-pushed the fix/pkgsllvm/rustc-wrapper branch from 9972ad4 to 4f84312 Compare May 7, 2025 14:43
@RossComputerGuy RossComputerGuy merged commit 6814b2f into NixOS:master May 8, 2025
30 checks passed
@RossComputerGuy RossComputerGuy deleted the fix/pkgsllvm/rustc-wrapper branch May 8, 2025 04:07
@greg-hellings
Copy link
Contributor

So this broke the cross-compile target for pkgsCross.ucrtAarch64. Windows keeps its shared libraries under /bin with .dll extensions so this code creates broken symlinks.

I've opened #418054 to try and fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants