lib/systems/parse.nix: mkSkeletonFromList: improve readability#180964
lib/systems/parse.nix: mkSkeletonFromList: improve readability#180964Ericson2314 merged 1 commit intomasterfrom unknown repository
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
Good to go. For ease of reviewing, see the copypasta at the top of the first post. Please squash before merging, or ask me to do so. |
|
@sternenseemann should be added as a reviewer here. |
|
@sternenseemann and @Ericson2314, have you had a chance to look at this yet? There are a few PRs open (like #186484) which, if merged ahead of this one, will invalidate the proof that the behavior of |
|
Ping @sternenseemann @Ericson2314 @alyssais @nbp I want to submit other changes which will create a merge conflict with this PR. What should I do? We're starting to run into a lot more problems with calling Musl an ABI. Nixpkgs needs understand that "big-endian 64-bit powerpc on Musl always uses the ELFv2 ABI (see #182807)", but since nixpkgs thinks that Musl is an ABI there is no way to express this other than special-purpose hackery like #191436. The fact that I've radically shortened the description at the top of this PR in the hope of attracting some kind of review. |
|
@amjoseph-nixpkgs this looks good! Sorry I didn't see it for so long, Please harass me on Matrix in #cross-compiling:nixos.org to make sure this stuff gets reviewed, this is not the first time you made a good thing that went neglected by us! |
sternenseemann
left a comment
There was a problem hiding this comment.
Also did some half-elaborate sanity checking of my own which seems to check out.
One thing is that some things in parse.nix have changed since July, but I'm not sure if we need to adjust any code in here necessarily.
|
Merge conflict due to #82131. |
The main purpose of this PR is to make the basis for `mkSkeletonFromList`'s decision between `cpu-kernel-libcabi` vs `cpu-vendor-os` clear, without changing its behavior. The existing code obscures this decision behind a sequence of prioritized matches (i.e. `if-then`) which jump around between different coordinates. Two side benefits of this PR: 1. It makes the root cause of #165836 obvious: we are missing a case for `cpu-vendor-libcabi`. This is why nixpkgs stumbles over `*-none-*`. 2. It illuminates some very weird corner cases in the existing logic, like `*-${vendor}-ghcjs` overriding the `vendor` field, and `mingw32` being transformed into `windows` in some cases. Co-authored-by: John Ericson <git@JohnEricson.me>
|
Squashed, because it wasn't worth rebasing past 25 separate commits. I've added Note that freebsd can be used in the other ( |
|
Sorry we didn't merge before! :( |
|
Successfully created backport PR #202405 for |
|
Git push to origin failed for release-22.11 with exitcode 1 |
I think sterni fixed this in #202405. If not, or if I need to do anything more, ping me. |
Motivation
The main purpose of this PR is to make the basis for
mkSkeletonFromList's decision betweencpu-kernel-libcabivscpu-vendor-osclear, without changing its behavior. The existing code obscures this decision behind a sequence of prioritized matches (i.e.if-then) which jump around between different coordinates.Two side benefits of this PR:
It makes the root cause of Embedded target triplets (system, config) are used and interpreted incorrectly #165836 obvious: we are missing a case for
cpu-vendor-libcabi. This is why nixpkgs stumbles over*-none-*.It illuminates some very weird corner cases in the existing logic, like
*-${vendor}-ghcjsoverriding thevendorfield, andmingw32being transformed intowindowsin some cases.Instructions for verifying no behavior change
The diff should produce no output. You should verify that the
*-apple-*tuples removed by theegrep -vfilters are nonsensical (changing the behavior in these nonsensical cases allowed simplification -- see below for details). Here is howlib/systems/test.nixwas created:mkSkeletonFromListifclauses in the original codemkSkeletonFromListon thecartesianProductOfSetsof the attrsets.Note that if
vendoris missing from the return value ofmkSkeletonFromList,lib/systems/test.nixwill setvendor="unknown"Things done
./result/bin/)