-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue cross-compiling to Windows from NixOS #52
Comments
It's an issue on nixos 21.05 that The expr I opened a backport PR for 21.05. You can checkout and apply it on your nixpkgs. NixOS/nixpkgs#139697 |
Also note that the component |
Thank you-- after a bit more research I thought And yeah, I know |
I'm sorry, I have a bit of a dumb question. Apologies for bothering you, and feel entirely free not to answer as I'm aware this is extremely out of scope for this project! Attempting to build for Windows gives the MinGW error that it What I don't understand is how it's even possible for a library to change the linker used. My let
unstable = import (fetchTarball https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz);
pkgs = unstable {
crossSystem = { config = "x86_64-w64-mingw32"; };
overlays = [
(import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
];
};
rust = pkgs.buildPackages.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rust-analysis" ];
targets = [ "x86_64-pc-windows-gnu" ];
};
in pkgs.mkShell {
nativeBuildInputs = with pkgs; [
rust
];
buildInputs = with pkgs; [
windows.mingw_w64_pthreads
windows.pthreads
];
} |
I use your shell.nix and Also if you specify the |
I'm sorry, I forgot to include important information. Adding And that's awesome, removed it! |
I did some more experimenting. It looks like it isn't the dependency's fault either, simply creating a |
I believe I narrowed it down as much as I can. The build.rs is compiled with gcc so it runs on the current platform, and the rest of the project is compiled with mingw. The NIX_LDFLAGS contains the windows version of the pthreads library which gcc doesn't understand. If I manually remove it, then mingw doesn't understand the built-in linux version. |
I think you could report this issue to |
That sounds fun! Thanks for the time. |
I'm trying to cross-compile a Rust project to Windows with MinGW. I'm getting the ungoogleable error "rust is no available" and I'm not sure what next steps to take.
This is the smallest
shell.nix
that can reproduce the problem:And the error message:
The text was updated successfully, but these errors were encountered: