!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

580 Members
128 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
7 May 2025
@szlend:matrix.orgszlend is there any way to get a pkgs instance where buildPlatform != hostPlatform != targetPlatform? 20:30:56
@qyliss:fairydust.spaceAlyssa RossI don't think so20:37:40
@szlend:matrix.orgszlend I'm trying to map how pkgs<host><target> packages are offset inside another pkgs<host><target> and it would really help with understanding 20:58:45
@szlend:matrix.orgszlendit don't actually need to build anything20:59:51
@k900:0upti.meK900Are you trying to do Canadian cross21:09:37
@k900:0upti.meK900Also can we PLEASE kill targetPlatform21:09:43
@k900:0upti.meK900Yes I will keep bringing this up21:09:50
@szlend:matrix.orgszlend I'm trying to wire up a spliced package set with makeScopeWithSplicing that is not overlayed on top of pkgs. Usually you would wire it up with generateSplicesForMkScope, but that's not an option here. You can wire up otherSplices naively with recursion, but that explodes evaluation very quickly, as it unnecessarily evaluates against the same pkgs<host><target> instances. 21:20:43
@ss:someonex.netSomeoneSerge (matrix works sometimes) I was very stupidly confused about this even though there are only two kinds of "offsets" in the end. I just couldn't figure out which sense is meant in any particular place. TLDR: Offsets in Nixpkgs manual are points, but {host,target}Offsets in setup-hooks are vectors 21:21:51
@szlend:matrix.orgszlendThis is my understanding of how perspective shifts, but I could be very wrong: https://gist.github.com/szlend/62bfa710ff89b7dc3a871693ca34c94c21:22:38
@szlend:matrix.orgszlendSo I kinda wanna confirm it :D21:22:45
@ss:someonex.netSomeoneSerge (matrix works sometimes) Does root refer to the current derivation? 21:25:44
@k900:0upti.meK900 Can you not overlay it on pkgs? 21:27:35
@szlend:matrix.orgszlendI'm thinking about it like root == pkgsCross.<platform> == pkgsCross.<platform>.pkgsHostTarget (assuming those are equivalent)21:27:44
@szlend:matrix.orgszlendso pkgsCross.<platform>.pkgsBuildHost.pkgsBuildTarget == pkgsCross.<platform>.pkgsHostHost21:28:39
@szlend:matrix.orgszlend * so pkgsCross.<platform>.pkgsBuildHost.pkgsTargetTarget == pkgsCross.<platform>.pkgsHostHost 21:28:57
@szlend:matrix.orgszlendor maybe root.pkgsBuildHost.pkgsTargetTarget == root.pkgsHostTarget (since targetTarget is +1,+1)21:36:15
@ss:someonex.netSomeoneSerge (matrix works sometimes) It's the former, because ps: ps.pkgsTargetTarget translates by the vector of (1, 0), which is how you get from the point (0, 1) (pkgs = pkgsHostTarget) to the point (1, 1) (pkgs.pkgsTargetTarget) 21:41:55
@ss:someonex.netSomeoneSerge (matrix works sometimes) Setup-hooks here print the accumulated vectors, but not the result of translating the current' derivation's platforms (0, 1) by that vector 21:44:01
@szlend:matrix.orgszlendI see yeah, thanks! I think I actually got it then21:48:52
8 May 2025
@98765abc:mozilla.org@98765abc:mozilla.org changed their profile picture.11:35:04
@curid:matrix.org@curid:matrix.orgRedacted or Malformed Event19:03:13
@curid:matrix.org@curid:matrix.org Is there a better way to write this?
NIX_CFLAGS_COMPILE = if pkgs.system == "aarch64-unknown-linux-gnu" then "" else "-msse4.2"
19:14:52
@k900:0upti.meK900 if !stdenv.hostPlatform.isx86 19:17:58
@k900:0upti.meK900Or rather19:18:10
@k900:0upti.meK900 lib.optionalString stdenv.hostPlatform.isx86 "-msse4.2" 19:18:21

Show newer messages


Back to Room ListRoom Version: 6