The package fails to compile with several errors in unit-tests/unit-test.c, even though the package is built with -test USE flag. The errors appear to be related to the -std=c99 compile flag, which disables GNU extensions. dev-vcs/git-2.46.2 and previous releases were working fine. This problem appears to be related to Prefix, as 2.47.0 was building fine on a real Gentoo installation. Reproducible: Always
Created attachment 906082 [details] Build log
Created attachment 906083 [details] Build environment
Created attachment 906084 [details] emerge --info
Created attachment 906085 [details] emerge -pqv
I also got unit test error in almost arches : arm, amd64 seems there is a MAKE race condition whit MAKEOPTS="-j1" this compiled fine
Unfortunately, removing parallel compilation with -j1 does not fix the problem for me.
After looking into this problem more, it appears that the Git build system is picking up on the host system (CentOS 7 in my case) by inspecting `uname -r` and adjusting compile flags accordingly in config.mak.uname: > # centos7/rhel7 provides gcc 4.8.5 and zlib 1.2.7. > ifneq ($(findstring .el7.,$(uname_R)),) > BASIC_CFLAGS += -std=c99 > endif The C99 standard disables GNU extensions that are required to compile `t/unit-tests/clar/clar.c` in the build tree. When I change the the above part in config.mak.uname to `-std=gnu99`, the package compiles fine.
(In reply to Xavier Miller from comment #5) > I also got unit test error in almost arches : arm, amd64 > seems there is a MAKE race condition > whit MAKEOPTS="-j1" this compiled fine I think that's a different problem.
The problem is in this - you should call ${WORKDIR}/t/unit-tests/clar/generate.py to generate clar.suite file. After that 'generation' git-2.47.0-r1 compiles fine for me. P.S. I'm no so close to ebuild syntax to call via ebuld ${WORKDIR}/t/unit-tests/clar/generate.py . So I can't provide correct patch to this ebuild.
I did not have this error on 2.47.0, but the "clar" error popped up on -r1. MAKEOPTS="-j1" made it build for me.
* https://github.com/git/git/commit/ea3422662d21c33c349cc71e9cdbfe235e8f6905 * https://github.com/git/git/commit/7d5f18a901a7b2c2fd4722b0dbc915b97e61787b * https://github.com/git/git/commit/a779c8e8d5eab375c3b2137b91af51c378f49b33 * https://github.com/git/git/commit/67f75dfe1b2ad9529dab81591d981a9b9f297c67
(In reply to Sam James from comment #11) At least some of these patches are in: commit 741383c4e344884149a1449250d6b260777feeff Author: Sam James <sam@gentoo.org> Date: Tue Nov 26 02:54:06 2024 +0000 dev-vcs/git: add 2.47.1 Signed-off-by: Sam James <sam@gentoo.org>
The problem still persists with Git 2.47.1 in my particular use case, at least - I assume most people do not walk around with ancient CentOS Prefix hosts.
Same for me, the same error on what I would expect to a fairly normal setup. It still builds with MAKEOPTS="-j1"