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

Bug 832430

Summary: net-ftp/ftp-0.17.34.0.2.5.1 with sys-libs/musl-1.2.2-r7: cmds.c:602:41: error: GLOB_BRACE undeclared (first use in this function)
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=713246
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
define GLOB_BRACE for musl compatibility
musl patch for net-ftp/ftp-0.17.34.0.2.5.1.ebuild

Description Agostino Sarubbo gentoo-dev 2022-01-31 12:44:52 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: net-ftp/ftp-0.17.34.0.2.5.1 fails to compile.
Discovered on: amd64 (internal ref: tinderbox_musl)

NOTE:
This machine uses MUSL libc
Comment 1 Agostino Sarubbo gentoo-dev 2022-01-31 12:44:54 UTC
Created attachment 764048 [details]
build.log

build log and emerge --info
Comment 2 Mike Gilbert gentoo-dev 2022-01-31 16:41:00 UTC
Looks like GLOB_BRACE isn't supported on musl.
Comment 3 CFuga 2022-06-23 14:50:35 UTC
Created attachment 787103 [details, diff]
define GLOB_BRACE for musl compatibility

musl doesn't define GLOB_BRACE for glob(3), because is a GNU extension. This patch only sets GLOB_BRACE to zero.
Comment 4 CFuga 2022-06-23 14:56:01 UTC
Created attachment 787106 [details, diff]
musl patch for net-ftp/ftp-0.17.34.0.2.5.1.ebuild

This patch makes the following changes to the net-ftp/ftp ebuild, for musl support:

* add sys-libs/obstack-standalone as a dependency
* apply the GLOB_BRACE patch
* add -lobstack as a linking library
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-25 04:28:54 UTC
(In reply to CFuga from comment #4)
> Created attachment 787106 [details, diff] [details, diff]
> musl patch for net-ftp/ftp-0.17.34.0.2.5.1.ebuild
> 
> This patch makes the following changes to the net-ftp/ftp ebuild, for musl
> support:
> 
> * add sys-libs/obstack-standalone as a dependency
> * apply the GLOB_BRACE patch
> * add -lobstack as a linking library

It should be okay to apply the patch unconditionally, e.g. https://patchwork.kernel.org/project/selinux/patch/20180517051117.48454-5-jason@perfinion.com/ has some context (but I figure you were being conservative).

For something like this where upstream is long gone, it matters less, but in general, better to do unconditional patching so it doesn't stop applying but nobody notices, etc: https://devmanual.gentoo.org/ebuild-writing/misc-files/patches/index.html#conditional-patching.

Thanks!
Comment 6 Larry the Git Cow gentoo-dev 2022-06-25 04:37:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6cfdad620208e2b48ab0c22785ba9cf3c646cee6

commit 6cfdad620208e2b48ab0c22785ba9cf3c646cee6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-06-25 04:27:19 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-06-25 04:29:11 +0000

    net-ftp/ftp: fix musl build; modernise
    
    Closes: https://bugs.gentoo.org/832430
    Thanks-to: Cristian Othón Martínez Vera <cfuga@cfuga.mx>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../ftp-0.17.34.0.2.5.1-musl-glob-brace.patch      | 14 ++++++++++
 net-ftp/ftp/ftp-0.17.34.0.2.5.1.ebuild             | 30 ++++++++++++++--------
 2 files changed, 33 insertions(+), 11 deletions(-)