Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 832430 - 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)
Summary: net-ftp/ftp-0.17.34.0.2.5.1 with sys-libs/musl-1.2.2-r7: cmds.c:602:41: error...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-01-31 12:44 UTC by Agostino Sarubbo
Modified: 2022-06-25 04:37 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,41.93 KB, text/plain)
2022-01-31 12:44 UTC, Agostino Sarubbo
Details
define GLOB_BRACE for musl compatibility (ftp-0.17.23.0.2.1-glob_brace.patch,280 bytes, patch)
2022-06-23 14:50 UTC, CFuga
Details | Diff
musl patch for net-ftp/ftp-0.17.34.0.2.5.1.ebuild (ftp-0.17.34.0.2.5.1.ebuild-musl.patch,679 bytes, patch)
2022-06-23 14:56 UTC, CFuga
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(-)