-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
lib, treewide: Add missing MIPS arches, and fix existing usage #35247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Offhand this looks reasonable. It's a bit of groundwork for mips32, but AFAIK not enough to even try to evaluate a mips build just yet. I ask because other doubles have entries there, and because when I try to use these configs I get something like: $ nix build -f . --arg crossSystem '{config="mips-unknown-linux-gnu";}' bash
error: while evaluating the attribute 'stdenv' of the derivation 'bash-4.4-p12-mips-unknown-linux-gnu' at /home/will/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute 'defaultNativeBuildInputs' of the derivation 'stdenv' at /home/will/nixpkgs/pkgs/stdenv/generic/default.nix:72:14:
while evaluating the attribute 'gcc' at /home/will/nixpkgs/pkgs/top-level/all-packages.nix:5798:3:
while evaluating 'lowPrio' at /home/will/nixpkgs/lib/meta.nix:52:13, called from /home/will/nixpkgs/pkgs/top-level/all-packages.nix:5958:10:
while evaluating 'addMetaAttrs' at /home/will/nixpkgs/lib/meta.nix:15:28, called from /home/will/nixpkgs/lib/meta.nix:52:18:
while evaluating 'wrapCC' at /home/will/nixpkgs/pkgs/top-level/all-packages.nix:6713:12, called from /home/will/nixpkgs/pkgs/top-level/all-packages.nix:5958:19:
while evaluating 'wrapCCWith' at /home/will/nixpkgs/pkgs/top-level/all-packages.nix:6697:16, called from /home/will/nixpkgs/pkgs/top-level/all-packages.nix:6713:16:
while evaluating 'callPackageWith' at /home/will/nixpkgs/lib/customisation.nix:113:35, called from /home/will/nixpkgs/pkgs/top-level/all-packages.nix:6698:7:
while evaluating 'makeOverridable' at /home/will/nixpkgs/lib/customisation.nix:72:24, called from /home/will/nixpkgs/lib/customisation.nix:117:8:
while evaluating anonymous function at /home/will/nixpkgs/pkgs/build-support/cc-wrapper/default.nix:8:1, called from /home/will/nixpkgs/lib/customisation.nix:74:12:
while evaluating the attribute 'configureFlags' of the derivation 'glibc-2.26-131-mips-unknown-linux-gnu' at /home/will/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute 'ARCH' of the derivation 'linux-headers-4.4.10-mips-unknown-linux-gnu' at /home/will/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute 'platform.kernelArch' at /home/will/nixpkgs/lib/systems/default.nix:25:7:
attribute 'kernelArch' missing, at /home/will/nixpkgs/pkgs/os-specific/linux/kernel-headers/default.nix:17:12 Are more similar changes coming? O:) |
Can you look at nix-store -r /nix/store/jlfhcadzpjyls8y22v3l9f86j86lisxz-mips64el-unknown-linux-gnu-binutils-2.28
nix-store -r /nix/store/pcm4j6k546fprai1fghqyn93faa3mdgc-hello-2.10-mips64el-unknown-linux-gnu
/nix/store/jlfhcadzpjyls8y22v3l9f86j86lisxz-mips64el-unknown-linux-gnu-binutils-2.28/bin/mips64el-unknown-linux-gnu-readelf -a /nix/store/pcm4j6k546fprai1fghqyn93faa3mdgc-hello-2.10-mips64el-unknown-linux-gnu/bin/hello
/nix/store/jlfhcadzpjyls8y22v3l9f86j86lisxz-mips64el-unknown-linux-gnu-binutils-2.28/bin/mips64el-unknown-linux-gnu-ld --help I see "32s" everywhere. |
According to google, the Fuloong MiniPC is based on a Loongson 2F, which wikipedia says is a MIPS64. That doesn't stop it from running 32 bit code (MIPS64 specifies a backward compatibility mode) and it does look rather like whoever set it up for nixpkgs is expecting to do just that. https://en.wikipedia.org/wiki/Loongson#Loongson_2F For nixwrt so far I've been defining the systems inline where I needed it - e.g. https://github.com/telent/nixwrt/blob/nixwrt/nixwrt/default.nix#L18 but maybe that's a completely back to front way of doing it. I am happy to add an example system and platform for "generic mips-based router" to this PR if you think that makes it more generally useful to other people? |
I do, because it saves me sorting out what a reasonable configuration might be if I wanted to quickly test targeting mips32 O:). But that's not a great reason-- I think ideally a suitable "basic" configuration (setting kernelArch) would be automagically inferred from the basic triple? Anyway don't think this should block on account of any of this, I was just eager to give it a go :). |
I added some more changes, fixing what is there finally. I was going to point https://hydra.nixos.org/jobset/nixpkgs/ericson2314-cross-trunk at your branch to help you finish things off, but hydra is down ATM. Ping me to do that later if I forget. |
Existing "mips64el" should be "mipsel". This is just the barest minimum so that nixpkgs can recognize them as systems - although required for building individual derivations onto MIPS boards, it is not sufficient if you want to actually build nixos on those targets
Not that you forgot but just FYI hydra is back up! \o/ @Ericson2314 |
Heheh I did. I just did an eval now https://hydra.nixos.org/build/70240205 . It at least evals, though we are getting that same weird "lto isn't a supported language" error in GCC. Whatever, this is still progress so I'm merging. |
@telent https://hydra.nixos.org/jobset/nixpkgs/cross-trunk will soon include the evaling, but broken fuloong builds. Feel free to replace that with a more relevant/modern mips platform. If you could maintain MIPS jobs if your choosing, that what would be great! |
This merge broke stdenv on aarch64. https://hydra.nixos.org/build/70246649 |
Even changing non-cross stdenv was probably not intended, but I haven't read this. |
Indeed, not intended at all. |
Unintentionally changed in NixOS#35247
This is just the barest minimum so that nixpkgs can recognize mips/mipsel as systems - although required for building individual derivations for MIPS boards, it is not sufficient if you want to actually build NixOS or even the majority of the nixpkgs collection on those targets.
Motivation for this change
For me this is necessary so that I can build MIPS binaries for NixWRT. I don't expect it to have any other effect.
(I note in passing that there is an existing system
mips64el
which hasbits = 32
set, which seems ... odd. Perhaps it's for a system with a 64 bit kernel and 32 bit userland, but I haven't touched it)Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)