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


#1

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 https://github.com/nix-community/aarch64-build-box 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:


#2

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 https://github.com/NixOS/nixpkgs/issues/21471 (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!)


#3

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.


#4

As noted most things won’t build out of the box. I did some really hacky and poorly-documented steps towards #21471 at https://github.com/lheckemann/nixpkgs/commits/arm-hax 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.


#5

@lheckemann https://github.com/NixOS/nixpkgs/pull/44583/files is a draft of that and some other changes. Need to find a good subset for 19.03.


#6

Is it possible to get a virtual machine there to run arm builds from time to time?
Pocket does not have those machines available (even Cavium are often out stock), and the only market options for armv7l cloud is Scaleway C1 which is too weak so the builds last many days :frowning: