NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18k stars 14.01k forks source link

Nixpkgs/stdenv on powerpc64-linux (big-endian) #253715

Open OPNA2608 opened 1 year ago

OPNA2608 commented 1 year ago

A tracking issue? Roadmap? TODO list? Notes? of sorts for things that need to be handled in order to get Nixpkgs¹ working natively on powerpc64-linux (the big-endian variant, not powerpc64le-linux). I could immediately bulk-submit PRs for all of these (and some more issues I already debugged a year ago during a previous effort), but submitting fixes for a not-yet-functioning stdenv feels abit silly.

image


The following things need to be addressed for stdenv to build & work. I would consider this issue "done" and closable once these are done, as anything after stdenv can just be fixed incrementally. No need to keep this ticket open for all eternity. :slightly_smiling_face:


These are some additional problems I've encountered after reaching stdenv and attempting to build my way up so some graphical applications. I'll document things here as I encounter them while the above list isn't done, just so I don't forget about them. Once stdenv works on master, I'll just submit PRs for these & future problems.

Example of a failing integration test ``` ERROR: test/integration/sys-asymmetric-encrypt-decrypt ====================================================== Trying to start simulator mssim Starting simulator on port 2218 successfully started daemon: tpm_server with PID: 95717 /build/source simulator PID: 95717 Port conflict? Cleaning up PID: 95717 ./script/int-log-compiler-common.sh: line 246: kill: (95717) - No such process Failed to start simulator: port 2218 or 2219 probably in use. Retrying in 2. Starting simulator on port 15806 successfully started daemon: tpm_server with PID: 95767 /build/source simulator PID: 95767 Port conflict? Cleaning up PID: 95767 ./script/int-log-compiler-common.sh: line 246: kill: (95767) - No such process Failed to start simulator: port 15806 or 15807 probably in use. Retrying in 4. Starting simulator on port 30400 successfully started daemon: tpm_server with PID: 95799 /build/source simulator PID: 95799 Port conflict? Cleaning up PID: 95799 ./script/int-log-compiler-common.sh: line 246: kill: (95799) - No such process Failed to start simulator: port 30400 or 30401 probably in use. Retrying in 8. Starting simulator on port 31390 successfully started daemon: tpm_server with PID: 95831 /build/source simulator PID: 95831 Port conflict? Cleaning up PID: 95831 ./script/int-log-compiler-common.sh: line 246: kill: (95831) - No such process Failed to start simulator: port 31390 or 31391 probably in use. Retrying in 16. Starting simulator on port 6842 successfully started daemon: tpm_server with PID: 95863 /build/source simulator PID: 95863 Port conflict? Cleaning up PID: 95863 ./script/int-log-compiler-common.sh: line 246: kill: (95863) - No such process Failed to start simulator: port 6842 or 6843 probably in use. Retrying in 32. Starting simulator on port 59214 successfully started daemon: tpm_server with PID: 95895 /build/source simulator PID: 95895 Port conflict? Cleaning up PID: 95895 ./script/int-log-compiler-common.sh: line 246: kill: (95895) - No such process Failed to start simulator: port 59214 or 59215 probably in use. Retrying in 64. TPM20TEST_TCTI_NAME=socket TPM20TEST_DEVICE_FILE= TPM20TEST_SOCKET_ADDRESS=127.0.0.1 TPM20TEST_SOCKET_PORT=59214 TPM20TEST_TCTI=mssim:host=127.0.0.1,port=59214 WARNING:tcti:src/util/io.c:262:socket_connect() Failed to connect to host 127.0.0.1, port 59214: errno 111: Connection refused Failed to initialize tcti context: 0xa000a TPM_StartUp failed ./script/int-log-compiler-common.sh: line 195: kill: (95895) - No such process failed to kill daemon process with PID: 95895 ERROR test/integration/sys-asymmetric-encrypt-decrypt.int (exit status: 99) ```

¹: My dream would be NixOS on powerpc64-linux via a USB installer image, but that's definitely a separate thing to tackle (and something I've never dabbled into before).

tlaurion commented 9 months ago

All the steps seem to have been outlined at https://discourse.nixos.org/t/getting-started-with-nix-on-ppc64le/12712/17 (7 days ago)

OPNA2608 commented 9 months ago

The steps for getting nix set up, yes. You can't actually build any packages with that natively until at least the stdenv-relevant problems in this issue are addressed though.

tlaurion commented 9 months ago

@OPNA2608

End desire is

user@talos:~$ sudo sh <(curl -L https://nixos.org/nix/install) --no-daemon
[sudo] password for user: 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  4052  100  4052    0     0   8327      0 --:--:-- --:--:-- --:--:--  263k
/dev/fd/63: sorry, there is no binary distribution of Nix for your platform
user@talos:~$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
nix-installer: unknown CPU type: ppc64le

To work.

OPNA2608 commented 9 months ago

1) Different platform: powerpc64 vs powerpc64le 2) Code responsible for that is not here: https://github.com/NixOS/nix/blob/b83a2fb6dd58ac1648812a71c1eeda33672476d4/flake.nix#L262 3) My end desire in this ticket is for

    $ nix-build -A hello
    error: evaluation aborted with the following error message: 'unsupported platform for the pure Linux stdenv'
to work (which afaik already works for powerpc64le)