threads / discuss / 63542

Build Failure: Git 2.50.0-rc0 on NonStop

Subject: Build Failure: Git 2.50.0-rc0 on NonStop

## tl;dr

13 messages between May 28, 2025 and Jun 1, 2025.

replies: 12people: 7as markdown or json

rsbecker@nexbridge.com· May 28, 2025, 18:59 UTC · lore
I encountered the following failure of rc0:
static void file_release_data(void *b REFTABLE_UNUSED, struct
reftable_block_data *dest REFTABLE_UNUSED)
                                        ^
"/home/jenkinsbuild/.jenkins/workspace/Git_Pipeline/reftable/blocksource.c",
line 105: error(112):  expected a ")"
I am not at all sure why this is failing at this point. Compiler is c99.

-- Brief whoami: NonStop&UNIX developer since approximately UNIX(421664400) NonStop(211288444200000000) -- In real life, I talk too much.

Carlo Marcelo Arenas Belón· May 29, 2025, 10:11 UTC · re: rsbecker@nexbridge.com · lore

[PATCH] reftable: make REFTABLE_UNUSED C99 compatible

Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED` annotation, 2025-02-18), the reftable library was migrated to use an internal version of `UNUSED`, which unconditionally sets a GNU __attribute__ to avoid warnings function parameters that are not being used.

Make the definition conditional to prevent breaking the build with non GNU compilers.

Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 reftable/basics.h | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/reftable/basics.h b/reftable/basics.h
index d8888c1262..7d22f96261 100644
--- a/reftable/basics.h
+++ b/reftable/basics.h
@@ -16,7 +16,11 @@
 #include "system.h"
 #include "reftable-basics.h"
 
+#ifdef __GNUC__
 #define REFTABLE_UNUSED __attribute__((__unused__))
+#else
+#define REFTABLE_UNUSED
+#endif
 
 /*
  * Initialize the buffer such that it is ready for use. This is equivalent to
-- 
2.50.0.rc0.1.gb4243b6ac8
Junio C Hamano· May 29, 2025, 16:17 UTC · re: Carlo Marcelo Arenas Belón · lore

Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible

Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:
Show 8 quoted lines
> Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED`
> annotation, 2025-02-18), the reftable library was migrated to
> use an internal version of `UNUSED`, which unconditionally sets
> a GNU __attribute__ to avoid warnings function parameters that
> are not being used.
>
> Make the definition conditional to prevent breaking the build
> with non GNU compilers.
Quite a reasonable reasoning.
Show 19 quoted lines
> Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  reftable/basics.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/reftable/basics.h b/reftable/basics.h
> index d8888c1262..7d22f96261 100644
> --- a/reftable/basics.h
> +++ b/reftable/basics.h
> @@ -16,7 +16,11 @@
>  #include "system.h"
>  #include "reftable-basics.h"
>  
> +#ifdef __GNUC__
>  #define REFTABLE_UNUSED __attribute__((__unused__))
> +#else
> +#define REFTABLE_UNUSED
> +#endif

Corresponding definition we use in the main part of the project defined in compat/posix.h looks like this:

        #if GIT_GNUC_PREREQ(4, 5)
        #define UNUSED __attribute__((unused)) \
                __attribute__((deprecated ("parameter declared as UNUSED")))
        #elif defined(__GNUC__)
        #define UNUSED __attribute__((unused)) \
                __attribute__((deprecated))
        #else
        #define UNUSED
        #endif

GCC 4.5 or older may no longer be relevant, in which case yours may be good enough.

Will queue.  Thanks.
brian m. carlson· May 29, 2025, 23:13 UTC · re: Junio C Hamano · lore

Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible

On 2025-05-29 at 16:17:14, Junio C Hamano wrote:
Show 15 quoted lines
> Corresponding definition we use in the main part of the project
> defined in compat/posix.h looks like this:
> 
>         #if GIT_GNUC_PREREQ(4, 5)
>         #define UNUSED __attribute__((unused)) \
>                 __attribute__((deprecated ("parameter declared as UNUSED")))
>         #elif defined(__GNUC__)
>         #define UNUSED __attribute__((unused)) \
>                 __attribute__((deprecated))
>         #else
>         #define UNUSED
>         #endif
> 
> GCC 4.5 or older may no longer be relevant, in which case yours may
> be good enough.

RHEL 7, which is now well past EOL, had GCC 4.8 and Debian 7, released in 2013 and also well past EOL, had GCC 4.7. I think we can safely assume nobody within our support policy is using GCC before 4.5.

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Junio C Hamano· May 30, 2025, 04:12 UTC · re: brian m. carlson · lore

Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible

"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 20 quoted lines
> On 2025-05-29 at 16:17:14, Junio C Hamano wrote:
>> Corresponding definition we use in the main part of the project
>> defined in compat/posix.h looks like this:
>> 
>>         #if GIT_GNUC_PREREQ(4, 5)
>>         #define UNUSED __attribute__((unused)) \
>>                 __attribute__((deprecated ("parameter declared as UNUSED")))
>>         #elif defined(__GNUC__)
>>         #define UNUSED __attribute__((unused)) \
>>                 __attribute__((deprecated))
>>         #else
>>         #define UNUSED
>>         #endif
>> 
>> GCC 4.5 or older may no longer be relevant, in which case yours may
>> be good enough.
>
> RHEL 7, which is now well past EOL, had GCC 4.8 and Debian 7, released
> in 2013 and also well past EOL, had GCC 4.7.  I think we can safely
> assume nobody within our support policy is using GCC before 4.5.

Good digging. There is another one in git-compat-util.h that is conditional on GIT_GNUC_PREREQ(3,1) which we can simplify away to just "#ifdef __GNUC__", together with the above. Of course totally outside of Carlo's fix to the reftable library.

Thanks.
Patrick Steinhardt· May 30, 2025, 05:35 UTC · re: Junio C Hamano · lore

Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible

On Thu, May 29, 2025 at 09:17:14AM -0700, Junio C Hamano wrote:
Show 48 quoted lines
> Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:
> 
> > Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED`
> > annotation, 2025-02-18), the reftable library was migrated to
> > use an internal version of `UNUSED`, which unconditionally sets
> > a GNU __attribute__ to avoid warnings function parameters that
> > are not being used.
> >
> > Make the definition conditional to prevent breaking the build
> > with non GNU compilers.
> 
> Quite a reasonable reasoning.
> 
> > Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com>
> > Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> > ---
> >  reftable/basics.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/reftable/basics.h b/reftable/basics.h
> > index d8888c1262..7d22f96261 100644
> > --- a/reftable/basics.h
> > +++ b/reftable/basics.h
> > @@ -16,7 +16,11 @@
> >  #include "system.h"
> >  #include "reftable-basics.h"
> >  
> > +#ifdef __GNUC__
> >  #define REFTABLE_UNUSED __attribute__((__unused__))
> > +#else
> > +#define REFTABLE_UNUSED
> > +#endif
> 
> Corresponding definition we use in the main part of the project
> defined in compat/posix.h looks like this:
> 
>         #if GIT_GNUC_PREREQ(4, 5)
>         #define UNUSED __attribute__((unused)) \
>                 __attribute__((deprecated ("parameter declared as UNUSED")))
>         #elif defined(__GNUC__)
>         #define UNUSED __attribute__((unused)) \
>                 __attribute__((deprecated))
>         #else
>         #define UNUSED
>         #endif
> 
> GCC 4.5 or older may no longer be relevant, in which case yours may
> be good enough.

What I don't understand though: we have a `MAYBE_UNUSED` macro that has the exact same definition in "git-compat-util.h". Why does the macro cause issues in the reftable library, but not over there?

Patrick
Jeff King· May 30, 2025, 06:25 UTC · re: Patrick Steinhardt · lore

Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible

On Fri, May 30, 2025 at 07:35:49AM +0200, Patrick Steinhardt wrote:
> What I don't understand though: we have a `MAYBE_UNUSED` macro that has
> the exact same definition in "git-compat-util.h". Why does the macro
> cause issues in the reftable library, but not over there?

We turn __attribute__() into a noop for some platforms earlier in git-compat-util.h. So it doesn't need a separate #ifdef.

-Peff
Patrick Steinhardt· May 30, 2025, 08:47 UTC · re: Jeff King · lore

Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible

On Fri, May 30, 2025 at 02:25:33AM -0400, Jeff King wrote:
Show 8 quoted lines
> On Fri, May 30, 2025 at 07:35:49AM +0200, Patrick Steinhardt wrote:
> 
> > What I don't understand though: we have a `MAYBE_UNUSED` macro that has
> > the exact same definition in "git-compat-util.h". Why does the macro
> > cause issues in the reftable library, but not over there?
> 
> We turn __attribute__() into a noop for some platforms earlier in
> git-compat-util.h. So it doesn't need a separate #ifdef.

Ah, that's something I missed when introducing `REFTABLE_UNUSED`. With that added context the patch looks sensible to me. Thanks!

Patrick
Junio C Hamano· May 30, 2025, 16:28 UTC · re: Patrick Steinhardt · lore

Re: [PATCH] reftable: make REFTABLE_UNUSED C99 compatible

Patrick Steinhardt <ps@pks.im> writes:
> Ah, that's something I missed when introducing `REFTABLE_UNUSED`.
> With that added context the patch looks sensible to me. Thanks!
OK, let's fast-track the fix down to 'master' before '-rc1', then.
Thanks, all.
rsbecker@nexbridge.com· May 30, 2025, 12:04 UTC · re: rsbecker@nexbridge.com · lore

[Bug] Build Failure: Git 2.50.0-rc0 on NonStop

On May 28, 2025 2:59 PM, I wrote:
Show 7 quoted lines
>To: git@vger.kernel.org
>I encountered the following failure of rc0:
>
>static void file_release_data(void *b REFTABLE_UNUSED, struct
>reftable_block_data *dest REFTABLE_UNUSED)
>                                        ^
>"/home/jenkinsbuild/.jenkins/workspace/Git_Pipeline/reftable/blocksource.c"
,
>line 105: error(112):  expected a ")"
>
>
>I am not at all sure why this is failing at this point. Compiler is c99.
Looking for help on resolving this before rc1.

Sincerely, Randall

Kristoffer Haugsbakk· May 30, 2025, 14:19 UTC · re: rsbecker@nexbridge.com · lore

Re: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop

On Fri, May 30, 2025, at 14:04, rsbecker@nexbridge.com wrote:
>> [snip]
>>I am not at all sure why this is failing at this point. Compiler is c99.
>
> Looking for help on resolving this before rc1.
Patch: https://lore.kernel.org/git/20250529101136.16219-1-carenas@gmail.com/
Patrick Steinhardt· May 30, 2025, 14:26 UTC · re: rsbecker@nexbridge.com · lore

Re: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop

On Fri, May 30, 2025 at 08:04:47AM -0400, rsbecker@nexbridge.com wrote:
Show 15 quoted lines
> On May 28, 2025 2:59 PM, I wrote:
> >To: git@vger.kernel.org
> >I encountered the following failure of rc0:
> >
> >static void file_release_data(void *b REFTABLE_UNUSED, struct
> >reftable_block_data *dest REFTABLE_UNUSED)
> >                                        ^
> >"/home/jenkinsbuild/.jenkins/workspace/Git_Pipeline/reftable/blocksource.c"
> ,
> >line 105: error(112):  expected a ")"
> >
> >
> >I am not at all sure why this is failing at this point. Compiler is c99.
> 
> Looking for help on resolving this before rc1.

Did you maybe miss the proposed patch at [1]? That should fix your issue.

Patrick
[1]: <20250529101136.16219-1-carenas@gmail.com>
rsbecker@nexbridge.com· Jun 1, 2025, 09:36 UTC · re: Patrick Steinhardt · lore

RE: [Bug] Build Failure: Git 2.50.0-rc0 on NonStop

On May 30, 2025 10:27 AM, Patrick Steinhardt wrote:
Show 19 quoted lines
>On Fri, May 30, 2025 at 08:04:47AM -0400, rsbecker@nexbridge.com wrote:
>> On May 28, 2025 2:59 PM, I wrote:
>> >To: git@vger.kernel.org
>> >I encountered the following failure of rc0:
>> >
>> >static void file_release_data(void *b REFTABLE_UNUSED, struct
>> >reftable_block_data *dest REFTABLE_UNUSED)
>> >                                        ^
>>
>"/home/jenkinsbuild/.jenkins/workspace/Git_Pipeline/reftable/blocksource.c"
>> ,
>> >line 105: error(112):  expected a ")"
>> >
>> >
>> >I am not at all sure why this is failing at this point. Compiler is c99.
>>
>> Looking for help on resolving this before rc1.
>
>Did you maybe miss the proposed patch at [1]? That should fix your issue.

Thanks Patrick. As a packager, I can only build using merged fixes for 2.25.0-rc*. I'm hoping this makes rc1

← back to recent threads