Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 585576

Summary: =net-misc/freerdp-1.2.1_pre20150326-r1 on musl - fatal error: sys/queue.h: No such file or directory
Product: Gentoo Linux Reporter: Johannes Rosenberger <gentoo>
Component: Current packagesAssignee: Mike Gilbert <floppym>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_sys.2Fqueue.h_not_included_.3F
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    
Attachments: build log
emerge --info
build environment
emerge -qpv
An ebuild that solves (hopefully) all problems.
A tiny patch used by the ebuild.
An ebuild that solves (hopefully) all problems.
patch of freerdp-2.0.0_pre20160610.ebuild against freerdp-1.2.1_pre20160610 (the ebuilds that fix hopefully everything)

Description Johannes Rosenberger 2016-06-11 08:47:00 UTC
Created attachment 437114 [details]
build log

It cannot build because musl has no sys/queue.h by intention(see URL field).
The people of logrotate simply added the file on github[1]. It is the same as in glibc and seems to be simply copied from some BSD. It is not the same but similar to bsd/sys/queue.h from dev-libs/libbsd which, in contrast to the former, includes bsd/sys/cdefs.h.

I see three approaches to the problem:

    1. Provide the file as an extra package.
    2. Provide the file with freerdp (as a patch, possibly proposing
       inclusion of the file to upstream).

These two would have the same consequences for the package. I simualated it by placing the file to /usr/local/include/sys/queue.h and it solved the problem.

    3. Use libbsd. freerdp would depend on it and need
       CFLAGS='-idirafter /usr/lib/bsd'. I tried it out and it solved the
       problem as well. -I/usr/lib/bsd is not an option as it leads to compile
       errors because of ambiguous headers.

Of these three approaches i would prefer no. 1 or 3 since i find it ugly to provide common libs along with every package that uses them.


When this problem was solved for me, i still wasn't able to build the package.
I tried to patch around but found it too much effort. So i made a snapshot-ebuild[2] of yesterday's upstream (they haven't made any release since 2014) and only had to add one tiny patch to have build just fine. I tried it out under a glibc environment and it built as well.

So i'd suggest that as soon as we have decided for a way to fix the described problem i make a version bump request and provide the ebuild+patch according to the preferred solution to this bug.

[1]: https://github.com/logrotate/logrotate/commit/0aa8958a130a0e1459a820e64c566cc2cff9c3de
[2]: https://github.com/jorsn/jorsn-gentoo-musl/tree/master/net-misc/freerdp
Comment 1 Johannes Rosenberger 2016-06-11 08:48:05 UTC
Created attachment 437116 [details]
emerge --info
Comment 2 Johannes Rosenberger 2016-06-11 08:48:47 UTC
Created attachment 437118 [details]
build environment
Comment 3 Johannes Rosenberger 2016-06-11 08:49:15 UTC
Created attachment 437120 [details]
emerge -qpv
Comment 4 Johannes Rosenberger 2016-06-11 08:55:22 UTC
Created attachment 437122 [details]
An ebuild that solves (hopefully) all problems.

The mentioned ebuild of mine.
Comment 5 Johannes Rosenberger 2016-06-11 08:56:54 UTC
Created attachment 437124 [details, diff]
A tiny patch used by the ebuild.
Comment 6 Anthony Basile gentoo-dev 2016-06-11 15:05:37 UTC
(In reply to Johannes Rosenberger from comment #0)
> Created attachment 437114 [details]
> build log
> 
> It cannot build because musl has no sys/queue.h by intention(see URL field).
> The people of logrotate simply added the file on github[1]. It is the same
> as in glibc and seems to be simply copied from some BSD. It is not the same
> but similar to bsd/sys/queue.h from dev-libs/libbsd which, in contrast to
> the former, includes bsd/sys/cdefs.h.
> 
> I see three approaches to the problem:
> 
>     1. Provide the file as an extra package.

i don't think this is necessary.  we had the same issue with openrc and we just added it to the source tree but did not install it on the filesystem.  correct me if i'm wrong, but you only <sys/queue.h> during build time since its a set of macros for linked lists, queues and similar goodies.

> 
> So i'd suggest that as soon as we have decided for a way to fix the
> described problem i make a version bump request and provide the ebuild+patch
> according to the preferred solution to this bug.
> 
> [1]:
> https://github.com/logrotate/logrotate/commit/
> 0aa8958a130a0e1459a820e64c566cc2cff9c3de
> [2]: https://github.com/jorsn/jorsn-gentoo-musl/tree/master/net-misc/freerdp

we almost always accept backporting of upstream solutions.  i didn't look at their solution but if you provide the rev bumped ebuild + patch then i'll see about getting it into the tree.
Comment 7 Anthony Basile gentoo-dev 2016-06-11 15:06:41 UTC
(In reply to Anthony Basile from comment #6)

> we almost always accept backporting of upstream solutions.  i didn't look at
> their solution but if you provide the rev bumped ebuild + patch then i'll
> see about getting it into the tree.

oh sorry, you did that already.
Comment 8 Johannes Rosenberger 2016-06-11 15:19:03 UTC
(In reply to Anthony Basile from comment #7)
> (In reply to Anthony Basile from comment #6)
> 
> > we almost always accept backporting of upstream solutions.  i didn't look at
> > their solution but if you provide the rev bumped ebuild + patch then i'll
> > see about getting it into the tree.
> 
> oh sorry, you did that already.

What did i actually backport? Nothing about queue.h. Upstream doesn't not provide it. I used libbsd in my ebuild. 

And for the other build failures: I think i backported nothing but simply took a newer snapshot of their tree (by referencing the commit in the ebuild).

Or do i understand you wrong?
Comment 9 Johannes Rosenberger 2016-06-11 23:33:48 UTC
Created attachment 437194 [details]
An ebuild that solves (hopefully) all problems.

A fixed ebuild that solves (hopefully) all problems.
Updated the ebuild from my overlay: fixed IUSE and version.
Comment 10 Anthony Basile gentoo-dev 2016-06-12 11:38:22 UTC
(In reply to Johannes Rosenberger from comment #9)
> Created attachment 437194 [details]
> An ebuild that solves (hopefully) all problems.
> 
> A fixed ebuild that solves (hopefully) all problems.
> Updated the ebuild from my overlay: fixed IUSE and version.

i'm confused.  what precisely needs to happen to the tree or the overlay so that this builds?  it might be more helpful to give me a patch against the tree make using `git format-patch`
Comment 11 Johannes Rosenberger 2016-06-12 14:13:48 UTC
Created attachment 437258 [details, diff]
patch of freerdp-2.0.0_pre20160610.ebuild against freerdp-1.2.1_pre20160610 (the ebuilds that fix hopefully everything)

> (In reply to Johannes Rosenberger from comment #9)
> > Created attachment 437194 [details]
> > An ebuild that solves (hopefully) all problems.
> > 
> > A fixed ebuild that solves (hopefully) all problems.
> > Updated the ebuild from my overlay: fixed IUSE and version.
> 
> 
(In reply to Johannes Rosenberger from comment #9)
> Created attachment 437194 [details]
> An ebuild that solves (hopefully) all problems.
> 
> A fixed ebuild that solves (hopefully) all problems.
> Updated the ebuild from my overlay: fixed IUSE and version.
>
>
> i'm confused.  what precisely needs to happen to the tree or the overlay so
> that this builds?  it might be more helpful to give me a patch against the
> tree make using `git format-patch`

i'm confused, too. The changes i made to my ebuild were only to make it more correct. It always built on my systems (musl,glibc). Does it fail on yours? If so, could you provide a build log/error msgs?

The i made to the ebuild were precisely:
    1. Adding 'elibc_musl' to IUSE since i check it in the ebuild.
    2. Changing the ebuild version from 1.2.1 to 2.0.0 since the package
       registers itself as version 2.0.0 with pkg-config.

Are you still confused? If so, against what shall i diff my ebuild? Against the portage tree? Or against the most recent freerdp-ebuild in the portage tree? Or against my old ebuild? In case you meant the latter i uploaded it.
Comment 12 Johannes Rosenberger 2016-06-12 14:15:51 UTC
Btw, is there a way to correct comments later? I think i must be more careful before submitting.
Comment 13 Anthony Basile gentoo-dev 2016-06-12 15:38:45 UTC
i'll test.  its floppym's package so its his call.
Comment 14 Felix Janda 2016-06-12 16:04:02 UTC
Current git version compiles fine for me with the patch from attachment
437124 and the <sys/queue.h> include just commented out.

musl defines CMSPAR only on some archs, but it also can be found in
<asm-generic/termbits.h>. So I think musl should be fixed for here.
(Can submit to upstream when requested.)

Submitted a patch to upstream FreeRDP for the <sys/queue.h> problem:

https://github.com/FreeRDP/FreeRDP/pull/3402
Comment 15 Mike Gilbert gentoo-dev 2016-06-13 00:27:22 UTC
I'll probably just take a new snapshot sometime after your patch lands.
Comment 16 Mike Gilbert gentoo-dev 2016-07-31 23:25:25 UTC
Should be fixed in freerdp-2.0.0_pre20160722.