public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks•im>
To: "Alejandro R. Sedeño" <asedeno@mit•edu>
Cc: Git List <git@vger•kernel.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx•de>
Subject: Re: git no longer builds on SunOS 5.10, a report
Date: Sat, 12 Oct 2024 10:19:55 +0200	[thread overview]
Message-ID: <ZwoxHYD-e4qo7OyW@pks.im> (raw)
In-Reply-To: <CAOO-Oz3KsyeSjxbRpU-SdPgU5K+mPDcntT6Y4s46Mg_0ko9e_w@mail.gmail.com>

On Fri, Oct 11, 2024 at 10:10:26PM -0400, Alejandro R. Sedeño wrote:
> First, clar.suite was generated as broken because clar-decls.h was
> generated as empty. Tweaking the sed one-liner in Makefile that is
> used to generate clar-decls.h fixed that (move the end-of-line marker
> outside of the capture group, `$$\)` -> `\)$$`), which I would submit
> as a patch, but (a) that only fixed part of the problem and (b) I'm
> not entirely sure why it helped. If someone else wants to apply this
> change, which would align the end-of-line marker placement with the
> start-of-line marker placement, have at it.

I'd still appreciate it if you could show me the diff. From thereon I
can handle the rest.

> The next issue was that clar/sandbox.h uses mkdtemp, which I don't
> have here. Git has solved this in compat/mkdtemp.c via
> git-compat-util.h, but clar is not using it. Adding git-compat-util.h
> to clar/sandbox.h feels weird, but does get us further along. That
> change introduced banned.h into clar, which exposed the use of strncpy
> and localtime, both otherwise banned in git.

Yeah, we don't want to pull in that header. The clar is from upstream,
so ideally we shouldn't have to modify it with non-upstreamable bits.

In any case, I've got a similar report yesterday where some functions
weren't available. The root cause is that we don't set `_POSIX_C_SOURCE`
in "clar.c", so with the below patch things started to work. Does that
patch work for you, too? At least I think it should, as [1] mentions
that the function is available on SunOS when those defines exist.

In any case, the patch has already been merged upstream [2], and I'll
send a patch early next week that updates our bundled version of clar.

[1]: https://www.unix.com/man-page/sunos/3/MKDTEMP/
[2]: https://github.com/clar-test/clar/pull/106

[snip]
> Please note that this should not be read as opposition to the new
> unit-testing framework in any way. Building git (and curl, and gmake,
> and zlib, and openssl, and perl, all for git) for SunOS was a hobby
> for me, and not anything I personally need, and besides, it's not like
> my previous builds have disappeared.

Sure. But if the fix is easy enough I don't see a reason why we
shouldn't try to support your platform. It would be great to get earlier
feedback such that we can fix issues like this before we create the
release (see also our Documentation/technical/platform-support.txt,
which we have released recently.). But I'll take what I can get, so
thanks a lot for sending the report in the first place!

Patrick

diff --git a/t/unit-tests/clar/clar.c b/t/unit-tests/clar/clar.c
index cef0f023c24..76557df3040 100644
--- a/t/unit-tests/clar/clar.c
+++ b/t/unit-tests/clar/clar.c
@@ -4,6 +4,10 @@
  * This file is part of clar, distributed under the ISC license.
  * For full terms see the included COPYING file.
  */
+
+#define _DARWIN_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+
 #include <assert.h>
 #include <setjmp.h>
 #include <stdlib.h>
@@ -271,9 +275,7 @@ static double clar_time_diff(clar_time *start, clar_time *end)
 
 static void clar_time_now(clar_time *out)
 {
-	struct timezone tz;
-
-	gettimeofday(out, &tz);
+	gettimeofday(out, NULL);
 }
 
 static double clar_time_diff(clar_time *start, clar_time *end)

  reply	other threads:[~2024-10-12  8:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-12  2:10 git no longer builds on SunOS 5.10, a report Alejandro R. Sedeño
2024-10-12  8:19 ` Patrick Steinhardt [this message]
2024-10-12 14:34   ` Alejandro R. Sedeño
2024-10-12 14:40     ` [PATCH] Makefile: adjust sed command for generating "clar-decls.h" Alejandro R. Sedeño
2024-10-12 14:42     ` git no longer builds on SunOS 5.10, a report Alejandro R. Sedeño
2024-10-13 19:57     ` Patrick Steinhardt
2024-10-13 22:50       ` Alejandro R. Sedeño
2024-10-14  6:20         ` Patrick Steinhardt
2024-10-14 11:45 ` [PATCH 0/2] t/unit-tests: improve clar platform compatibility Patrick Steinhardt
2024-10-14 11:45   ` [PATCH 1/2] t/unit-tests: update clar to 0810a36 Patrick Steinhardt
2024-10-14 11:45   ` [PATCH 2/2] Makefile: adjust sed command for generating "clar-decls.h" Patrick Steinhardt
2024-10-18 15:45     ` Toon Claes
2024-10-18 21:14       ` Taylor Blau
2024-10-21  7:00         ` Patrick Steinhardt
2024-10-21 10:56 ` [PATCH v2 0/5] t/unit-tests: improve clar platform compatibility Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 1/5] t/unit-tests: update clar to 206accb Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 2/5] Makefile: adjust sed command for generating "clar-decls.h" Patrick Steinhardt
2024-10-21 11:07     ` Kristoffer Haugsbakk
2024-10-21 11:35       ` Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 3/5] Makefile: extract script to generate clar declarations Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 4/5] cmake: fix compilation of clar-based unit tests Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 5/5] cmake: set up proper dependencies for generated clar headers Patrick Steinhardt
2024-11-05 19:55     ` Johannes Schindelin
2024-11-06 10:59       ` Phillip Wood
2024-11-08 12:59         ` Patrick Steinhardt
2024-10-21 20:52   ` [PATCH v2 0/5] t/unit-tests: improve clar platform compatibility Taylor Blau
2024-10-25 12:17   ` karthik nayak
2024-10-26  5:01   ` Bagas Sanjaya
2024-10-27 13:01     ` Patrick Steinhardt
2024-10-27 23:56       ` Taylor Blau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZwoxHYD-e4qo7OyW@pks.im \
    --to=ps@pks$(echo .)im \
    --cc=Johannes.Schindelin@gmx$(echo .)de \
    --cc=asedeno@mit$(echo .)edu \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox