!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

572 Members
125 Servers

Load older messages


SenderMessageTime
20 Jul 2021
@philipp:xndr.dephilipp When I don't use pkgsCross, how do I get the mingw_w64_headers then? They only live in the crossPackages afaik. 10:09:38
@symphorien:xlumurb.eusymphorienIt's magic and called splicing: you get a different one depending on whether you use it in buildInputs or nativeBuildInputs10:26:08
@philipp:xndr.dephilippAh, turns out I conflated general cross compiling issues with issues stemming from the mingw64 version in nixpkgs being pretty old.15:57:19
22 Jul 2021
@siraben:matrix.orgsiraben philipp: the mingw versions were updated recently 13:01:55
@siraben:matrix.orgsirabenhttps://github.com/NixOS/nixpkgs/pull/13086413:02:10
@siraben:matrix.orgsiraben * philipp: the mingw versions were updated recently (23 hours ago) 13:02:20
@philipp:xndr.dephilippI filed the pr. Thanks for merging 😄13:17:13
@mic92:nixos.devMic92 joined the room.19:58:45
23 Jul 2021
Room Avatar Renderer.23:22:33
24 Jul 2021
@sternenseemann:systemli.orgsternigotten GNAT to build a cross-compiler, but at the cost of disabling libada in the build which doesn't seem to be supported / working: https://github.com/NixOS/nixpkgs/pull/13113610:44:05
@sternenseemann:systemli.orgsterniso cross GNAT is not that useful unfortunately this way, but I haven't found any good pointers so far how to cross compile libada, may try to do something similar to our libgcc derivation at some point10:44:47
@sternenseemann:systemli.orgsterni * so cross GNAT is not that useful unfortunately this way, but I haven't found any good pointers so far how to cross compile libada, may try to do something similar to our libgcc derivation at some point, but I don't really have the energy presently10:45:00
@ius:nltrix.netius

At the risk of sounding like a broken record - I still can't manage to override patchelf for my cross setup only (ie. so it just affects cross packages being built).

My 'solution' was to prepend my modified patchelf to extraNativeBuildInputs in the cross stdenv. That works (it appears to end up in front of the PATH), unless a package specifies patchelf as a nativeBuildInput (for example: systemd).

All my other attempts either do nothing (e.g. overlaying pkgs.buildPackages) or affect all packages, so an evaluation ends up rebuilding large parts of my host OS.

12:27:59
@ius:nltrix.netiusMain issue seems to be that patchelf is a host executable, but I'm trying to override it based on the context it's used in.. Alternatively, merging this patchelf PR would obsolete my need for patching patchelf: https://github.com/NixOS/patchelf/pull/269 (I just submitted a test case) .. though I assume it would take some time to trickle down to nixpkgs..12:32:41
@symphorien:xlumurb.eusymphorienHonnestly you should probably work on top of a fork and not try to override such deep dependencies. Not that it would be useless to support that, but I fear you are losing much time sticking to overlays12:43:42
@siraben:matrix.orgsirabenI'd love reviews for (m68k) https://github.com/NixOS/nixpkgs/pull/131310 and (s390) https://github.com/NixOS/nixpkgs/pull/131317 . I've tested both the PRs and they cross-compile various programs.13:28:41
@siraben:matrix.orgsiraben Maybe someone can help advise me for how to deal with the double pdp11-aout in https://github.com/NixOS/nixpkgs/pull/131332 13:29:04
@ius:nltrix.netius symphorien: I already have a nixpkgs fork, that's how I implemented my extraNativeBuildInputs workaround. So that's fair game, I just don't know how. 13:41:08
@symphorien:xlumurb.eusymphorienAh my bad14:28:08
@symphorien:xlumurb.eusymphorienWhere do overlays come into play though ?14:28:32
@ius:nltrix.netius I used those to try to overlay buildPackages.patchelf (which doesn't work). No real reason why I couldn't have done so by editing nixpkgs directly I suppose. 15:26:30
@symphorien:xlumurb.eusymphorien yeah if I remember correctly your problem, replacing src in the file for patchelf by src = if stdenv.targetPlatform.isFoo then mysrc else theoriginal should do 15:27:49
@ius:nltrix.netius Ah, I've already duplicated the full package, as I needed to override more than just src to get a git tree to build (src, version, autoreconfHook). So I have a patchelf and patchelf-git 15:31:05
@symphorien:xlumurb.eusymphorien then rename the original one to real_patchelf and replace patchelf = callPackage ... by patchelf = if stdenv.targetPlatform.isFoo then patchelf-git else real_patchelf; 15:34:40
@ius:nltrix.netius

Thanks. Tried that, doesn't work:

nix-repl> pkgs.systemd
«derivation /nix/store/nwy500vcd5y7p6f92fpxa5c73cq90yb5-systemd-powerpc-unknown-linux-gnu-247.6.drv»

nix-repl> builtins.elemAt pkgs.systemd.nativeBuildInputs 6
trace: x86_64-linux
trace: x86_64-linux
«derivation /nix/store/a5x706x5a7hg0a9b4aqdflwkchx7wa3j-patchelf-0.12.drv»
15:44:12
@ius:nltrix.netius (I'm tracing stdenv.targetPlatform.system on the mkDerivation call to patchelf there) 15:44:45
@ius:nltrix.netiusWhich makes sense, because patchelf doesn't target ppc.. so I think I can't use any of *Platform to tell the 'native' and 'cross' scenarios apart15:45:52
@symphorien:xlumurb.eusymphorienah so it's hostPlatform not targetPlatform maybe15:46:46
@ius:nltrix.netius No, that's x86_64-linux as well ('the platform the executables run on). I think targetPlatform` ought to be right, but it might not have a meaning outside of gcc/libc itself? 15:54:14
@ius:nltrix.netius * No, that's x86_64-linux as well ('the platform the executables run on'). I think targetPlatform ought to be right, but it might not have a meaning outside of gcc/libc itself? 15:54:23

Show newer messages


Back to Room ListRoom Version: 6