!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

702 Members
Rust160 Servers

Load older messages


SenderMessageTime
9 Mar 2025
@andrew15_5:matrix.orgAndrew I tried pkgsCross.wasi32.buildPackages.libunwind and libunwind and it didn't help. 18:22:23
@andrew15_5:matrix.orgAndrewbut at least llvm compiled successfully. In one hour.18:22:40
@andrew15_5:matrix.orgAndrewIt should install that automatically anyway, otherwise what's the point in reproducibility.18:23:20
@phanirithvij:matrix.orgloudgolem
# nixos-unstable
$ git rev-parse HEAD
36fd87baa9083f34f7f5027900b62ee6d09b1f2f
$ nom build -f default.nix pkgsCross.wasi32.buildPackages.libunwind --print-out-paths
Finished at 23:57:40 after 0s
/nix/store/c3m2ib9lpw24r3amxlfqak6bh515kdnq-libunwind-1.8.1
18:28:25
@phanirithvij:matrix.orgloudgolemmaybe it was broken at some point18:28:37
@phanirithvij:matrix.orgloudgolem if you are using flakes try a nix flake update nixpkgs 18:29:05
@andrew15_5:matrix.orgAndrewI updated it just one day ago18:29:21
@andrew15_5:matrix.orgAndrewit says it's from 2025-03-0618:30:19
@andrew15_5:matrix.orgAndrew you need to build the pkgsCross.wasi32.buildPackages.rustc 18:37:08
@phanirithvij:matrix.orgloudgolemyeah, started the build18:37:23
@phanirithvij:matrix.orgloudgolem llvm> [17/4467] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Allocator.cpp.o 18:38:00
@andrew15_5:matrix.orgAndrewWell, good luck.18:38:35
@andrew15_5:matrix.orgAndrewIs it still going?19:57:07
10 Mar 2025
@phanirithvij:matrix.orgloudgolem
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index d7a1ee625f9c..cf5ab3459894 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -360,6 +360,7 @@ stdenv.mkDerivation (finalAttrs: {
         mkdir -p $out/lib
         ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so
         ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so.1
+        ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libunwind.so.1
       '')
     ];
 

got past that (I think)

but getting this

wasm32-unknown-wasi-rustc> WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.
wasm32-unknown-wasi-rustc> NOTE: to silence this warning, add `change-id = 133207` at the top of `config.toml`
wasm32-unknown-wasi-rustc> thread 'main' panicked at src/core/build_steps/compile.rs:389:13:
wasm32-unknown-wasi-rustc> Target "wasm32-wasip1" does not have a "wasi-root" key in Config.toml or `$WASI_SDK_PATH` set
wasm32-unknown-wasi-rustc> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
wasm32-unknown-wasi-rustc> Build completed unsuccessfully in 0:00:56

don't know much about wasi or cross compilation

02:51:22
@phanirithvij:matrix.orgloudgolem😅 I had to sleep02:53:09
@phanirithvij:matrix.orgloudgolem is pkgsCross.wasi32.buildPackages.rustc supposed to work normally /p.q? 02:54:52
@phanirithvij:matrix.orgloudgolem * is pkgsCross.wasi32.buildPackages.rustc supposed to work normally /p.q\? 02:54:55
@phanirithvij:matrix.orgloudgolem * is pkgsCross.wasi32.buildPackages.rustc supposed to work normally? 02:55:05
@andrew15_5:matrix.orgAndrew
In reply to @phanirithvij:matrix.org
😅 I had to sleep
Understandable.
03:34:48
@andrew15_5:matrix.orgAndrewI did find some context for this: https://github.com/rust-lang/rust/issues/73432#issuecomment-64707988603:49:21
@andrew15_5:matrix.orgAndrew emily, so is the pkgsCross.wasi32.buildPackages.rustc broken then? 10:13:17
@cathal_mullan:matrix.orgCathal Andrew: I've been looking into WASI cross compilation lately. Managed to get it working, but required quite a few 'hacks'. See the overlays here: https://github.com/DuskSystems/nix-zed-extensions 19:29:05
@andrew15_5:matrix.orgAndrew

Is this the whole hack?

final: prev: {
  # Setup custom 'wasm32-wasip2' target.
  # Dont touch 'wasi32', since it would trigger a Firefox recompilation.
  pkgsCross = prev.pkgsCross // {
    wasm32-wasip2 = import prev.path {
      inherit (prev) system;

      crossSystem = prev.lib.systems.examples.wasi32 // {
        rust = {
          rustcTarget = "wasm32-wasip2";
        };
      };
    };
  };
}
22:33:09
@andrew15_5:matrix.orgAndrew *

Is this the whole hack?

final: prev: {
  # Setup custom 'wasm32-wasip2' target.
  # Dont touch 'wasi32', since it would trigger a Firefox recompilation.
  pkgsCross = prev.pkgsCross // {
    wasm32-wasip2 = import prev.path {
      inherit (prev) system;

      crossSystem = prev.lib.systems.examples.wasi32 // {
        rust = {
          rustcTarget = "wasm32-wasip2";
        };
      };
    };
  };
}
22:33:27
@cathal_mullan:matrix.orgCathalno, thats just creating a custom cross target, since i specifically needed wasip2, where nix defaults to wasip122:34:04
@cathal_mullan:matrix.orgCathalthe other overlay has the bulk of the hack22:34:23
@cathal_mullan:matrix.orgCathalthe tldr is: build a mock wasi-sdk, and setup the correct env variable to let rustc use it. then include libunwind as well. then use lld for linking22:36:11
@cathal_mullan:matrix.orgCathali can create a minimal reproduction, gimme a few mins22:39:16
@andrew15_5:matrix.orgAndrewlooks awful, but I see the already known libunwind and wasi-sdk packages, so I guess the truth was somewhere very close.22:43:32
@andrew15_5:matrix.orgAndrewthat is indeed quite a few hacks22:43:57

Show newer messages


Back to Room ListRoom Version: 6