Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 934990 - sys-process/tini-0.19.0-r1 fails to compile: tini.c:227:36: error: implicit declaration of function basename [-Wimplicit-function-declaration]
Summary: sys-process/tini-0.19.0-r1 fails to compile: tini.c:227:36: error: implicit d...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Zac Medico
URL:
Whiteboard: musl/
Keywords: PATCH
Depends on:
Blocks: musl-1.2.5
  Show dependency tree
 
Reported: 2024-06-27 06:58 UTC by Agostino Sarubbo
Modified: 2025-03-05 02:49 UTC (History)
6 users (show)

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


Attachments
build.log (build.log,50.82 KB, text/plain)
2024-06-27 06:58 UTC, Agostino Sarubbo
Details
Patch to musl system (01-fix-missing-basename.patch,479 bytes, patch)
2025-03-03 03:01 UTC, Hans.von.Hohenstaufen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2024-06-27 06:58:40 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: sys-process/tini-0.19.0-r1 fails to compile.
Discovered on: amd64 (internal ref: tinderbox_musl)
System: MUSL-SYSTEM (https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#MUSL)

Info about the issue:
https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CF0002
Comment 1 Agostino Sarubbo gentoo-dev 2024-06-27 06:58:40 UTC
Created attachment 896478 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2024-06-27 06:58:42 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:


FAILED: CMakeFiles/tini-static.dir/src/tini.c.o 
FAILED: CMakeFiles/tini.dir/src/tini.c.o 
/var/tmp/portage/sys-process/tini-0.19.0-r1/work/tini-0.19.0/src/tini.c:227:36: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2024-10-24 20:51:20 UTC
Not c99 related.
Comment 4 Bryce Copeland 2024-11-24 08:32:30 UTC
Hi, not a dev sorry, but I think this issue is caused by the recent removable of the basename() function from string.h in musl 1.2.5

The package compiles successfully on musl 1.2.4, and I think adding libgen.h to tini.c should resolve the issue.

I think something like this will work, but I'm going to try testing it a bit later tonight when I can set up an env with musl 1.2.5 :)

diff --git a/src/tini.c b/src/tini.c
index eb62015..8466b66 100644
--- a/src/tini.c
+++ b/src/tini.c
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <signal.h>
 #include <string.h>
+#include <libgen.h>
 #include <time.h>
 #include <stdio.h>
 #include <stdlib.h>
Comment 5 Quincy Fleming 2024-11-25 06:34:26 UTC
(In reply to Bryce from comment #4)
> Hi, not a dev sorry, but I think this issue is caused by the recent
> removable of the basename() function from string.h in musl 1.2.5
> 
> The package compiles successfully on musl 1.2.4, and I think adding libgen.h
> to tini.c should resolve the issue.
> 
> I think something like this will work, but I'm going to try testing it a bit
> later tonight when I can set up an env with musl 1.2.5 :)
> 
> diff --git a/src/tini.c b/src/tini.c
> index eb62015..8466b66 100644
> --- a/src/tini.c
> +++ b/src/tini.c
> @@ -9,6 +9,7 @@
>  #include <errno.h>
>  #include <signal.h>
>  #include <string.h>
> +#include <libgen.h>
>  #include <time.h>
>  #include <stdio.h>
>  #include <stdlib.h>

There is a pull request with this patch: https://github.com/krallin/tini/pull/223

The patch works fine on my system.
Comment 6 vadorovsky 2025-02-23 12:36:37 UTC
Upstream didn't react to the PR with fix since April 2024. The last merged PR is from January 2023. I think it's safe to assume that the project is just unmaintained.

Would you be open to switching from tini to catatonit? It's already packaged and used for podman, I think we could make it work with docker as well.
Comment 7 Hans.von.Hohenstaufen 2025-03-03 03:01:39 UTC
Created attachment 920157 [details, diff]
Patch to musl system

The bug still present in 0.19.0-r1 version.

This patch works fine on my system.
Comment 8 Larry the Git Cow gentoo-dev 2025-03-05 02:49:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86bb4af29fee8a1c83ca9f30f885e0e0b4147329

commit 86bb4af29fee8a1c83ca9f30f885e0e0b4147329
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2025-03-05 02:44:16 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2025-03-05 02:49:04 +0000

    sys-process/tini: Patch basename for musl
    
    Closes: https://bugs.gentoo.org/934990
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-process/tini/files/tini-0.19.0-musl-basename.patch | 13 +++++++++++++
 sys-process/tini/tini-0.19.0-r1.ebuild                 |  4 +++-
 2 files changed, 16 insertions(+), 1 deletion(-)