Skip to content

[Backport release-23.11] stdenv Rust fixes#269615

Merged
emilylange merged 2 commits intorelease-23.11from
backport-268168-to-release-23.11
Nov 24, 2023
Merged

[Backport release-23.11] stdenv Rust fixes#269615
emilylange merged 2 commits intorelease-23.11from
backport-268168-to-release-23.11

Conversation

@github-actions
Copy link
Contributor

Bot-based backport to release-23.11, triggered by a label in #268168.

  • Before merging, ensure that this backport is acceptable for the release.
    • Even as a non-commiter, if you find that it is not acceptable, leave a comment.

Usually, attributes passed explicitly to elaborate take precedence
over the elaborated ones, but since we also elaborate the nested
"rust" attrset, we need to push that one level down, so the rest of
"rust" is still filled in if you just pass
{ rust = { config = ... } }.

I've had to drop the assertion that checked that at most one of "rust"
and "rustc" was part of the un-elaborated system, because doing this
broke passing an elaborated system in, which should be idempotent.

For the same reason, I've also had to make it possible for
rust.rustcTargetSpec to be passed in.  Otherwise, on the second call,
since platform was filled in by the first, the custom target file
would be constructed.  The only other way to avoid this would be to
compare the platform attrs to all built in Rust targets to check it
wasn't one of those, and that isn't feasible.

Fixes: e3e57b8 ("lib.systems: elaborate Rust metadata")
(cherry picked from commit 886c892)
The previous version stopped working when we started elaborating Rust
metadata.  Here, I've made it a bit nicer by actually setting
targetPlatform to an elaborated system.  Setting the config to wasi to
get elaborate to understand it is a bit of a hack, but I think it's
less of a hack than what we had before.

The only actual difference this makes to the rustc-wasm32 derivation
compared to the previous working version, is that now crt-static is
set.  This is probably the right thing anyway.

Fixes: e3e57b8 ("lib.systems: elaborate Rust metadata")
(cherry picked from commit a578479)
@github-actions github-actions bot requested a review from a user November 24, 2023 11:22
@github-actions github-actions bot mentioned this pull request Nov 24, 2023
13 tasks
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 24, 2023
@emilylange
Copy link
Member

Result of nixpkgs-review pr 269615 run on x86_64-linux 1

2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
6 packages built:
  • lldap
  • pagefind
  • polkadot
  • rustc-wasm32
  • rustc-wasm32.doc
  • rustc-wasm32.man

@emilylange emilylange merged commit fa2be23 into release-23.11 Nov 24, 2023
@emilylange emilylange deleted the backport-268168-to-release-23.11 branch November 24, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants