| 10 Jun 2026 |
eureka-cpu | * is there a guide for how to cross compile to windows? I have some rust code I'm trying to cross compile from x86_64-linux to mingw-ucrt-x86_64-llvm, but hit a snag on needing pthreads. I added it but then I get the supported platform error since it doesn't include any platforms. What's the intended way of using it? Forgive my sloppy code, but here's what I currently have:
test-cargo-reaper-build-cross-windows =
let
inherit (pkgs.lib.systems.examples.mingw-ucrt-x86_64-llvm.rust) rustcTarget;
crossPkgs = pkgs.pkgsCross.mingw-ucrt-x86_64-llvm;
mingwCC = crossPkgs.stdenv.cc;
crossCC = "${mingwCC}/bin/${mingwCC.targetPrefix}cc";
crossCXX = "${mingwCC}/bin/${mingwCC.targetPrefix}c++";
rustWithWindowsTarget = fenix.packages.${system}.combine [
rustToolchain
(fenix.packages.${system}.targets.${rustcTarget}.toolchainOf {
channel = "1.87.0";
sha256 = "sha256-KUm16pHj+cRedf8vxs/Hd2YWxpOrWZ7UOrwhILdSJBU=";
}).rust-std
];
craneLibCross =
let
craneLib = (crane.mkLib pkgs).overrideToolchain rustWithWindowsTarget;
in
craneLib // (cargoReaper.crane { inherit craneLib; });
crossArgs = {
src = testFileset ./tests/plugin_manifests/package_manifest;
strictDeps = true;
nativeBuildInputs = [
mingwCC
pkgs.llvmPackages.bintools
pkgs.windows.pthreads
];
CARGO_BUILD_TARGET = rustcTarget;
CARGO_TARGET_X86_64_PC_WINDOWS_GNULLVM_LINKER =
"${mingwCC}/bin/${mingwCC.targetPrefix}cc";
"CC_${rustcTarget}" = crossCC;
"CXX_${rustcTarget}" = crossCXX;
};
cargoArtifactsCross = craneLibCross.buildDepsOnly crossArgs;
in
craneLibCross.buildReaperExtension (crossArgs // {
cargoArtifacts = cargoArtifactsCross;
package = "package_manifest";
plugin = "reaper_package_ext";
target = rustcTarget;
doInstallCheck = true;
installCheckPhase = ''
test -f $out/lib/reaper_package_ext.dll
'';
});
| 18:49:17 |
eureka-cpu | Ah so the pthreads problem was with libc, it hasn't even gotten to my build yet:
Cannot build '/nix/store/2qixrw546lxpxqkwyglhzhhnf2m7kv2b-compiler-rt-libc-x86_64-w64-mingw32-21.1.8.drv'
| 19:58:03 |
eureka-cpu | Is mingw just broken atm? | 19:58:57 |
eureka-cpu | * Is mingw-ucrt-x86_64-llvm just broken atm? | 19:59:55 |
symphorien | cross compiling is best effort as a general rule | 20:20:13 |
symphorien | meaning that if nobody cares about a specific triple enough to compile stuff regularly with it and to contribute fixes, it will most probably be broken | 20:21:42 |
| 11 Jun 2026 |
eureka-cpu | I was able to make it work with mingwW64 and some extra environment variables. mingw-ucrt-x86_64-llvm is indeed borked at the moment. | 02:54:09 |
@rosssmyth:matrix.org | Yeah the ucrt code paths are not as well tested. Crane also has weird cross behavior itself, and rustPlatform is more reliable for Rust cross. If you cannot got it to cross with rustPlatform, you can open an issue on Nixpkgs with some logs and an MVP, and post in #windows:nixos.org. One of us may look into it. | 15:21:59 |
eureka-cpu | The crane cross story has gotten more reliable not too long ago | 15:47:46 |
eureka-cpu | I'll give that a try though if I get an ABI mismatch. Was trying to compile a DLL for an application. | 15:48:13 |
| 23 May 2021 |
| @grahamc:nixos.org set the history visibility to "world_readable". | 12:31:03 |
| @grahamc:nixos.org changed the room name to "" from "". | 12:31:03 |
| @grahamc:nixos.org invited Alyssa Ross. | 12:31:18 |
| Alyssa Ross joined the room. | 13:21:04 |
| symphorien joined the room. | 13:29:22 |
| joe joined the room. | 13:29:32 |
| cleverca22 joined the room. | 13:29:44 |
| andi- joined the room. | 13:36:08 |
| sterni joined the room. | 13:39:12 |
| Server Stats Discoverer (traveler bot) joined the room. | 14:52:21 |
| Milan (they/them) 🏳️⚧️ joined the room. | 14:52:24 |
| thefloweringash joined the room. | 14:52:43 |
| Milan (they/them) 🏳️⚧️ changed their profile picture. | 18:30:44 |
| maljub01 joined the room. | 20:05:19 |
| colemickens 🏳️🌈 joined the room. | 21:50:09 |
| 24 May 2021 |
| Matrix Traveler (bot) joined the room. | 03:05:08 |
| rajivr joined the room. | 03:35:42 |
| kunrooted joined the room. | 05:17:10 |
| aaronjanse joined the room. | 07:04:03 |
| vika (she/her) 🏳️⚧️ joined the room. | 07:13:18 |