!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

397 Members
92 Servers

Load older messages


SenderMessageTime
11 Sep 2024
@hexa:lossy.networkhexa
In reply to @kjeremy:matrix.org
@hexa oh maybe that's the cause of #338231
for python packages with lots of leaf packages, certainly
18:18:36
@hexa:lossy.networkhexaand home-assistant is really huge18:19:00
@artturin:matrix.orgArtturin
In reply to @vramp:matrix.org
i will convert my shell.nix to a flake and try that out
You can use overrideAttrs and lib.remove to remove it from nativeBuildInputs
18:22:35
@artturin:matrix.orgArtturin https://github.com/search?q=%2Fbuildinputs.%2Blib.remove%2F&type=code 18:24:33
@artturin:matrix.orgArtturin* You can use overrideAttrs and lib.remove to remove it from buildInputs18:28:16
@creepinson:matrix.orgTheo Paris

Hmm so I tried to cross compile for x86_64-unknown-none-coff and got this

error: Unknown ABI: coff

I managed to fix this error by patching nixpkgs with this:

diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index a2ee288f2c1f..1e765f6e3bfb 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -368,6 +368,8 @@ rec {

     # Other architectures should use ELF in embedded situations.
     elf          = {};
+    coff = {};
+    macho = {};

     androideabi  = {};
     android      = {

However nix still tries to build compiler-rt which seems to fail with #error Unsupported target. I am using crossSystem like so

    crossSystem = {
      config = "x86_64-unknown-none-coff";
      libc = null;
      libcxx = null;
      linker = "lld";
      useLLVM = true;
    };

Unfortunately there doesn't appear to be a way to patch compiler-rt with Nix yet so I have no way of modifiying https://github.com/llvm/llvm-project/blob/bd4e0dfa945fb7fe73801bcee63c21aa8123b928/compiler-rt/lib/builtins/int_lib.h#L70

18:59:57
@artturin:matrix.orgArtturin
In reply to @creepinson:matrix.org

Hmm so I tried to cross compile for x86_64-unknown-none-coff and got this

error: Unknown ABI: coff

I managed to fix this error by patching nixpkgs with this:

diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index a2ee288f2c1f..1e765f6e3bfb 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -368,6 +368,8 @@ rec {

     # Other architectures should use ELF in embedded situations.
     elf          = {};
+    coff = {};
+    macho = {};

     androideabi  = {};
     android      = {

However nix still tries to build compiler-rt which seems to fail with #error Unsupported target. I am using crossSystem like so

    crossSystem = {
      config = "x86_64-unknown-none-coff";
      libc = null;
      libcxx = null;
      linker = "lld";
      useLLVM = true;
    };

Unfortunately there doesn't appear to be a way to patch compiler-rt with Nix yet so I have no way of modifiying https://github.com/llvm/llvm-project/blob/bd4e0dfa945fb7fe73801bcee63c21aa8123b928/compiler-rt/lib/builtins/int_lib.h#L70

Unfortunately there doesn't appear to be a way to patch compiler-rt

Why not?

19:11:23
@artturin:matrix.orgArtturin
In reply to @creepinson:matrix.org

Hmm so I tried to cross compile for x86_64-unknown-none-coff and got this

error: Unknown ABI: coff

I managed to fix this error by patching nixpkgs with this:

diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index a2ee288f2c1f..1e765f6e3bfb 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -368,6 +368,8 @@ rec {

     # Other architectures should use ELF in embedded situations.
     elf          = {};
+    coff = {};
+    macho = {};

     androideabi  = {};
     android      = {

However nix still tries to build compiler-rt which seems to fail with #error Unsupported target. I am using crossSystem like so

    crossSystem = {
      config = "x86_64-unknown-none-coff";
      libc = null;
      libcxx = null;
      linker = "lld";
      useLLVM = true;
    };

Unfortunately there doesn't appear to be a way to patch compiler-rt with Nix yet so I have no way of modifiying https://github.com/llvm/llvm-project/blob/bd4e0dfa945fb7fe73801bcee63c21aa8123b928/compiler-rt/lib/builtins/int_lib.h#L70

*

Unfortunately there doesn't appear to be a way to patch compiler-rt

To do it easily you can by editing the files

19:12:18
@artturin:matrix.orgArtturin *

Unfortunately there doesn't appear to be a way to patch compiler-rt

To do it easily you can edit the files

19:12:22
@artturin:matrix.orgArtturin
In reply to @artturin:matrix.org
https://github.com/search?q=%2Fbuildinputs.%2Blib.remove%2F&type=code
vramp: There was a another conditional which I missed, fixed
19:57:20
@artturin:matrix.orgArtturin K900: Why haven't we added platforms.windows/mingw to bash badPlatforms? 20:04:27
@artturin:matrix.orgArtturinSomeone found patches https://github.com/NixOS/nixpkgs/issues/333338#issuecomment-232482272420:18:09
@artturin:matrix.orgArtturinBut the problem is how to get autoconf to bash20:18:22
@artturin:matrix.orgArtturin ... Is what I would say if we couldn't just use stdenv.hostPlatform.isMinGW conditionals lol 20:21:44
@artturin:matrix.orgArtturinhttps://github.com/NixOS/nixpkgs/pull/34124720:43:13
@artturin:matrix.orgArtturin Hmm nix eval ".#pkgsCross.aarch64-multiplatform" -vvvvvvvvvvv goes for a loop after evaluating 9ptls https://gist.github.com/Artturin/997cca3789e1dda918de53afa94fa0b1 22:37:10
@artturin:matrix.orgArtturin

non cross eval log doesn't seem to be helpful :/

instantiated '9ptls-1.6.5' -> '/nix/store/kxmj7czlc7ipl9wlrmz1943kp37pwncy-9ptls-1.6.5.drv'
evaluating file '/home/artturin/nixgits/my-nixpkgs/.worktree/1/pkgs/common-updater/combinators.nix'
evaluating file '/home/artturin/nixgits/my-nixpkgs/.worktree/1/pkgs/applications/audio/a2jmidid/default.nix'
processing attribute '__structuredAttrs'
processing attribute 'args'
processing attribute 'buildInputs'
processing attribute 'builder'
processing attribute 'cmakeFlags'
processing attribute 'configureFlags'
processing attribute 'depsBuildBuild'
processing attribute 'depsBuildBuildPropagated'
... goes on normally
22:43:12
@artturin:matrix.orgArtturin
In reply to @artturin:matrix.org
Hmm nix eval ".#pkgsCross.aarch64-multiplatform" -vvvvvvvvvvv goes for a loop after evaluating 9ptls https://gist.github.com/Artturin/997cca3789e1dda918de53afa94fa0b1
Added strace
22:57:03
@artturin:matrix.orgArtturin Says it loops at pkgs/top-level/cubocore-packages.nix
but pkgsCross.aarch64-multiplatform.CuboCore or pkgsCross.aarch64-multiplatform.qt5 don't have issues
23:02:16
@artturin:matrix.orgArtturin
nix-repl> pkgsCross.aarch64-multiplatform.openmpi
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:9:12:
            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'openmpi-aarch64-unknown-linux-gnu-5.0.5'
         whose name attribute is located at /home/artturin/nixgits/my-nixpkgs/.worktree/1/pkgs/stdenv/generic/make-derivation.nix:336:7

       … while evaluating attribute 'postInstall' of derivation 'openmpi-aarch64-unknown-linux-gnu-5.0.5'
         at /home/artturin/nixgits/my-nixpkgs/.worktree/1/pkgs/development/libraries/openmpi/default.nix:138:3:
          137|
          138|   postInstall =
             |   ^
          139|     let

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'gfortran' missing
       at /home/artturin/nixgits/my-nixpkgs/.worktree/1/pkgs/development/libraries/openmpi/default.nix:178:16:
          177|             "gfortran"
          178|             "${targetPackages.gfortran}/bin/${targetPackages.gfortran.targetPrefix}gfortran"
             |                ^
          179|           ];

🤨

23:04:35
@artturin:matrix.orgArtturinhttps://github.com/NixOS/nixpkgs/pull/34126923:17:23
@artturin:matrix.orgArtturin On static it fails with error: attribute 'sharedLibrary' missing 23:17:33
@artturin:matrix.orgArtturin * pkgsStatic it fails with error: attribute 'sharedLibrary' missing 23:17:38
@artturin:matrix.orgArtturin * Added a commit for pkgsStatic too error: attribute 'sharedLibrary' missing 23:20:33
@philiptaron:matrix.orgPhilip Taron (UTC-8) Is that correct? Or should the fortran support be targetPackages ? gfortran? 23:26:08
@philiptaron:matrix.orgPhilip Taron (UTC-8) * Is that correct? Or should the fortran support be targetPackages ? gfortran rather than true? 23:26:22
@artturin:matrix.orgArtturinThere's binaries in mp which should function on the hostSystem when this is done23:30:48
@artturin:matrix.orgArtturin the targetPackages.stdenv.cc is the same offset asgfortran 23:31:26
@artturin:matrix.orgArtturin * the targetPackages.stdenv.cc is the same offset as gfortran 23:31:34
@philiptaron:matrix.orgPhilip Taron (UTC-8) is there ever a time then that it shouldn't be gfortran, rather than targetPackages.gfortran? 23:32:33

Show newer messages


Back to Room ListRoom Version: 6