public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix GNU/Hurd build
@ 2026-03-12 19:19 Samuel Thibault
  2026-03-12 20:38 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Thibault @ 2026-03-12 19:19 UTC (permalink / raw)
  To: git; +Cc: Samuel Thibault

GNU/Hurd does not have a PATH_MAX limitation

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 t/unit-tests/clar/clar.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/unit-tests/clar/clar.h b/t/unit-tests/clar/clar.h
index f7e4363022..55b0361d91 100644
--- a/t/unit-tests/clar/clar.h
+++ b/t/unit-tests/clar/clar.h
@@ -11,7 +11,7 @@
 #include <stdlib.h>
 #include <limits.h>
 
-#if defined(_WIN32) && defined(CLAR_WIN32_LONGPATHS)
+#if defined(__GNU__) || defined(_WIN32) && defined(CLAR_WIN32_LONGPATHS)
 # define CLAR_MAX_PATH 4096
 #elif defined(_WIN32)
 # define CLAR_MAX_PATH MAX_PATH
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix GNU/Hurd build
  2026-03-12 19:19 [PATCH] Fix GNU/Hurd build Samuel Thibault
@ 2026-03-12 20:38 ` Junio C Hamano
  2026-03-13  6:39   ` Patrick Steinhardt
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2026-03-12 20:38 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: git, Samuel Thibault

Samuel Thibault <samuel.thibault@ens-lyon.org> writes:

> GNU/Hurd does not have a PATH_MAX limitation

Thanks.  clar folks might prefer to take it upstream and have us as
a downstream to import from them, so I'll forward it first before
taking it for ourselves.

It makes me wonder if an organization like this is easier to follow,
i.e., platform specific settings first and then catch-all default at
the end:

	#if defined(CLAR_LONGPATHS)
	#define CLAR_MAX_PATH 4096
	#elif defined(PATH_MAX)
	#define CLAR_MAX_PATH PATH_MAX
	#elif deifned(MAX_PATH)
	#define CLAR_MAX_PATH MAX_PATH
	#fi

	#if !defined(CLAR_MAX_PATH)
	#define CLAR_MAX_PATH 4096
	#fi

but that is a separate issue best handled by the clar folks.


--- >8 ---
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Thu, 12 Mar 2026 20:19:01 +0100
Subject: [PATCH] clar: compilation fix for GNU/Hurd

<clar.h> fails to define CLAR_MAX_PATH on GNU/Hurd where PATH_MAX is
not defined.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/unit-tests/clar/clar.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/unit-tests/clar/clar.h b/t/unit-tests/clar/clar.h
index ca72292ae9..4394aabbb9 100644
--- a/t/unit-tests/clar/clar.h
+++ b/t/unit-tests/clar/clar.h
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 #include <limits.h>
 
-#if defined(_WIN32) && defined(CLAR_WIN32_LONGPATHS)
+#if defined(__GNU__) || defined(_WIN32) && defined(CLAR_WIN32_LONGPATHS)
 # define CLAR_MAX_PATH 4096
 #elif defined(_WIN32)
 # define CLAR_MAX_PATH MAX_PATH
-- 
2.53.0-707-gf7b889d8f7




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix GNU/Hurd build
  2026-03-12 20:38 ` Junio C Hamano
@ 2026-03-13  6:39   ` Patrick Steinhardt
  2026-03-13 17:24     ` Samuel Thibault
  0 siblings, 1 reply; 6+ messages in thread
From: Patrick Steinhardt @ 2026-03-13  6:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Samuel Thibault

On Thu, Mar 12, 2026 at 01:38:21PM -0700, Junio C Hamano wrote:
> Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
> 
> > GNU/Hurd does not have a PATH_MAX limitation
> 
> Thanks.  clar folks might prefer to take it upstream and have us as
> a downstream to import from them, so I'll forward it first before
> taking it for ourselves.
> 
> It makes me wonder if an organization like this is easier to follow,
> i.e., platform specific settings first and then catch-all default at
> the end:
> 
> 	#if defined(CLAR_LONGPATHS)
> 	#define CLAR_MAX_PATH 4096
> 	#elif defined(PATH_MAX)
> 	#define CLAR_MAX_PATH PATH_MAX
> 	#elif deifned(MAX_PATH)
> 	#define CLAR_MAX_PATH MAX_PATH
> 	#fi
> 
> 	#if !defined(CLAR_MAX_PATH)
> 	#define CLAR_MAX_PATH 4096
> 	#fi
> 
> but that is a separate issue best handled by the clar folks.

Agreed, something like this would read better indeed. Samuel, do you
want to maybe create a pull request in [1] to fix this in clar itself?
You can then give me (@pks-gitlab) a ping and I'll be happy to review
it. I can then handle the subsequent pull request for Git.

Thanks!

Patrick

[1]: https://github.com/clar-test/clar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix GNU/Hurd build
  2026-03-13  6:39   ` Patrick Steinhardt
@ 2026-03-13 17:24     ` Samuel Thibault
  2026-03-13 19:08       ` Junio C Hamano
  2026-03-16  6:41       ` Patrick Steinhardt
  0 siblings, 2 replies; 6+ messages in thread
From: Samuel Thibault @ 2026-03-13 17:24 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: Junio C Hamano, git

Patrick Steinhardt, le ven. 13 mars 2026 07:39:40 +0100, a ecrit:
> On Thu, Mar 12, 2026 at 01:38:21PM -0700, Junio C Hamano wrote:
> > Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
> > 
> > > GNU/Hurd does not have a PATH_MAX limitation
> > 
> > Thanks.  clar folks might prefer to take it upstream and have us as
> > a downstream to import from them, so I'll forward it first before
> > taking it for ourselves.
> > 
> > It makes me wonder if an organization like this is easier to follow,
> > i.e., platform specific settings first and then catch-all default at
> > the end:
> > 
> > 	#if defined(CLAR_LONGPATHS)
> > 	#define CLAR_MAX_PATH 4096
> > 	#elif defined(PATH_MAX)
> > 	#define CLAR_MAX_PATH PATH_MAX
> > 	#elif deifned(MAX_PATH)
> > 	#define CLAR_MAX_PATH MAX_PATH
> > 	#fi
> > 
> > 	#if !defined(CLAR_MAX_PATH)
> > 	#define CLAR_MAX_PATH 4096
> > 	#fi
> > 
> > but that is a separate issue best handled by the clar folks.
> 
> Agreed, something like this would read better indeed.

Ah, actually Pino already contributed a fix in december:)

> Samuel, do you
> want to maybe create a pull request in [1] to fix this in clar itself?

> [1]: https://github.com/clar-test/clar

It would be useful to put this github url in the README, I have
submitted
https://github.com/clar-test/clar/pull/135
so it'll eventually end up in the git source for people to find out
where to send clar patches.

Samuel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix GNU/Hurd build
  2026-03-13 17:24     ` Samuel Thibault
@ 2026-03-13 19:08       ` Junio C Hamano
  2026-03-16  6:41       ` Patrick Steinhardt
  1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2026-03-13 19:08 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: Patrick Steinhardt, git

Samuel Thibault <samuel.thibault@ens-lyon.org> writes:

>> Agreed, something like this would read better indeed.
>
> Ah, actually Pino already contributed a fix in december:)

Good to know.

> It would be useful to put this github url in the README, I have
> submitted
> https://github.com/clar-test/clar/pull/135
> so it'll eventually end up in the git source for people to find out
> where to send clar patches.

Wonderful.  Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix GNU/Hurd build
  2026-03-13 17:24     ` Samuel Thibault
  2026-03-13 19:08       ` Junio C Hamano
@ 2026-03-16  6:41       ` Patrick Steinhardt
  1 sibling, 0 replies; 6+ messages in thread
From: Patrick Steinhardt @ 2026-03-16  6:41 UTC (permalink / raw)
  To: Samuel Thibault, Junio C Hamano, git

On Fri, Mar 13, 2026 at 06:24:44PM +0100, Samuel Thibault wrote:
> Patrick Steinhardt, le ven. 13 mars 2026 07:39:40 +0100, a ecrit:
> > On Thu, Mar 12, 2026 at 01:38:21PM -0700, Junio C Hamano wrote:
> > > Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
> > > 
> > > > GNU/Hurd does not have a PATH_MAX limitation
> > > 
> > > Thanks.  clar folks might prefer to take it upstream and have us as
> > > a downstream to import from them, so I'll forward it first before
> > > taking it for ourselves.
> > > 
> > > It makes me wonder if an organization like this is easier to follow,
> > > i.e., platform specific settings first and then catch-all default at
> > > the end:
> > > 
> > > 	#if defined(CLAR_LONGPATHS)
> > > 	#define CLAR_MAX_PATH 4096
> > > 	#elif defined(PATH_MAX)
> > > 	#define CLAR_MAX_PATH PATH_MAX
> > > 	#elif deifned(MAX_PATH)
> > > 	#define CLAR_MAX_PATH MAX_PATH
> > > 	#fi
> > > 
> > > 	#if !defined(CLAR_MAX_PATH)
> > > 	#define CLAR_MAX_PATH 4096
> > > 	#fi
> > > 
> > > but that is a separate issue best handled by the clar folks.
> > 
> > Agreed, something like this would read better indeed.
> 
> Ah, actually Pino already contributed a fix in december:)

Oh, you're right! I'll send an update to the latest clar version later
today.

> > Samuel, do you
> > want to maybe create a pull request in [1] to fix this in clar itself?
> 
> > [1]: https://github.com/clar-test/clar
> 
> It would be useful to put this github url in the README, I have
> submitted
> https://github.com/clar-test/clar/pull/135
> so it'll eventually end up in the git source for people to find out
> where to send clar patches.

Makes sense, thanks.

Patrick

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-16  6:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12 19:19 [PATCH] Fix GNU/Hurd build Samuel Thibault
2026-03-12 20:38 ` Junio C Hamano
2026-03-13  6:39   ` Patrick Steinhardt
2026-03-13 17:24     ` Samuel Thibault
2026-03-13 19:08       ` Junio C Hamano
2026-03-16  6:41       ` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox