WineHQ
Bug Tracking Database – Bug 48878

 Bugzilla

 

Last modified: 2020-04-14 15:15:32 UTC  

Debian packaging: do out-of-tree builds and enable multi-arch builds from same machine

Bug 48878 - Debian packaging: do out-of-tree builds and enable multi-arch builds from same machine
Debian packaging: do out-of-tree builds and enable multi-arch builds from sam...
Status: UNCONFIRMED
AppDB: Show Apps affected by this bug
Product: Packaging
Classification: Unclassified
Component: wine-packages
unspecified
x86 Linux
: P2 normal
: ---
Assigned To: Mr. Bugs
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2020-04-04 05:58 UTC by Luca Boccassi
Modified: 2020-04-14 15:15 UTC (History)
6 users (show)

See Also:
Regression SHA1:
Fixed by SHA1:
Distribution: Debian
Staged patchset:


Attachments
Patch to add postinst to set cap_net_raw on installation (3.05 KB, patch)
2020-04-04 05:58 UTC, Luca Boccassi
Details | Diff
Patch to build out of tree (972 bytes, patch)
2020-04-04 05:59 UTC, Luca Boccassi
Details | Diff
Patch to remove gcc from build-dep (already default) and set perl and prelink to :any (947 bytes, patch)
2020-04-04 09:07 UTC, Luca Boccassi
Details | Diff
Patch to use DEB_HOST_ARCH instead of DEB_BUILD_ARCH (1.46 KB, patch)
2020-04-04 09:09 UTC, Luca Boccassi
Details | Diff
Patch to fully enable multi-arch cross build of i386 from amd64 (7.01 KB, patch)
2020-04-04 10:24 UTC, Luca Boccassi
Details | Diff
Patch to fully enable multi-arch cross build of i386 from amd64 (6.93 KB, patch)
2020-04-04 12:56 UTC, Luca Boccassi
Details | Diff
Patch to fully enable multi-arch cross build of i386 from amd64 (6.23 KB, patch)
2020-04-05 05:45 UTC, Luca Boccassi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Boccassi 2020-04-04 05:58:13 UTC
Hi,

I am attaching two patches for the Debian packaging that is published on OBS at https://build.opensuse.org/package/show/Emulators:Wine:Debian/wine-staging

The first one adds postints and a dependency on libcap-bin, so that wineserver, wine-loader and wine64-loader can get cap_net_raw added on installation. Some games need to be able to send ICMP packets for anti-cheat reasons - see https://appdb.winehq.org/objectManager.php?sClass=version&iId=31145
Adding cap_net_raw means they don't need to be ran as root to do that, which is obviously bad.

The second patch improves debian/rules so that it does out-of-tree automake builds in debian/build-$ARCH. This is the first step to allow multi-arch builds to work more smoothly.

I had sent this as a PR on OBS but I was told to open a bug instead:

https://build.opensuse.org/request/show/789262

I cannot find a git repository to create patches against, so I've done that manually.
Comment 1 Luca Boccassi 2020-04-04 05:58:52 UTC
Created attachment 66815 [details]
Patch to add postinst to set cap_net_raw on installation
Comment 2 Luca Boccassi 2020-04-04 05:59:13 UTC
Created attachment 66816 [details]
Patch to build out of tree
Comment 3 Luca Boccassi 2020-04-04 09:07:08 UTC
Created attachment 66821 [details]
Patch to remove gcc from build-dep (already default) and set perl and prelink to :any

The prelink:any change requires a fix for the following bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955742
which I will upload to Debian shortly. I have pre-built it on OBS:

https://build.opensuse.org/package/show/home:bluca:branches:Emulators:Wine:Debian/prelink
Comment 4 Luca Boccassi 2020-04-04 09:09:01 UTC
Created attachment 66822 [details]
Patch to use DEB_HOST_ARCH instead of DEB_BUILD_ARCH

DEB_BUILD_ARCH references the architecture of the machine where the build is happening, not the architecture the packages are being built for. This allows dpkg-buildpackage -ai386 to run (it still requires a solution for wine-tools to complete successfully in a self-contained manner).
Comment 5 Luca Boccassi 2020-04-04 10:24:18 UTC
Created attachment 66826 [details]
Patch to fully enable multi-arch cross build of i386 from amd64

This patch refactores the autoconf flags settings in rules, removes the explicit dependency on gcc (it's part of build-essential), moves all manpages to wine-staging (tools are not build on cross-build so dh_install fails), uses ln -sf (to allow building with -nc).

With these patches, a rebuilt prelink and execstack with Multi-Arch: allowed, I can successfully build amd64 and i386 packages from the same source directory with the following one-time steps:

dpkg --add-architecture i386
apt update
apt build-dep .
apt buil-dep -ai386 .
dpkg-buildpckage
dpkg-buildpackage -ai386

Building amd64 first is necessary to get winetools built. It's possible to make the i386 build on amd64 completely self contained by building only the tools directory first. If I have time I'll send another patch to do that. But usually one wants both amd64 and i386 packages, so this is good enough for me right now.
Comment 6 Rosanne DiMesio 2020-04-04 11:21:45 UTC
(In reply to Luca Boccassi from comment #0)
> 
> The first one adds postints and a dependency on libcap-bin, so that
> wineserver, wine-loader and wine64-loader can get cap_net_raw added on
> installation. 

I've asked the wine-staging maintainers to weigh in on that.

> 
> The second patch improves debian/rules so that it does out-of-tree automake
> builds in debian/build-$ARCH. This is the first step to allow multi-arch
> builds to work more smoothly.
> 
"More smoothly" is rather vague; exactly what problem with the WineHQ packages does this solve? i586 and x86_64 builds are done separately on the OBS, and I've seen no evidence this causes a problem for users of our packages.
Comment 7 Luca Boccassi 2020-04-04 12:55:36 UTC
(In reply to Rosanne DiMesio from comment #6)
> (In reply to Luca Boccassi from comment #0)
> > 
> > The first one adds postints and a dependency on libcap-bin, so that
> > wineserver, wine-loader and wine64-loader can get cap_net_raw added on
> > installation. 
> 
> I've asked the wine-staging maintainers to weigh in on that.

Thanks - note that this applies to all 3 flavours, not just -staging. I just don't know where the "true source" lives, so I don't have a base to generate patches from. I've picked staging because it's what I use. Is there a repository?

> > 
> > The second patch improves debian/rules so that it does out-of-tree automake
> > builds in debian/build-$ARCH. This is the first step to allow multi-arch
> > builds to work more smoothly.
> > 
> "More smoothly" is rather vague; exactly what problem with the WineHQ
> packages does this solve? i586 and x86_64 builds are done separately on the
> OBS, and I've seen no evidence this causes a problem for users of our
> packages.

A user/developer can do apt source -b winehq-<foo> and, without having to use any i386-specific host/chroot of any form, can build both sets of packages.
I've used this extensively while bisecting issues, for example. By building and installing the packages I can be 100% sure that there's no differences due to prefixes, and that everything that is installed is then tracked and removed by dpkg. No leftovers lying around.
Note that it's no longer just more smoothly, but it now fully works with the second patch.

Also it's about quality: using DEB_BUILD_ARCH to do checks for the target architecture is just wrong - this is because of the very confusing GNU nomenclature of course, but it's still good to fix. Using ln without -f is also not great - it makes incremental builds not possible.
Comment 8 Luca Boccassi 2020-04-04 12:56:21 UTC
Created attachment 66829 [details]
Patch to fully enable multi-arch cross build of i386 from amd64
Comment 9 Zeb Figura 2020-04-04 14:10:09 UTC
In theory, I think this affects everything except staging—since staging falls back to spawning ping(8)—but I don't know the details.
Comment 10 Luca Boccassi 2020-04-04 14:11:45 UTC
(In reply to Zebediah Figura from comment #9)
> In theory, I think this affects everything except staging—since staging
> falls back to spawning ping(8)—but I don't know the details.

I use staging, and I constantly have problems in BF4 when I forget to add cap_net_raw to the wine binaries. Servers can't see my latency, so I get kicked out until I add cap_net_raw and restart.
Comment 11 Zeb Figura 2020-04-04 22:54:46 UTC
Not commenting on other changes, but:

(In reply to Luca Boccassi from comment #8)
> +# gcc 10 uses -fno-common
> +export DEB_CFLAGS_MAINT_APPEND+=-fcommon

We shouldn't need this, not after ea032bb7f8.

> +CONFLAGS=--prefix=/opt/wine-staging \

Is this a typo?
Comment 12 Luca Boccassi 2020-04-05 05:21:38 UTC
(In reply to Zebediah Figura from comment #11)
> Not commenting on other changes, but:
> 
> (In reply to Luca Boccassi from comment #8)
> > +# gcc 10 uses -fno-common
> > +export DEB_CFLAGS_MAINT_APPEND+=-fcommon
> 
> We shouldn't need this, not after ea032bb7f8.

Ok thanks, can be dropped then.

> > +CONFLAGS=--prefix=/opt/wine-staging \
> 
> Is this a typo?

You mean CONFLAGS vs CONFFLAGS? Sure probably a typo - doesn't really matter as long as it's consistent
Comment 13 Luca Boccassi 2020-04-05 05:45:35 UTC
Created attachment 66832 [details]
Patch to fully enable multi-arch cross build of i386 from amd64

(In reply to Luca Boccassi from comment #12)
> (In reply to Zebediah Figura from comment #11)
> > Not commenting on other changes, but:
> > 
> > (In reply to Luca Boccassi from comment #8)
> > > +# gcc 10 uses -fno-common
> > > +export DEB_CFLAGS_MAINT_APPEND+=-fcommon
> > 
> > We shouldn't need this, not after ea032bb7f8.
> 
> Ok thanks, can be dropped then.
> 
> > > +CONFLAGS=--prefix=/opt/wine-staging \
> > 
> > Is this a typo?
> 
> You mean CONFLAGS vs CONFFLAGS? Sure probably a typo - doesn't really matter
> as long as it's consistent

Fixed both.
Comment 14 Rosanne DiMesio 2020-04-05 09:17:38 UTC
Luca,

You opened this bug for two unrelated issues, and the basic rule in bugzilla is one problem per bug. Most of the comments here have been about multi-arch cross builds, so I'm going to ask to you open a separate bug for the cap_net_raw issue and attach only the patches for that there.
Comment 15 Luca Boccassi 2020-04-05 09:43:01 UTC
(In reply to Rosanne DiMesio from comment #14)
> Luca,
> 
> You opened this bug for two unrelated issues, and the basic rule in bugzilla
> is one problem per bug. Most of the comments here have been about multi-arch
> cross builds, so I'm going to ask to you open a separate bug for the
> cap_net_raw issue and attach only the patches for that there.

Sure no problem, done:

https://bugs.winehq.org/show_bug.cgi?id=48889
Comment 16 Luca Boccassi 2020-04-14 15:15:32 UTC
(In reply to Luca Boccassi from comment #5)
> With these patches, a rebuilt prelink and execstack with Multi-Arch:
> allowed, I can successfully build amd64 and i386 packages from the same
> source directory with the following one-time steps:

The fixed version of prelink is now in Debian unstable:

https://tracker.debian.org/pkg/prelink


Privacy Policy
If you have a privacy inquiry regarding this site, please write to [email protected]

Hosted By CodeWeavers