!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

718 Members
Rust164 Servers

Load older messages


SenderMessageTime
9 Mar 2025
@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
@andrew15_5:matrix.orgAndrewI would say a lot, probably.22:44:16
@andrew15_5:matrix.orgAndrewI hope this wouldn't trigger an llvm rebuild, otherwise it's joever.22:45:28
@andrew15_5:matrix.orgAndrew* I hope this won't trigger an llvm rebuild, otherwise it's joever.22:45:39
@andrew15_5:matrix.orgAndrew* I hope this won't trigger the llvm rebuild, otherwise it's joever.22:45:44
@cathal_mullan:matrix.orgCathalthis should work: https://github.com/CathalMullan/rust-wasi-nix22:53:31
@cathal_mullan:matrix.orgCathalbut you'll prob need to recompile llvm22:53:40
@andrew15_5:matrix.orgAndrewI think at this point, it's definitely not how it supposed to work, so should be a bug.23:35:00
@andrew15_5:matrix.orgAndrewsadge 2x.webp
Download sadge 2x.webp
23:35:37
@cathal_mullan:matrix.orgCathalyeah, all of this should 'just work', but since very few people currently rely on wasi, its never really tested. hopefully one day none of these hacks will be needed23:37:53
@andrew15_5:matrix.orgAndrewI mean... I'm pretty sure you can singlehandedly fix it if you make a patch to nixpkgs.23:46:56
@andrew15_5:matrix.orgAndrewThough idk if these are hacks or just missing pieces of the puzzle23:48:23

Show newer messages


Back to Room ListRoom Version: 6