-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Wine (with mingw support) #103102
Comments
@cawilliamson I think something like this should work: { wine, pkgsCross }:
wine.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [
# Needed if building with wine32 or wineWow
pkgsCross.mingw32.buildPackages.gcc
# Needed if building with wine64 or wineWow
pkgsCross.mingwW64.buildPackages.gcc
];
# Fixes -Werror=format-security
hardeningDisable = attrs.hardeningDisable ++ [ "format" ];
}) You should see something like this in your build output:
I've had to do something similar when trying build Guy1524's Easy Anti-Cheat fork: |
I am not sure what it actually does, but maybe |
@Metadark Thanks a lot for that - I also faced another problem which your linked code sorted - the "compiler cannot create executables" error - strictDeps looks to have solved it though. 👍 @7c6f434c I can tell you - it uses the mingw compiler to compile "PE DLLs" (I believe this is in reference to Windows PE DLLs but could be wrong.) It then uses these in place of the normal fake builtin DLLs it uses. This enables a much more convincing Windows environment which some apps / games appear to need. |
@7c6f434c I can tell you - it uses the mingw compiler to compile "PE DLLs" (I believe this is in reference to Windows PE DLLs but could be wrong.) It then uses these in place of the normal fake builtin DLLs it uses. This enables a much more convincing Windows environment which some apps / games appear to need.
Ahhh makes perfect sense.
Do I understand correctly that build closure grows quite a bit? Any impact on runtime closure? I will merge a PR adding an off-by-default MinGW option, absent some well-grounded onjections, but maybe it should indeed be off-by-default. I guess if runtime closure change is small and build closure change is within 20% or so, we could enable by default…
|
@7c6f434c I'm not too sure what closure means in this context D: What I will say, however, is that this is OFF by default in most distros so I think it should be added as an option and not enabled by default - just as you suggested. @Metadark Your changes got me a lot further in to the build but I believe I am missing one critical change - the build runs correctly and starts building DLLs via mingw but then fails out with:
Actual overlay pkg (including the fix for exactly this error from your code linked above.) I wonder if mingw is ignoring the hardeningDisable flag or is using defaults somewhere? We're so close to fixing this I can feel it! 👍 :
|
I think Arch builds wine with mingw: https://github.com/archlinux/svntogit-community/blob/packages/wine-staging/trunk/PKGBUILD#L52 ( In official wine repos for fedora (https://dl.winehq.org/wine-builds/fedora/33/x86_64/) there are lines:
and for Ubuntu (https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/source/wine-staging_5.21~bionic.dsc), there is mingw-w64 in So, if it doesn't increase closure size by too much, I'd say it's a good idea to enable it by default. |
@7c6f434c I'm not too sure what closure means in this context D: What I will say, however, is that this is OFF by default in most distros so I think it should be added as an option and not enabled by default - just as you suggested.
Transitive closure: deps, deps-of-deps, deps-of-deps-of-deps-of-deps…
This can go over runtime or build-time dependencies, of course
But yes, no need to look too deeply into impact if the default is off.
|
@cawilliamson Hmm, it worked for me when specifying @7c6f434c I'll gather information about the closure sizes for each configuration (wine32, wine64, wineWow) and I'll also look into creating a PR that adds a new support flag. |
@Metadark I hadn't noticed that little difference - changed it to overrideAttrs and it's now building properly from the looks of things. Thanks again for all of your help on this - that's super helpful! 👍 @7c6f434c It looks like it was disabled by default in Gentoo (in: https://gitweb.gentoo.org/repo/gentoo.git/tree/app-emulation/wine-vanilla/wine-vanilla-5.21.ebuild) due to the following bug: https://bugs.gentoo.org/685172 ^ This may not be all that relevant to NixOS - just wanted to bring it to your attention. |
@cawilliamson Hm, interesting. We'll see. @Metadark if it is default-off, feel free to skip the closure-measuring step for anything you are not going to use anyway. No need to build something just for that. |
@7c6f434c I noticed that runtime closures were dramatically increased with this option:
It looks like development header files from
Right now I'm looking into why they're being added and if they can be removed / reduced. |
If mingw is disabled by default, perhaps it could be added as a new attribute so that it's cached? Considering it's enabled by default in (at least) Arch and official wine repos, some users may expect it to be enabled by default in NixOS too. Having to override wine for e.g. lutris and also build wine (which takes a pretty long time) is a lot of friction for an unexperienced NixOS user (or someone with not so powerful hardware). |
@wedens Preferably we would enable it by default. Once, binutils 2.34 is merged to nixpkgs which contains the bugfix for stripping wine DLLS we can re-enable stripping to avoid the closure increase caused by the header references. |
Considering the OP mentioned specifically games, I'll just mention that lutris now ships (via its "runners" machinery) wine 5.21 with mingw. |
@cawilliamson Now that #103358 has been merged you can just use: wine.override {
mingwSupport = true;
} This isn't currently enabled by default or cached, but does this solve your issue? Hopefully we can enable this on the base build once #89793 is merged, and after stripping is enabled. |
I don't seem to be able to overwrite
|
@cawilliamson Did you eventually get WoW 9.0.2 running? Starting https://gist.github.com/mweinelt/241d77476daf8efa2439731a398add82 This is on wine 5.22:
|
Just a heads up, I noticed a regression running Cities: Skylines (specifically the Paradox Launcher) with
It looks like this is a problem upstream (I have the exact same problem with Lutris wine), but for now I'm just forcing it to launch with a wine built with |
With mingwSupport enabled, Wine uses MinGW builds of GCC (compiled for the i686-w64-mingw32 & x86_64-w64-mingw32 targets) to cross compile system DLLs as PE executables. This is used to workaround some basic anticheat software. (See NixOS#103102) Fedora & Arch Linux also have this enabled by default in their Wine builds: - Fedora: https://src.fedoraproject.org/rpms/wine/blob/8e216ca407b6c0f78f65f36c5b068c6452701e55/f/wine.spec#_116 - Arch Linux: https://github.com/archlinux/svntogit-community/blob/2435e762eacd989c588200d7cf57d8f4fb2e0cf3/trunk/PKGBUILD#L44
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/wine-installing-mingw32-compiler/19944/2 |
Project description
There is a great wine package currently in NixOS but it lacks mingw support for the DLLs.
This is needed for a few games including World of Warcraft it seems. Basically we need to build WINE with "--with-mingw" compile flag. The problem I have here is - I have no idea how to actually include the mingw compiler as a dependency to WINE.
Any help here would be appreciated.
Metadata
The text was updated successfully, but these errors were encountered: