New Aarch64 (and armv7l-linux omg!) builders!

Hello everyone, we now have a new aarch64.nixos.community ARM server to work with! And it can build armv7l-linux!

The previous community server has now joined the hydra.nixos.org fleet:

but about that shiny new one…

With the help of @dezgeg, @lheckemann, @samueldr, and Scott from Packet, I was able to get a new type of ARM server from Packet.net running NixOS. This new type is called the c1.large.arm.xda. It is similarly incredible to the other hardware we have from them:

  • 2 x 32-core HiSilicon Hi1616 @ 2.4Ghz
  • 128GB of RAM
  • 480GB SSD
  • 2 x 10Gbps Bonded Ports, for a total capacity of 20Gbps

Not only does it have the armv7l superpowers, this new server also builds noticeably faster than the c1.large.arm which had 2 x Cavium ThunderX CN8890 at only 2GHz.

This means that if you’re a well known part of the community, you can send a PR at GitHub - NixOS/aarch64-build-box: Config for the Community aarch64 NixOS box [maintainer=@grahamc] to test out armv7l builds. Note it doesn’t work out of the box, you’ll have to talk to @lheckemann about how he got it to work.

This doesn’t mean Hydra will produce a armv7l binary cache – it definitely won’t. Packet only has a few of these machines, and we only get this one. We can’t get another if there are problems with it.

Thank you everyone who helped get this working, thank you Packet for the very cool, very fun hardware, and thank you community for doing such cool stuff!

Graham

PS: aarch64.nixos.community supports IPv6 too, now :slight_smile:

10 Likes

tl;dr: nix build --argstr system armv7l-linux --extra-platforms armv7l-linux nixpkgs.hello

For armv7 builds, simply pass --argstr system armv7l-linux so that nixpkgs knows not to build for the autodetected system (which would be aarch64), and --extra-platforms armv7l-linux to convince nix that it is in fact a natively supported platform. I think this should work for armv6 as well, should you want to build something for your older raspberry pi :slight_smile:

Caveat: many packages close to the roots of various dependency trees (e.g. openssl) will attempt to autodetect the build platform based on uname (which still returns aarch64) and fail as a result. Implementing Always cross compile · Issue #21471 · NixOS/nixpkgs · GitHub (cc @Ericson2314) would fix this, but I believe it’s still quite a way off from actually happening, if it happens at all.

(but at least nethack works!)

2 Likes

Bravo! I’ll start using this to test armv7l builds on a system faster than what my Hydra has access to (Tinker Boards). Has there been any thought to add some core part of the builds to cachix? I’ve been adding builds like stdenv, coreutils and binutils to arm.cachix.org.

As noted most things won’t build out of the box. I did some really hacky and poorly-documented steps towards #21471 at Commits · lheckemann/nixpkgs · GitHub back when I was first using this machine which did get a fair bit of stuff running, but never to the point of being able to build a full nixos system.

Also, are you aware of @dezgeg’s binary cache which already includes stdenv and some other stuff? It and various other useful resources are mentioned on the wiki page.

@lheckemann WIP: treewide: Always prefix compilers by Ericson2314 · Pull Request #44583 · NixOS/nixpkgs · GitHub is a draft of that and some other changes. Need to find a good subset for 19.03.

1 Like

I opened an issue https://github.com/NixOS/nixpkgs/issues/60103 as @Ericson2314’s changes seems stalled

1 Like

Hello everyone,
there still seems to be an issue with arm7l. Check the following ticket here Can't build linux-headers on armv6l · Issue #107386 · NixOS/nixpkgs · GitHub
This should also be an issue for the binary chance above.

This change should allow building for armv7l natively on aarch64-build-box:
https://github.com/nix-community/aarch64-build-box/pull/133