!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

567 Members
123 Servers

Load older messages


SenderMessageTime
24 Jul 2021
@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
@symphorien:xlumurb.eusymphorienah I see your point16:00:17
@symphorien:xlumurb.eusymphorienindeed you can't make the distinction between "it will be used for powerpc" and "it will be used natively"16:00:53
@symphorien:xlumurb.eusymphorien I suppose the if should happen in pkgs/stdenv/cross/default.nix 16:02:47
@symphorien:xlumurb.eusymphorien...which seems to slowly converge to the solution you already have, so I'll stop there giving you bad advice16:10:00
@ius:nltrix.netiusYour attempt is much appreciated though 🙂16:23:35
@ius:nltrix.netius Ah, another angle: removing patchelf from systemd's nativeBuildInputs works (because then only the patchelf from stdenv will be in PATH). 20:12:08
@ius:nltrix.netius 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
@siraben:matrix.orgsirabenWhat's the most direct way to cross-compile the ISO?05:26:46
@siraben:matrix.orgsiraben thanks John Ericson for merging my cross PRs 06:14:45
@symphorien:xlumurb.eusymphorien
In reply to @ius:nltrix.net
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
yes that seems unneeded... https://nixos.org/manual/nixpkgs/stable/#sec-tools-of-stdenv guarantees that patchelf is present at least.
11:08:34
@sandro:supersandro.deSandro
In reply to @ius:nltrix.net
Ah, another angle: removing patchelf from systemd's nativeBuildInputs works (because then only the patchelf from stdenv will be in PATH).
going to test removing it
13:05:14
@sandro:supersandro.deSandro
In reply to @ius:nltrix.net
Ah, another angle: removing patchelf from systemd's nativeBuildInputs works (because then only the patchelf from stdenv will be in PATH).
* going to test removing it and doing a PR with it
13:05:19
@ius:nltrix.netius symphorien Sandro : Thanks 13:06:49
@ius:nltrix.netius Sandro: I think you can also drop coreutils based on symphorien's doc link. And not sure about getent (it's included in glibc, but e.g. musl doesn't provide it - however systemd doesn't build on musl anyway; not sure about other libcs though) 13:11:20
28 Jul 2021
@sternenseemann:systemli.orgsterni (he/him) John Ericson: if you have the time, could you review https://github.com/NixOS/nixpkgs/pull/131076? it has a change to cc-wrapper (only affecting Ada though), so I just wanna confirm that what I'm doing is in the spirit of said wrapper 12:45:39
@sternenseemann:systemli.orgsterni (he/him)also edend up doing something similar to pkg-config's setupHook, so you may be able to give useful feedback12:45:58
@Ericson2314:matrix.orgJohn EricsonOk12:46:01

Show newer messages


Back to Room ListRoom Version: 6