PhoenicisOrg / phoenicis-winebuild

Docker based Wine building tool for Linux and macOS
https://www.playonlinux.com/wine/
MIT License
70 stars 20 forks source link

Uplay not working due to compiler flag -fcf-protection #114

Closed dariox86 closed 4 years ago

dariox86 commented 4 years ago

This problem is driving me nuts. The more I try to isolate the issue, the less I understand it. This is related to a known issue described in great detail in this bug report. To make a long story short, Uplay yelds an error message and fails to start when three conditions are met:

My system is based on an AMD CPU and this flag is the default on Fedora and maybe on your Winebuild server, too, hence the issue. As a proof of concept, I built from source an older version of Wine on my operating system (no Phoenicis involved) from before the bug was fixed upstream with and without the compiler flag -fcf-protection. I found that Uplay works when Wine is built without the problematic compiler flag, but fails with the same error message as in Phoenicis when the compiler flag is there. What I don't understand is: why on Earth the problem persists on Phoenicis with the latest versions of Wine even if the issue was fixed upstream long ago? Uplay works just fine on latest Wine installed from the official repository of my operating system (Parabola GNU/Linux-libre, a fork of Arch Linux). It seems as if Phoenicis downloads the same older version of Wine regardless of the version I choose. Is there a way to modify the compiler flags or take a look at the Wine source in Docker before the building process begins?

qparis commented 4 years ago

Hi! Sure, maybe you want to create a patch?

dariox86 commented 4 years ago

Hi! Yes, I do.

dariox86 commented 4 years ago

What shall I do to customize the compiler flags and/or modify the source in Winebuild before Wine is compiled?

Gcenx commented 4 years ago

That’s strange as nowhere is that flag set within phoenicis-winebuild.

It’s possible the issue persisted due to the usage of Debian Stretch, the provided version of gcc could be the issue?

dariox86 commented 4 years ago

Just let me try with Debian Stretch. I will get back to you shortly.

dariox86 commented 4 years ago

@Gcenx, Wine 4.20 development version built from source on Debian 9 works with Uplay. After all in Debian 9 GCC is at version 6, but -fcf-protection was introduced in version 8. I don't know what to think... I am unable to find the source code of Wine when I browse the docker image. Is there a way to take a look at the source code of Wine downloaded by Winebuild? Is there a way to export a CFLAGS in the build environment?

Gcenx commented 4 years ago

@dariox86 naturally your unable to find the wine source within the image as it’s downloaded when selected.

When you selected Wine-4.20 the source is downloaded from winehq/GitHub wine-mirror copied into the image and then compiled within the docker image.

I’m really not sure where this flag is getting introduced from as looking over the docker image it’s not injected anywhere by us.

dariox86 commented 4 years ago

@Gcenx, I know it is downloaded afterwards. What is the path to the source code? I have no previous experience with Docker. I managed to browse the docker image, but I cannot find the downloaded source.

Gcenx commented 4 years ago

@dariox86 you won’t find any source within the docker image as it’s only downloaded when your building wine.

If the build passes or fails for any reason the docker image is wiped so it’s clean for the next time it’s used.

You can download the wine source code from Winehq or from GitHub

dariox86 commented 4 years ago

@Gcenx, you confirmed my suspicion about the removal of the source upon the build process. I will further investigate the issue.

dariox86 commented 4 years ago

It looks like this issue only affects the Flatpak version. The regular version works. You are not responsible for the Flatpak version, are you?

dariox86 commented 4 years ago

Uplay does not work in the Flatpak version of Phoenicis, but it works in the regular version installed on Debian Stretch. I don't really know what to do next.

plata commented 4 years ago

The Phoenicis Flatpak uses the same Wine binary as the "normal" Linux one. There's really no chance that it has different compilation flags set.

dariox86 commented 4 years ago

OK, @plata. Maybe it's just a coincidence. I don't know better.

plata commented 4 years ago

Do you use the runtime in flatpak?

dariox86 commented 4 years ago

Runtimes were installed automatically when I installed Phoenicis.

plata commented 4 years ago

I'm referring to https://github.com/PhoenicisOrg/scripts/pull/1133. As of my experience, the runtime doesn't work in flatpak. See also https://github.com/PhoenicisOrg/phoenicis/pull/2104.

dariox86 commented 4 years ago

I am not sure I understood your question. I tried several Wine version: x86, x86-64, Proton, etc. downloaded by Phoenicis itself. Uplay works in regular Phoenicis and does not work in Flatpak. In both scenarios, Wine was downloaded by Phoenicis.

plata commented 4 years ago

I assume you build Phoenicis from source. Can you try https://github.com/PhoenicisOrg/phoenicis/pull/2104 instead of master and check if that solves the issue with Flatpak?

dariox86 commented 4 years ago

The application yields several error messages about missing components. I can't install anything because the Apps tab only shows a spinning wheel.

dariox86 commented 4 years ago

Issue fixed upstream here and here. We'll see if it works when the next version of Wine is released.

dariox86 commented 4 years ago

Fixed upstream by me in version 5.0-rc1.