-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
makeWrapper doesn't cross-compile to windows #120726
Comments
replace makewrapper with something creating a binary, such as #95569 (https://github.com/FRidh/make-binary-wrapper) |
Ooh, thanks for the tip. |
I think it would be nice to convert makeWrapper over to makeBinaryWrapper for the whole of nixpkgs at some point. I feel there's still some discussion going on whether or not we want to do that for everything, but we probably want to since there's also other issues that are solved by makeBinaryWrapper (Darwin shebang issues). |
It is easy to replace every makeWrapper by makeBinarywrapper just by replacing the function in all-packages.nix. It turns out makeBinaryWrapper doesn’t work directly out of the box for Windows, for seemingly 2 different reason:
(Turns out execv is not even valid in Windows: https://learn.microsoft.com/en-gb/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way) |
Describe the bug
makeWrapper depends on bash, which doesn't build for windows (see #119206)
It makes sense that bash doesn't build for windows, since it's not supported, and it makes sense that makeWrapper depends on bash, since that's how the wrapper is run.
The problem is many packages depend on makeWrapper, including many libraries which also happen to build executables. What should be done about this? Should we build something into makeWrapper that just no-ops when cross-compiling to windows? Is there a way to get that same functionality working on windows?
see also #120076, where i fixed a specific instance of this
To Reproduce
Steps to reproduce the behavior:
nix-build '<nixpkgs>' --arg crossSystem '{ config = "x86_64-w64-mingw32"; libc = "msvcrt"; }' -A smpeg2
Expected behavior
The package would build at least the library. Not sure if the executables are just not workable or if there's some way to get them working on windows.
Metadata
"x86_64-linux"
Linux 5.10.27, NixOS, 21.05pre281538.9e377a6ce42 (Okapi)
yes
yes
nix-env (Nix) 2.4pre20210326_dd77f71
"nixos-21.05pre281538.9e377a6ce42, nixos-hardware"
"home-manager"
/nix/var/nix/profiles/per-user/root/channels/nixos
Maintainer information:
The text was updated successfully, but these errors were encountered: