treewide: Fix Meson CPU names for powerpc CPUs#13514
Conversation
e57fa7b to
ec3747f
Compare
|
Gives me lots of errors like this when trying to run the tests: So this call prolly also needs to be fixed: nix/tests/functional/meson.build Line 33 in 6ec50ba I assume I can just move Edit: Well, this turned out abit is less pretty than I was hoping… |
ec3747f to
714d40b
Compare
714d40b to
1767644
Compare
|
Oh, do the subprojects get built directly without going through the main meson.build as well? Hmm… Copy-pasting it is then :s. |
This comment was marked as resolved.
This comment was marked as resolved.
1767644 to
d2dd465
Compare
d2dd465 to
6db6190
Compare
|
@OPNA2608, which nixpkgs revision and what powerpc target triple can I use to build this? Are you using cross? |
|
I'm working on bootstrapping ELFv1 ppc64 & fixing big-endian and ABI issues with packages. I have this branch in my Nixpkgs fork with all my changes so far applied so I can continue testing builds while changes slowly work their way into Nixpkgs. I'm currently on OPNA2608/nixpkgs@c879d60 using the I'm using an old POWER machine, so not cross. I had to cross-compiled a Nix installer from x86_64 a long while ago, everything else has been built natively. |
Openssl cross doesn't seem to work there. I'll give your branch a shot for cross, but it's a pretty huge rebuild. With these changes nix builds (modulo AWS) and tests pass on |
|
Alright, so with your branch I was able to build cross nix with the patch: diff --git a/flake.nix b/flake.nix
index 2b93429e9..c08a5f5fe 100644
--- a/flake.nix
+++ b/flake.nix
@@ -54,6 +54,7 @@
# "x86_64-unknown-netbsd"
"x86_64-unknown-freebsd"
"x86_64-w64-mingw32"
+ "powerpc64-unknown-linux-gnuabielfv1"
];
stdenvs = [And your original command works: |
One of the earlier iterations previously built with passing tests. Currently checking the latest one juuust to make sure, but I think the previous one just had the obsolete |
Seems fine! |
Thanks @OPNA2608. I'll backport this up to 2.28, so that the default nix version in nixpkgs has this fix. |
…3514 treewide: Fix Meson CPU names for powerpc CPUs (backport #13514)
…3514 treewide: Fix Meson CPU names for powerpc CPUs (backport #13514)
…3514 treewide: Fix Meson CPU names for powerpc CPUs (backport #13514)
|
Argh, I didn't look at the meson docs hard enough. |
So funny thing: In Nixpkgs, under cross, it actually is a thing. I imagine due to a similar misunderstanding of these details (or just lack of interest/testing). When targeting POWER via cross, the cross file for Meson will be set up to use Oops! I'll submit a PR there to add special handling for POWER targets. |
|
Ah this is a mess. Funny thing is that MIPS does the right thing in nixpkgs. |
Nixpkgs expects the `builtin.currentSystem` for POWER CPUs to be: `powerpc[64][le]-linux` But using `host_machine.cpu_family()` for the CPU part of the system string on POWER produces this instead: `ppc[64]-linux` So evaluating Nixpkgs errors out on: `error: Unknown CPU type: ppc64` To fix this, change `ppc` -> `powerpc` `ppc64` -> `powerpc64` and append `le` if `host_machine.endian() == 'little'`. I can't actually test this on hardware rn due to hitting a kernel bug on the host system when linking big things[1], but the approach here is similar to how it was fixed in cppnix[2][3], so it *should* be fine. [1] https://git.adelielinux.org/adelie/packages/-/issues/1315 [2] NixOS/nix#13514 [3] NixOS/nix#13520 Change-Id: Ib82839cdaf2198bf18b89e82caaa1217f88e11ed
(Still building on my machine, will undraft when it finishes &
builtins.currentSystemreturns the correct value)Motivation
Meson's
cpu_family()function returnsppc*on POWER systems, while Nixpkgs expects the previously-usedpowerpc*to be the CPU name:Fix this discrepancy.
Context
Closes #12769
No real experience with Meson, so happy about better-looking suggestions.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.