Nix Cross Compiling | 580 Members | |
| 126 Servers |
| Sender | Message | Time |
|---|---|---|
| 24 Jul 2021 | ||
| At the risk of sounding like a broken record - I still can't manage to override My 'solution' was to prepend my modified All my other attempts either do nothing (e.g. overlaying | 12:27:59 | |
| Main 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 | |
| Honnestly 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 overlays | 12:43:42 | |
| I'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 | |
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 | |
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 | |
| Ah my bad | 14:28:08 | |
| Where do overlays come into play though ? | 14:28:32 | |
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 | |
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 | |
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 | |
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 | |
| Thanks. Tried that, doesn't work:
| 15:44:12 | |
(I'm tracing stdenv.targetPlatform.system on the mkDerivation call to patchelf there) | 15:44:45 | |
| Which 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 apart | 15:45:52 | |
| ah so it's hostPlatform not targetPlatform maybe | 15:46:46 | |
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 | |
* 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 | |
| ah I see your point | 16:00:17 | |
| indeed you can't make the distinction between "it will be used for powerpc" and "it will be used natively" | 16:00:53 | |
I suppose the if should happen in pkgs/stdenv/cross/default.nix | 16:02:47 | |
| ...which seems to slowly converge to the solution you already have, so I'll stop there giving you bad advice | 16:10:00 | |
| Your attempt is much appreciated though 🙂 | 16:23:35 | |
Ah, another angle: removing patchelf from systemd's nativeBuildInputs works (because then only the patchelf from stdenv will be in PATH). | 20:12:08 | |
Which makes me wonder, why is patchelf listed there in the first place? Doesn't stdenv provide patchelf by default? Many other packages seem to assume so | 20:13:06 | |
| 25 Jul 2021 | ||
| What's the most direct way to cross-compile the ISO? | 05:26:46 | |
| thanks John Ericson for merging my cross PRs | 06:14:45 | |
In reply to @ius:nltrix.netyes that seems unneeded... https://nixos.org/manual/nixpkgs/stable/#sec-tools-of-stdenv guarantees that patchelf is present at least. | 11:08:34 | |
In reply to @ius:nltrix.netgoing to test removing it | 13:05:14 | |
In reply to @ius:nltrix.net* going to test removing it and doing a PR with it | 13:05:19 | |