Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 941626 - dev-vcs/git-2.47.0: Compile errors in unit tests [Prefix]
Summary: dev-vcs/git-2.47.0: Compile errors in unit tests [Prefix]
Status: UNCONFIRMED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: parallel-make
  Show dependency tree
 
Reported: 2024-10-16 11:13 UTC by Moritz Brunner
Modified: 2024-12-23 05:57 UTC (History)
3 users (show)

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


Attachments
Build log (build.log,370.28 KB, text/plain)
2024-10-16 11:14 UTC, Moritz Brunner
Details
Build environment (environment,135.70 KB, text/plain)
2024-10-16 11:14 UTC, Moritz Brunner
Details
emerge --info (emerge-info.txt,6.56 KB, text/plain)
2024-10-16 11:14 UTC, Moritz Brunner
Details
emerge -pqv (emerge-pqv.txt,276 bytes, text/plain)
2024-10-16 11:15 UTC, Moritz Brunner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Brunner 2024-10-16 11:13:34 UTC
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
Comment 1 Moritz Brunner 2024-10-16 11:14:03 UTC
Created attachment 906082 [details]
Build log
Comment 2 Moritz Brunner 2024-10-16 11:14:22 UTC
Created attachment 906083 [details]
Build environment
Comment 3 Moritz Brunner 2024-10-16 11:14:43 UTC
Created attachment 906084 [details]
emerge --info
Comment 4 Moritz Brunner 2024-10-16 11:15:17 UTC
Created attachment 906085 [details]
emerge -pqv
Comment 5 Xavier Miller 2024-10-17 17:43:34 UTC
I also got unit test error in almost arches : arm, amd64
seems there is a MAKE race condition
whit MAKEOPTS="-j1" this compiled fine
Comment 6 Moritz Brunner 2024-10-18 06:57:57 UTC
Unfortunately, removing parallel compilation with -j1 does not fix the problem for me.
Comment 7 Moritz Brunner 2024-10-21 07:10:13 UTC
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.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-21 07:22:31 UTC
(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.
Comment 9 Vladimir B. Vinogradov 2024-10-21 13:26:00 UTC
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.
Comment 10 Arve Barsnes 2024-10-25 08:00:00 UTC
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.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-29 07:07:07 UTC
(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>
Comment 13 Moritz Brunner 2024-11-29 10:50:13 UTC
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.
Comment 14 Arve Barsnes 2024-11-29 11:18:17 UTC
Same for me, the same error on what I would expect to a fairly normal setup. It still builds with MAKEOPTS="-j1"