Skip to content
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 series3 #71216

Closed
wants to merge 4 commits into from
Closed

Wine series3 #71216

wants to merge 4 commits into from

Conversation

angerman
Copy link
Contributor

As mentioned in #68397, wine4 on macOS is busted. This adds a series3 source for wine3 back in; it also adds the macOS system.

@FRidh FRidh mentioned this pull request Oct 16, 2019
@FRidh
Copy link
Member

FRidh commented Oct 16, 2019

Don't merge master. Instead, rebase your changes on top of master.

@FRidh
Copy link
Member

FRidh commented Oct 16, 2019

wine4 built with nix doesn't properly work on macOS.

Is there an issue somewhere describing the problems? Here on our tracker and upstream?

wine4 built with nix doesn't properly work on macOS. Further
investigation is warrented, but in the mean time let's add
wine3 back.
@angerman
Copy link
Contributor Author

wine4 built with nix doesn't properly work on macOS.

Is there an issue somewhere describing the problems? Here on our tracker and upstream?

fdd6937 is really just a missing dependency that nix doesn't provide.
6a0af92 contains some commentary about the result of the linked binary.

even though I was able to build wine4 on macOS Mojave with homebrew; it had the same runtime issues I've experienced with the wine4 built produced by nixpkgs. Those runtime issues mostly concern the execution of the remote-iserv.exe utility I use to cross compile haskell code to windows. The runtime crashes do not happen with wine3. I was not able to nail the exact issue down that causes the runtime crashes of wine. Hence with only a vague "doesn't work", no issues were filed. This is also why I just want to have "series3" available as an additional set of sources; for when stable/unstable just don't work. Sadly we can't override the wine sources through an overlay; that would have been my first choice.

@angerman
Copy link
Contributor Author

angerman commented Oct 16, 2019

Of note: I'd really like to see this back ported to at least

  • 19.03 and
  • 19.09

to make cross compiling of windows haskell applications viable on at least those two releases.

@FRidh
Copy link
Member

FRidh commented Oct 16, 2019

in my opinion it is known that wine doesn't always work and can break certain applications from version to version. Unless we get more reports that things don't work, how about just keeping version 3 outside of Nixpkgs?

@angerman
Copy link
Contributor Author

in my opinion it is known that wine doesn't always work and can break certain applications from version to version. Unless we get more reports that things don't work, how about just keeping version 3 outside of Nixpkgs?

@FRidh sorry, I'm confused. What do you mean by keeping it out of nixpkgs? wine used to be series 3 for long time, but was updated to wine 4 somewhere in 19.03 iirc; which magically started breaking infrastructure built on top of nixpkgs.

We can already choose different "versions" of wine, by setting the wine.release option to stable or unstable; all this does is add series3 in addition. It doesn't even change the defaults.

@bendlas
Copy link
Contributor

bendlas commented Oct 16, 2019

What do you mean by keeping it out of nixpkgs?

https://github.com/nix-community/NUR is one good option for this

We can already choose different "versions" of wine

Still, we keep with the announced versions from https://www.winehq.org/

I'm all for pinning an older version, if it fixes a problem, especially if it doesn't require any separate configuration. A demonstration / documentation of the problem would be really helpful, though, ideally as an automated test.

@angerman
Copy link
Contributor Author

@bendlas well, the way the current wine package is structured with all it's nested callPackage calls, it's rather hard to replace just the sources with something else without having to replace the whole package.

If we sources.nix was exposed in a way that could be overridden with an option that situation would look different.

I'll try to run the builds with stable again and see if I can get the error message; but this will take quite a few hours of recompiling packages.

@angerman
Copy link
Contributor Author

@bendlas here's the error that wine keeps reporting with wine4 on macOS:

preloader: Warning: failed to reserve range 0000000000010000-0000000000110000
preloader: Warning: failed to reserve range 0000000000110000-0000000068000000
preloader: Warning: failed to reserve range 00007fff40000000-00007fff41ff0000
wine: Invalid address.

same derivation with wine3 does not produce this error.

@bendlas
Copy link
Contributor

bendlas commented Oct 17, 2019

If we sources.nix was exposed in a way that could be overridden with an option that situation would look different.

wine.overrideDerivation should already allow source overrides. Still, for a pinned wine3, a c&p'd derivation is ok, to guard against config changes.

I'll try to run the builds with stable again and see if I can get the error message; but this will take quite a few hours of recompiling packages.

Yeah, wine is quite heavy. I don't have a beefy mac (or any for that matter), unfortunately. Maybe somebody in IRC does?

here's the error that wine keeps reporting with wine4 on macOS:

Is there an upstream ticket for that? EDIT I see, you answered that ..

@angerman
Copy link
Contributor Author

@bendlas so how are we going to move forward from here? Yes, I could c&p it all into my own expression. I'd rather not do this though. Especially as wine4 is broken on darwin.

Is your stance that this is not going to go into nixpkgs? If so we can close this ticket; however having it open doesn't help me to make a decision either way. I'd really like to get off of custom nixpkgs forks at work.

@FRidh
Copy link
Member

FRidh commented Oct 21, 2019

wine.overrideDerivation should already allow source overrides.

overrideAttrs is preferred over overrideDerivation.

@bendlas
Copy link
Contributor

bendlas commented Oct 21, 2019

@bendlas so how are we going to move forward from here?

Basically, without a Mac, I can't verify the problem, nor the fix, so I might be the wrong person to help get this in.

I'd need to make sure all the necessary work gets done, without being able to do it myself:

  • collecting at least a second account of the problem
  • creating an upstream ticket
  • creating a test script (this could replace a second account)
  • integrate into darwin pkgs wine = wine3 / wine4;, meta.platforms

Is your stance that this is not going to go into nixpkgs?

My stance is

I'm all for pinning an older version, if it fixes a problem

I will add that we ship nixpkgs to all users, so the bar should be accordingly high.

Maybe adding a checkPhase could help demonstrate the problem during build. What I'm aiming for is, being able to recognize when the pin will be no longer necessary.

I think there was feedback about meta.platforms on the previous ticket. That might allow the darwin builder to check this PR.

I'd really like to get off of custom nixpkgs forks at work.

I can recommend overlays. The can replace many fork use cases.

@avnik
Copy link
Contributor

avnik commented Oct 30, 2019

Haven't anything against adding series3 on its owns. But could we have simplified way, to inject any arbitrary wine version to build? Or maybe maintain all released wine versions as NUR? (I remember situation, when some apps/games require specific wine version)?

(It also can help us maintain unstable/staging automatically, actually we can update them automatically on staging tag appear in their repo)

@angerman_ btw, why stable 4.0 branch not solve your problems, if I understand their versioning policy, 4.0.x is a stabilization of 3.x, where 4.x (w/o zero) is a new features.

(I able to test only nixos/linux, not OSX)

@avnik
Copy link
Contributor

avnik commented Oct 30, 2019

withdraw my note about "4.0.x", because patchset about 3.0.x, and not about 3.x.

@avnik
Copy link
Contributor

avnik commented Dec 22, 2019

Well, after some thinking, and upcoming 5.0 release, I decide to approve this approach. I would add series4 myself, when 5.0 branch become new stable. (I myself have at least one application, which not work in upcoming 5.0).

Also I would like to simplify injection of arbitrary wine release to build process, and make a NUR with all available wine releases. (just a note for future roadmap)

Copy link
Contributor

@avnik avnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good for me.
(except darwin related cleanup, mentioned above)

pkgs/misc/emulators/wine/base.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot requested a review from avnik December 22, 2019 14:06
Copy link
Contributor

@avnik avnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@angerman
Copy link
Contributor Author

@bendlas @7c6f434c what's the final verdict on this?

iohk-bors bot added a commit to cardano-foundation/cardano-wallet that referenced this pull request Jan 29, 2020
1265: Update nixpkgs channel to 19.09 r=rvl a=angerman

# Overview

This updates the nixpkgs version to 19.09 (latest stable release) from 19.03 (unsupported old release).

# Details

haskell.nix (as referenced in this repository) for the purpose of running CI, was using a custom nixpkgs-19.03 branch. It has been the goal for a while to upgrade from nixpkgs-19.03 to nixpkgs-19.09. Ideally to the stock upstream one without custom patches. This PR updates the nixpkgs-19.03 pin to nixpkgs-19.09 and fixes the issues (as encountered below) in haskell.nix. Subsequently this PR also contains a updated haskell.nix pin. The `w64` issue stems from nixpkgs changing the identifier for windows cross from `x86_64-pc-mingw32` to `x86_64-w64-mingw32` from nixpkgs 19.03 to 19.09. This interacts badly with the jormungandr reference for windows, and @rvl will take a look at that within cardano-wallet, as it can not be fixed in haskell.nix.

# Comments

Issues encountered:
- [x] ```error: attribute 'series3' missing, at /nix/store/87zygi9fxvgqkdflsd5hmx947aj3mf1m-nixpkgs/pkgs/misc/emulators/wine/packages.nix:6:11```
     This is due to missing NixOS/nixpkgs#71216

- [x] ```Unknown vendor: w64```
   This seems to be due to jourmungandr using some 18.09git checkout, which doesn't sport the `w64` vendor, but uses `pc` instead.

- [x] ```/nix/store/d7q2kp5saj7xd9wii7cyfis8y3s4d2sj-network-2.6.3.6-setup-x86_64-w64-mingw32/bin/Setup: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory```
   Which is due to
   ```
   ldd /nix/store/d7q2kp5saj7xd9wii7cyfis8y3s4d2sj-network-2.6.3.6-setup-x86_64-w64-mingw32/bin/Setup
           linux-vdso.so.1 (0x00007ffeb9369000)
           libm.so.6 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libm.so.6 (0x00007f7a4695c000)
           librt.so.1 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/librt.so.1 (0x00007f7a46952000)
           libutil.so.1 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libutil.so.1 (0x00007f7a4694d000)
           libdl.so.2 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libdl.so.2 (0x00007f7a46948000)
           libpthread.so.0 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libpthread.so.0 (0x00007f7a46927000)
           libgmp.so.10 => not found
           libffi.so.6 => not found
           libc.so.6 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libc.so.6 (0x00007f7a4676f000)
           /nix/store/wx1vk75bpdr65g6xwxbj4rw0pk04v5j3-glibc-2.27/lib/ld-linux-x86-64.so.2 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f7a46af4000)
   ```
   Which originated from NixOS/nixpkgs#56555 where `NIX_DONT_SET_RPATH` is now set on more leniently.  This requires us to properly fix the build level we build the Setup.hs with in haskell.nix; it needs to come from the `buildPackages.stdenv`, not from the `stdenv`, which in the case of cross compilation would be the one for the final host.


[Hydra jobset](https://hydra.iohk.io/jobset/Cardano/cardano-wallet-pr-1265)


Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
iohk-bors bot added a commit to cardano-foundation/cardano-wallet that referenced this pull request Jan 30, 2020
1265: Update nixpkgs channel to 19.09 r=rvl a=angerman

# Overview

This updates the nixpkgs version to 19.09 (latest stable release) from 19.03 (unsupported old release).

# Details

haskell.nix (as referenced in this repository) for the purpose of running CI, was using a custom nixpkgs-19.03 branch. It has been the goal for a while to upgrade from nixpkgs-19.03 to nixpkgs-19.09. Ideally to the stock upstream one without custom patches. This PR updates the nixpkgs-19.03 pin to nixpkgs-19.09 and fixes the issues (as encountered below) in haskell.nix. Subsequently this PR also contains a updated haskell.nix pin. The `w64` issue stems from nixpkgs changing the identifier for windows cross from `x86_64-pc-mingw32` to `x86_64-w64-mingw32` from nixpkgs 19.03 to 19.09. This interacts badly with the jormungandr reference for windows, and @rvl will take a look at that within cardano-wallet, as it can not be fixed in haskell.nix.

# Comments

Issues encountered:
- [x] ```error: attribute 'series3' missing, at /nix/store/87zygi9fxvgqkdflsd5hmx947aj3mf1m-nixpkgs/pkgs/misc/emulators/wine/packages.nix:6:11```
     This is due to missing NixOS/nixpkgs#71216

- [x] ```Unknown vendor: w64```
   This seems to be due to jourmungandr using some 18.09git checkout, which doesn't sport the `w64` vendor, but uses `pc` instead.

- [x] ```/nix/store/d7q2kp5saj7xd9wii7cyfis8y3s4d2sj-network-2.6.3.6-setup-x86_64-w64-mingw32/bin/Setup: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory```
   Which is due to
   ```
   ldd /nix/store/d7q2kp5saj7xd9wii7cyfis8y3s4d2sj-network-2.6.3.6-setup-x86_64-w64-mingw32/bin/Setup
           linux-vdso.so.1 (0x00007ffeb9369000)
           libm.so.6 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libm.so.6 (0x00007f7a4695c000)
           librt.so.1 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/librt.so.1 (0x00007f7a46952000)
           libutil.so.1 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libutil.so.1 (0x00007f7a4694d000)
           libdl.so.2 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libdl.so.2 (0x00007f7a46948000)
           libpthread.so.0 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libpthread.so.0 (0x00007f7a46927000)
           libgmp.so.10 => not found
           libffi.so.6 => not found
           libc.so.6 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib/libc.so.6 (0x00007f7a4676f000)
           /nix/store/wx1vk75bpdr65g6xwxbj4rw0pk04v5j3-glibc-2.27/lib/ld-linux-x86-64.so.2 => /nix/store/pnd2kl27sag76h23wa5kl95a76n3k9i3-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f7a46af4000)
   ```
   Which originated from NixOS/nixpkgs#56555 where `NIX_DONT_SET_RPATH` is now set on more leniently.  This requires us to properly fix the build level we build the Setup.hs with in haskell.nix; it needs to come from the `buildPackages.stdenv`, not from the `stdenv`, which in the case of cross compilation would be the one for the final host.


[Hydra jobset](https://hydra.iohk.io/jobset/Cardano/cardano-wallet-pr-1265)


Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
Copy link
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change commit messages according to the guidelines https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md
They may read something like: "winePackages.wine3: init at 3.0.2" and "wine: fix darwin build"

@@ -12,6 +12,31 @@ let fetchurl = args@{url, sha256, ...}:
pkgs.fetchFromGitHub { inherit owner repo rev sha256; } // args;
in rec {

series3 = fetchurl rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you not going to add it to pkgs/top-level/wine-packages.nix?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we could really use a comment with a list of upstream bugs that prevent wine 5 from working in your case.

@@ -62,6 +62,8 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
++ lib.optionals stdenv.isDarwin (with pkgs.buildPackages.darwin.apple_sdk.frameworks; [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, drop this commit and the next one

# pass `-mmacosx-version-min` in the LDFLAGS, and end up with a linked
# binary against 10.14 which *does* contain a __DATA,__dyld section and
# then horribly fail to run on Mojave.
postConfigure = lib.optional (stdenv.hostPlatform.isDarwin) ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work as well:

Suggested change
postConfigure = lib.optional (stdenv.hostPlatform.isDarwin) ''
makeFlags = lib.optional (stdenv.hostPlatform.isDarwin) "LDFLAGS=-mmacosx-version-min=10.7";

Otherwise replace optional with optionalString and please use substituteInPlace instead of sed as it prints warning if the original string is not found.

@angerman angerman closed this Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants