Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 639424 - app-misc/screen-4.4.0 no longer compiles on musl systems (struct utmp incomplete type)
Summary: app-misc/screen-4.4.0 no longer compiles on musl systems (struct utmp incompl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Sven Wegener
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-01 19:11 UTC by David Flogeras
Modified: 2018-05-21 20:48 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Failed build.log (build.log,15.14 KB, text/x-log)
2017-12-01 19:12 UTC, David Flogeras
Details
emerge --info (emerge.info,4.61 KB, application/x-info)
2017-12-02 16:51 UTC, David Flogeras
Details
list of current updates (current-upgrades,13.17 KB, text/plain)
2017-12-03 09:33 UTC, tt_1
Details
Fix utmp/utmpx handling on musl (screen-74fdc8988b55633cd05f8625390cd3f6a8102003.patch,1.78 KB, patch)
2017-12-16 15:28 UTC, David Flogeras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Flogeras 2017-12-01 19:11:38 UTC
As the name suggests.  I tried keywording 4.5.1 and 4.6.2 with the same results.  Attaching build.log next.

Reproducible: Always
Comment 1 David Flogeras 2017-12-01 19:12:16 UTC
Created attachment 507530 [details]
Failed build.log
Comment 2 tt_1 2017-12-02 07:56:52 UTC
please provide the output of emerge --info
Comment 3 David Flogeras 2017-12-02 16:51:17 UTC
Created attachment 507766 [details]
emerge --info

Sorry about that, here it is
Comment 4 tt_1 2017-12-02 17:47:30 UTC
Figured out in the meantime that it happens on amd64-musl, with gcc-6.4.0 and musl-1.18.0 - wonder if one of these is to blame for this regression?

I really need a working app-misc/screen on musl for administrating a headless rpi server, so I will try to find out if it compiles with other combinations of gcc/musl. 

You are working in a qemu-chroot? Hence the missleading output of uname in the emerge --info?
Comment 5 David Flogeras 2017-12-02 20:30:47 UTC
Yes, I'm running an arm qemu chroot.

I tried with gcc-5.4.0 and same results.  Points more to musl related issue?
Comment 6 tt_1 2017-12-02 22:03:16 UTC
Ok, so with a toolchain of musl-1.1.18, gcc-5.4.0-r3 (patchset 1.4) and binutils-2.28.1 it compiles just fine, on armv7a-hardfloat-vanilla. 

Can you go back to the old binutils with gcc-5.4.0-r3, and try again to compile? I can do the same for gcc-6.4.0 with my amd64 system.
Comment 7 David Flogeras 2017-12-02 23:32:43 UTC
On it.  My first crack will be with gcc-5.4.0-r3 with patchset 1.3.  It's what I had kicking around in a binary pkg.  Depending on the result, I may have to rebuild gcc with patchset 1.4, which will take some time since qemu is quite slow for gcc.  I'll let you know once binutils has downgraded.
Comment 8 tt_1 2017-12-03 00:04:12 UTC
In any case, please make a backup of the rootfs you're working with. This likely is a nasty one to nail down. 

The combination of gcc-6.4.0 and older binutils-2.28.1 for the case of amd64 does result in the same compile error as before.
Comment 9 David Flogeras 2017-12-03 01:16:57 UTC
Ok, here with
binutils-2.28.1
gcc-5.4.0-r3 (patchset 1.3)
musl-1.1.18

It still fails to build screen for me.  I'll rebuild gcc-5.4.0-r3 overnight with the latest ebuild from the musl overlay and test again (and take your advice and back-up prior).  I notice also that since I built my gcc-5.4.0-r3, there were two other patches added to the ebuild as well, namely:

epatch "${FILESDIR}"/${PN}-5.4.0-pr70473.patch
epatch "${FILESDIR}"/${PN}-5.4.0-pr71696-CVE-2016-6131.patch
Comment 10 tt_1 2017-12-03 09:33:17 UTC
Created attachment 507856 [details]
list of current updates

This is the list of upgrade, without them app-misc/screen builds fine. Will try to find out by upgrading them one by one if any of them breaks the compile. 

for gcc-5 patchset: 
patchset 1.4 adds 91_all_compatibility_fix_with_perl_5.26.patch
patchset 1.5 adds 92_all_asan-signal_h.patch
Comment 11 David Flogeras 2017-12-03 11:35:15 UTC
OK, after rebuilding gcc-5.4.0-r3 with current ::musl ebuild (patchset 1.4), I still cannot emerge screen.

Did you rebuild musl after switching GCC ?
Comment 12 tt_1 2017-12-03 16:31:09 UTC
All the upgrades ran through, but I still can't confirm the breakage on my arm system.

The history of emerge on my system is first gcc-4.9.4, then musl-1.1.16, then gcc-5.4.0-r3 and later on musl 1.1.18, skipping 1.1.17. Since then I haven't rebuild gcc-5.4.0-r3, but can clearly recall that I merged gcc-5 with the gcc-5.4.0-pr70473.patch from the very beginning, because I'd run out of memory on the device without this patch. Swapping not helpfull either. Not sure about the second of these patches. 

So will try to rebuild my gcc-5 with the aim to trigger this bug here. 

Also it might be possible that something in the eclass (toolchain.eclass) got changed, these sort of silent revbumps are rather popular nowadays.
Comment 13 David Flogeras 2017-12-14 11:49:12 UTC
I made some progress with this.  It seems that this is a screen problem wrt utmp/utmpx handling.  The #musl people nicely showed me that this was fixed in screen's git in 2015, but for some reason hasn't been put out in a release yet.

I can successfully build screen-9999 in the affected environment.

I'm not sure what to do longer-pole, since I'd like to not rely on a git checkout.  I've asked in #screen and am waiting for a response.
Comment 14 David Flogeras 2017-12-16 15:28:02 UTC
Ok, Amadeusz was kind enough to find a way ahead for us.

If I understand correctly, this patch was added on screen-v4 codebase to fix this problem, but then had to be reverted because it broke some other platforms (Cygwin, ..).

https://git.savannah.gnu.org/cgit/screen.git/commit/?h=screen-v4&id=74fdc8988b55633cd05f8625390cd3f6a8102003

If I apply just this patch to screen-4.4.0 (the 4.5 and 4.6 ebuilds will also need it), it compiles and works for me on the affected system.  The whole thing will be moot when screen-v5 is released, since the way utmp/utmpx was cleaned up a lot and the patch will become unnecessary then.

@ tt__1 could you try the patch?  I'll also attach to the bug
Comment 15 David Flogeras 2017-12-16 15:28:41 UTC
Created attachment 510342 [details, diff]
Fix utmp/utmpx handling on musl
Comment 16 tt_1 2017-12-17 07:03:48 UTC
Bug is solved by applying 74fdc8988b55633cd05f8625390cd3f6a8102003 on top of 4.4.0, and likely all other versions. 

Would it be mergable into the tree? I mean, do we care about cygwin?
Comment 17 David Flogeras 2017-12-17 12:34:50 UTC
If not, worst case could follow what the musl overlay does for gcc and something like this?

if use elibc_musl; then
   epatch "${FILESDIR}"/blah.patch
fi
Comment 18 Stuart Longland 2017-12-31 07:30:38 UTC
Just hit this myself actually… with a fresh AMD64 stage3 tarball generated from Catalyst this afternoon (which I can throw online if anyone is interested).

The patch given in comment #15 fixes the build of screen-4.4.0 for me.
Comment 19 Larry the Git Cow gentoo-dev 2018-01-04 23:18:50 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2aacf8d5e4052441f9bb791051a30146bf65793e

commit 2aacf8d5e4052441f9bb791051a30146bf65793e
Author:     Sven Wegener <swegener@gentoo.org>
AuthorDate: 2018-01-04 23:15:15 +0000
Commit:     Sven Wegener <swegener@gentoo.org>
CommitDate: 2018-01-04 23:18:40 +0000

    app-misc/screen: Fix building on musl libc, bug #639424
    
    Closes: https://bugs.gentoo.org/639424
    Package-Manager: Portage-2.3.14, Repoman-2.3.6

 app-misc/screen/files/screen-4.4.0-utmp-musl.patch | 62 ++++++++++++++++++++++
 app-misc/screen/screen-4.4.0.ebuild                |  3 +-
 2 files changed, 64 insertions(+), 1 deletion(-)
Comment 20 tt_1 2018-01-05 11:20:58 UTC
Thanks for pushing the fix to the 4.4.0 ebuild, but can you please include it to all the other ebuilds in tree as well? 4.5 branch and 4.6 branch are also affected by the bug and it shouldn't be too much of a big deal, no backporting needed as fare as I see.
Comment 21 tt_1 2018-05-21 20:48:13 UTC
ping! 

screen-4.6.1 got stable and still needs this patch. 
same for screen-4.6.1, the live ebuild is fine though.

likely to be fixed in 4.6.3, so just the two above please, thank you!