nix-community / fenix

Rust toolchains and rust-analyzer nightly for Nix [maintainer=@figsoda]
Mozilla Public License 2.0
698 stars 46 forks source link

x86_64-pc-windows-gnu target failing #7

Open gcoakes opened 3 years ago

gcoakes commented 3 years ago

I am unable to cross compile for mingw-w64 target using fenix while I am able to with nixpkgs-mozilla. Using the following flake.nix, naersk and fenix would fail to compile a hello world project. If I replace only the toolchain with one created from nixpkgs-mozilla, it compiles properly, so I believe that points towards fenix being the culprit.

fenix:

{
  inputs = {
    nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
    fenix = {
      url = github:nix-community/fenix;
      inputs.nixpkgs.follows = "nixpkgs";
    };
    naersk = {
      url = github:nmattia/naersk;
      inputs.nixpkgs.follows = "nixpkgs";
    };
    flake-utils.url = github:numtide/flake-utils;
  };

  outputs = { self, nixpkgs, fenix, naersk, flake-utils }:
    flake-utils.lib.eachDefaultSystem (
      system:
        let
          pkgs = nixpkgs.legacyPackages.${system};
          toolchain = with fenix.packages.${system};
            combine [
              minimal.rustc
              minimal.cargo
              targets.x86_64-unknown-linux-musl.latest.rust-std
            ];
          naersk-lib = naersk.lib.${system}.override {
            cargo = toolchain;
            rustc = toolchain;
          };
        in
          rec {
            defaultPackage = naersk-lib.buildPackage {
              src = ./.;
              nativeBuildInputs = with pkgs; [ pkgsCross.mingwW64.stdenv.cc ];
              buildInputs = with pkgs.pkgsCross.mingwW64.windows; [ mingw_w64_pthreads ];
              CARGO_BUILD_TARGET = "x86_64-pc-windows-gnu";
            };
          }
    );
}

nixpkgs-mozilla:

{
  inputs = {
    nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
    naersk = {
      url = github:nmattia/naersk;
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixpkgs-mozilla = {
      url = github:mozilla/nixpkgs-mozilla;
      flake = false;
    };
    flake-utils.url = github:numtide/flake-utils;
  };

  outputs = { self, nixpkgs, naersk, nixpkgs-mozilla, flake-utils }:
    flake-utils.lib.eachDefaultSystem (
      system:
        let
          pkgs = import nixpkgs {
            inherit system;
            overlays = [ (import nixpkgs-mozilla) ];
          };
          rustChannel = pkgs.rustChannelOf {
            channel = "nightly";
            date = "2021-03-24";
            sha256 = "0y7ijxqbjac9gn038lihlcq7ynsvgi3f8fzn06bhmqhvww5dbwzn";
          };
          toolchain = rustChannel.rust.override {
            targets = [ "x86_64-pc-windows-gnu" "x86_64-unknown-linux-musl" ];
          };
          naersk-lib = naersk.lib.${system}.override {
            cargo = toolchain;
            rustc = toolchain;
          };
        in
          rec {
            packages.toolchain = toolchain;
            packages.img-sort-win = naersk-lib.buildPackage {
              src = ./.;
              nativeBuildInputs = with pkgs; [ pkgsCross.mingwW64.stdenv.cc ];
              buildInputs = with pkgs.pkgsCross.mingwW64.windows; [ mingw_w64_pthreads pthreads ];
              CARGO_BUILD_TARGET = "x86_64-pc-windows-gnu";
            };
            defaultPackage = packages.img-sort-win;
            devShell = pkgs.pkgsCross.mingwW64.mkShell {
              nativeBuildInputs = with pkgs; [
                toolchain
                cargo-edit
                pkgsCross.mingwW64.stdenv.cc
              ];
            };
          }
    );
}
warning: Git tree '/home/gcoakes/src/img-sort' is dirty
error: builder for '/nix/store/0a8yynf1cwcmvcxf763qpm8j18jiyzqp-img-sort-0.1.0.drv' failed with exit code 101;
       last 10 log lines:
       >   = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "/nix/store/z2brhlnwarfqg4ivkb4vw27liyndbj31-rust-nightly-mixed/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o" "-L" "/nix/store/z2brhlnwarfqg4ivkb4vw27liyndbj31-rust-nightly-mixed/lib/rustlib/x86_64-pc-windows-gnu/lib" "/build/source/target/x86_64-pc-windows-gnu/release/deps/img_sort-f137848e15daa58a.img_sort.72truihg-cgu.0.rcgu.o" "/build/source/target/x86_64-pc-windows-gnu/release/deps/img_sort-f137848e15daa58a.img_sort.72truihg-cgu.1.rcgu.o" "/build/source/target/x86_64-pc-windows-gnu/release/deps/img_sort-f137848e15daa58a.img_sort.72truihg-cgu.2.rcgu.o" "-o" "/build/source/target/x86_64-pc-windows-gnu/release/deps/img_sort-f137848e15daa58a.exe" "/build/source/target/x86_64-pc-windows-gnu/release/deps/img_sort-f137848e15daa58a.3ki46pg6mpw0oeac.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/build/source/target/x86_64-pc-windows-gnu/release/deps" "-L" "/build/source/target/release/deps" "-L" "/nix/store/z2brhlnwarfqg4ivkb4vw27liyndbj31-rust-nightly-mixed/lib/rustlib/x86_64-pc-windows-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd-94f60f405c1748af.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libpanic_unwind-f56d3aec7c2576d9.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libobject-8e553c585536bfaf.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libaddr2line-3a82c272c5de0489.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libgimli-ef04c21117777245.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_demangle-b3ae962defb8b363.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libhashbrown-b441247297fa184b.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_alloc-19bb25a86d3a5b92.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libunwind-d7957714cc30050c.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libcfg_if-abd7bd18212580be.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/liblibc-80187982c9cf70bf.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/liballoc-4172a25dd8c4f2de.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_core-27282989cc5b80d2.rlib" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libcore-2f52c7ac303d5565.rlib" "-Wl,--end-group" "/nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libcompiler_builtins-2b00c29940bf9d8a.rlib" "-Wl,-Bdynamic" "-ladvapi32" "-lws2_32" "-luserenv" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "/nix/store/z2brhlnwarfqg4ivkb4vw27liyndbj31-rust-nightly-mixed/lib/rustlib/x86_64-pc-windows-gnu/lib/rsend.o"
       >   = note: /nix/store/vsq8pi032iyd1g2z7bbnxyg1jk9ywm5c-x86_64-w64-mingw32-binutils-2.35.1/bin/x86_64-w64-mingw32-ld: /nix/store/ccl2m0c6km8c13simd9s2nac68k3pwxn-rust-std-nightly-2021-03-24/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd-94f60f405c1748af.rlib: error adding symbols: archive has no index; run ranlib to add one
       >           collect2: error: ld returned 1 exit status
       >           
       >
       >
       > error: aborting due to previous error
       >
       >
       > [naersk] cargo returned with exit code 101, exiting
       For full logs, run 'nix log /nix/store/0a8yynf1cwcmvcxf763qpm8j18jiyzqp-img-sort-0.1.0.drv'.
figsoda commented 3 years ago

The nixpkgs-mozilla version also gives me an error on my machine

error: builder for '/nix/store/75dhk8ci68y75nhkrnjabq9i40dnl1di-hello-deps-0.1.0.drv' failed with exit code 101;
       last 10 log lines:
       >   = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/nix/store/l6cjpg87id5x7bkcifvzw1vmvrgrdc
fr-rust-1.53.0-nightly-2021-03-23-673d0db5e/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/build/dummy-src/target/release/build/hello-38695f0
04601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.0.rcgu.o" "/build/dummy-src/target/release/build/hello-38695
f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.1.rcgu.o" "/build/dummy-src/target/release/build/hello-386
95f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.2.rcgu.o" "/build/dummy-src/target/release/build/hello-3
8695f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.3.rcgu.o" "/build/dummy-src/target/release/build/hello
-38695f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.4.rcgu.o" "/build/dummy-src/target/release/build/hel
lo-38695f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.5.rcgu.o" "/build/dummy-src/target/release/build/h
ello-38695f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.6.rcgu.o" "-o" "/build/dummy-src/target/release/
build/hello-38695f004601b9fe/build_script_build-38695f004601b9fe" "/build/dummy-src/target/release/build/hello-38695f004601b9fe/build_scri
pt_build-38695f004601b9fe.2hbwckp71vjel1wh.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/build/dumm
y-src/target/release/deps" "-L" "/nix/store/l6cjpg87id5x7bkcifvzw1vmvrgrdcfr-rust-1.53.0-nightly-2021-03-23-673d0db5e/lib/rustlib/x86_64-u
nknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linu
x-gnu/lib/libstd-61556e43b375c2c0.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpani
c_unwind-787faa8b02fbd963.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-
dda4c0b69607e93b.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-4b7dae8949ac132
c.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-978e97832b309706.rlib" "/nix/
store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-073b1b693304b876.rlib" "/nix/store/rsylh
1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-c07f996a53ee6558.rlib" "/nix/store/rsylh1ac9xpynzh8galg
hjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-0ae8ed6a282247d0.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprl
am420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-978dd04958b6ebcc.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust
/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-14b94bdd9a47d665.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x
-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-bff7534e4dfcef6c.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rust
lib/x86_64-unknown-linux-gnu/lib/libcfg_if-022f1a0e7cd794ec.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unk
nown-linux-gnu/lib/liblibc-ff456575f1773ef0.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/l
ib/liballoc-3aeb407930ebd519.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std
_workspace_core-6ab1ee6dbc17ad08.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-
166dae07beec0398.rlib" "-Wl,--end-group" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcom
piler_builtins-761b290f47712921.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
       >   = note: /nix/store/xdii8qvch5h8chyp0z2is2qzky565w68-binutils-2.35.1/bin/ld: /nix/store/qah4dp8h83cqyc5n19a5rw85hlmmmrwh-pthread
s-w32-2.9.1-x86_64-w64-mingw32/lib/libpthread.a: error adding symbols: file format not recognized
       >           collect2: error: ld returned 1 exit status
figsoda commented 3 years ago

Might be related to rust-lang/cargo#8239

figsoda commented 3 years ago

The error you are getting (error adding symbols: archive has no index; run ranlib to add one) seems to be from not having pthreads in build inputs.

-buildInputs = with pkgs.pkgsCross.mingwW64.windows; [ mingw_w64_pthreads ];
+buildInputs = with pkgs.pkgsCross.mingwW64.windows; [ mingw_w64_pthreads pthreads ];

And by the way, there is a typo in the example you provided:

combine [
  minimal.rustc
  minimal.cargo
-  targets.x86_64-unknown-linux-musl.latest.rust-std
+  targets.x86_64-pc-windows-gnu.latest.rust-std
];

Though I still get this error for both examples.

gcoakes commented 3 years ago

Sorry about the typos. I attempted to clean up the file before submitting and apparently removed some of the wrong lines. This is what I ended up using: https://github.com/gcoakes/img-sort I'll try again with fenix after I'm done with my work today.

gcoakes commented 3 years ago

I decided to turn my adventures in mingwW64 cross compilation into a pull request for naersk. Here's two commits showing the same process first with fenix then with nixpkgs-mozilla. The former fails; the later succeeds. fenix nixpkgs-mozilla

Of particular note here, the actual naersk-lib.buildPackage call does not change between the two versions. Only the method in which the toolchain is obtained.

figsoda commented 3 years ago

I found the problem! nix-community/fenix@dfd5ba should fix it. I tested it with the example you provided.

gcoakes commented 3 years ago

@figsoda , thank you. It seems to have fixed my issue. I updated my pull request to naersk to use fenix instead of nixpkgs-mozilla in the hopes of spreading flakes around a bit more. I unfortunately hit another issue, but I doubt it's related to fenix. It seems like naersk or probably nixpkgs is attempting to link to pthreads even for build scripts. Build scripts are of course meant to be built for the native platform. Either way, this doesn't affect basic "hello world" like projects. Thank you for your help.

noonien commented 3 years ago

The nixpkgs-mozilla version also gives me an error on my machine

error: builder for '/nix/store/75dhk8ci68y75nhkrnjabq9i40dnl1di-hello-deps-0.1.0.drv' failed with exit code 101;
       last 10 log lines:
       >   = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/nix/store/l6cjpg87id5x7bkcifvzw1vmvrgrdc
fr-rust-1.53.0-nightly-2021-03-23-673d0db5e/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/build/dummy-src/target/release/build/hello-38695f0
04601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.0.rcgu.o" "/build/dummy-src/target/release/build/hello-38695
f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.1.rcgu.o" "/build/dummy-src/target/release/build/hello-386
95f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.2.rcgu.o" "/build/dummy-src/target/release/build/hello-3
8695f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.3.rcgu.o" "/build/dummy-src/target/release/build/hello
-38695f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.4.rcgu.o" "/build/dummy-src/target/release/build/hel
lo-38695f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.5.rcgu.o" "/build/dummy-src/target/release/build/h
ello-38695f004601b9fe/build_script_build-38695f004601b9fe.build_script_build.3bz0o6bp-cgu.6.rcgu.o" "-o" "/build/dummy-src/target/release/
build/hello-38695f004601b9fe/build_script_build-38695f004601b9fe" "/build/dummy-src/target/release/build/hello-38695f004601b9fe/build_scri
pt_build-38695f004601b9fe.2hbwckp71vjel1wh.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/build/dumm
y-src/target/release/deps" "-L" "/nix/store/l6cjpg87id5x7bkcifvzw1vmvrgrdcfr-rust-1.53.0-nightly-2021-03-23-673d0db5e/lib/rustlib/x86_64-u
nknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linu
x-gnu/lib/libstd-61556e43b375c2c0.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpani
c_unwind-787faa8b02fbd963.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-
dda4c0b69607e93b.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-4b7dae8949ac132
c.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-978e97832b309706.rlib" "/nix/
store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-073b1b693304b876.rlib" "/nix/store/rsylh
1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-c07f996a53ee6558.rlib" "/nix/store/rsylh1ac9xpynzh8galg
hjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-0ae8ed6a282247d0.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprl
am420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-978dd04958b6ebcc.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust
/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-14b94bdd9a47d665.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x
-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-bff7534e4dfcef6c.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rust
lib/x86_64-unknown-linux-gnu/lib/libcfg_if-022f1a0e7cd794ec.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unk
nown-linux-gnu/lib/liblibc-ff456575f1773ef0.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/l
ib/liballoc-3aeb407930ebd519.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std
_workspace_core-6ab1ee6dbc17ad08.rlib" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-
166dae07beec0398.rlib" "-Wl,--end-group" "/nix/store/rsylh1ac9xpynzh8galghjjprlam420x-rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcom
piler_builtins-761b290f47712921.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
       >   = note: /nix/store/xdii8qvch5h8chyp0z2is2qzky565w68-binutils-2.35.1/bin/ld: /nix/store/qah4dp8h83cqyc5n19a5rw85hlmmmrwh-pthread
s-w32-2.9.1-x86_64-w64-mingw32/lib/libpthread.a: error adding symbols: file format not recognized
       >           collect2: error: ld returned 1 exit status

Sorry for bringing this up here, but it's the only other reference I can find to this issue. How did you manage to fix this error? The latest fenix/naerks don't seem to have solved it.

figsoda commented 3 years ago

Hacky solution https://github.com/nmattia/naersk/issues/181#issuecomment-874352470