!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

538 Members
110 Servers

Load older messages


SenderMessageTime
23 Nov 2025
@szlend:matrix.orgszlendI assumed it must have been just for the shell, but I get the same thing with --no-shell12:52:29
@szlend:matrix.orgszlend *

Failing to evaluate it as a result (not available on the requested hostPlatform):

while evaluating attribute 'nativeBuildInputs' of derivation 'review-shell'

12:55:10
24 Nov 2025
@bpub:matrix.orgRobert joined the room.13:22:42
@bpub:matrix.orgRobert changed their display name from bpub to Robert.13:31:59
@bpub:matrix.orgRobert set a profile picture.13:34:20
@siraben:matrix.orgsirabenthis should work, can you provide the whole command"17:44:00
@siraben:matrix.orgsiraben* this should work, can you provide the whole command?17:44:06
@szlend:matrix.orgszlend try nixpkgs-review -- pr --print-result 464677 --package pkgsCross.aarch64-multiplatform.libcap 19:51:52
@szlend:matrix.orgszlendit's a completely unrelated PR with no changes to libcap19:52:14
@szlend:matrix.orgszlendbut I can evaluate it fine without nixpkgs-review19:52:41
@siraben:matrix.orgsirabenScreenshot 2025-11-24 at 11.53.43.png
Download Screenshot 2025-11-24 at 11.53.43.png
19:54:07
@szlend:matrix.orgszlendyeah I'm building from darwin19:54:30
@szlend:matrix.orgszlendwhere it's not available. But it can be cross-compiled to linux19:54:50
@szlend:matrix.orgszlendI mean it's broken in master until some changes from staging hit. But I should at least be able to evaluate it19:55:44
@szlend:matrix.orgszlendimage.png
Download image.png
19:56:23
@qyliss:fairydust.spaceAlyssa RossIIRC it's not still broken in master20:10:29
@qyliss:fairydust.spaceAlyssa Rossunless it broke again in the last couple of days20:10:39
@bake.monorail:matrix.orgbake.monorail Alyssa Ross when you have a minute can you take another look at the uclibc PR? 20:15:34
@szlend:matrix.orgszlend Alyssa Ross: there's one more libcap issue that I fixed here: https://github.com/NixOS/nixpkgs/pull/461685 20:31:16
@szlend:matrix.orgszlendcross was fixed but not from darwin20:31:22
@qyliss:fairydust.spaceAlyssa Rossah, I see20:32:04
@qyliss:fairydust.spaceAlyssa RossI might not have a minute this week I'm afraid20:32:12
@szlend:matrix.orgszlendgot it to build manually but I can't confirm with nixpkgs-review :D 20:32:13
@limwa:matrix.orgAndré Lima set a profile picture.21:10:24
25 Nov 2025
@ebnull:matrix.orgeb joined the room.18:21:36
@ebnull:matrix.orgeb

Hey all, I'm just starting to get into cross compiling (x68 -> aarch64 for rpi 4b), and have some questions about how to best approach this. I'll start with my understanding and situation to make sure I didn't make a mistake:

  • I'm using flakes, which don't exactly have first class support for cross compilation.
  • I'm manually creating my pi's nixosConfigurations key and making my own nixpkgs.pkgs for it.
  • It seems like for this pkgs argument, I have two options: The first, is create it with localSystem == crossSystem == "aarch64-linux". If I do this, I'd need to rely on binmft style emulation to build from my x86 machine. The second, is create it with localSystem = x86-linux; crossSystem = "aarch64-linux". If I do this, I'm doing real cross compilation.
  • With the former I can use cache.nixos.org to grab the aarch64 components, but I'd need to emulate-build everything else.
  • With the latter I can't use the cache at all, so I need to build everything.

Ideally I could use the cache and cross compile only if needed, but it looks like I can't do that without manually choosing specific packages to be cross compiled with pkgsCross attributes in the first method, right? And if I did want this, then my buildSystem would need to support emulation, right?

My buildSystem is currently Ubuntu, so I can't just flip the nixos switch for binfmt emulation. I could probably apply the binfmt config manually if I want to go the emulation route, right?

I suppose I might just be frustrated that I can't default crossSystem and opportunistically grab the non-cross packages from the aarch64 cache, though I know the technical reason why (store paths are functions of all inputs, and crossSystem is an input). I'm guessing this is currently an unsolved issue?

Thanks!

18:32:34
@artturin:matrix.orgArtturinNixOS system cross is the exact same with flakes as it is without18:33:32
@ebnull:matrix.orgebI get that; flakes are not my main issue on this. I'm just providing context there.18:35:43
@artturin:matrix.orgArtturin

With the latter I can't use the cache at all, so I need to build everything.

There's some packages cached https://github.com/NixOS/nixpkgs/blob/75c025c6135ca219cded2592343bef3daa4b39b9/pkgs/top-level/release-cross.nix#L239
https://github.com/NixOS/nixpkgs/blob/75c025c6135ca219cded2592343bef3daa4b39b9/pkgs/top-level/release-cross.nix#L78-L105

18:37:22
@artturin:matrix.orgArtturin

My buildSystem is currently Ubuntu, so I can't just flip the nixos switch for binfmt emulation. I could probably apply the binfmt config manually if I want to go the emulation route, right?

Yup binfmt is possible to setup on all distros

18:38:09

Show newer messages


Back to Room ListRoom Version: 6