Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <>
Cc: 'Calvin Wan' <>,
	'Git Mailing List' <>
Subject: Re: [RFD] Libification proposal: separate internal and external interfaces
Date: Mon, 8 Apr 2024 01:09:50 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <037001da8935$4a6e3720$df4aa560$>

[-- Attachment #1: Type: text/plain, Size: 5450 bytes --]

On 2024-04-07 at 21:48:07, wrote:
> On Sunday, April 7, 2024 5:34 PM, brian m. carlson wrote:
> >We'll also need to consider that libgit2 is currently using `git_` and thus we'll either
> >need to use something different or avoid conflicts.
> >Perhaps `gitlib_` might be useful.
> Or `GITL_`

It's more common to use lowercase, so I think we should do that.

> >I should point out that _FILE_OFFSET_BITS=64 is effectively standard these days.
> >Nobody wants their files limited to 2 GiB.
> This is not the default on some platforms. It is still required but can be put into a knob.

True, but everyone compiles with it.  If you're a software vendor and
your build only supports 2 GiB files, everyone's going to be mad.  We
should be able to assume that vendors are prudent and reasonable people
who will compile their binaries accordingly and not have to return an
error if a requested file size is larger than 32 bits.

> >Sure.  If we need a file size type, it should be something like `int64_t` or `uint64_t`
> >and not `off_t`. Not all platforms have explicit 64-bit APIs compiles. NonStop and S/390 do require explicit controls to make this work.
> This will result in compile warnings with some platforms with APIs
> that do use off_t for arguments and results.

There will need to be a cast.  Our APIs should use a standard 64-bit
type and not expose the platform `off_t`.

> >
> >> - Limited Platform Compatibility. The external interfaces are able to
> >>   assume that <stdint.h> and other C99 (or maybe even C11+)
> >>   functionality exists and use it immediately, without weather balloons
> >>   or #ifdefs. If some platform requires special handling, that platform
> >>   isn't supported, at least initially.
> >
> >I think this is fine.  It's 2024.  We should assume that C11 (a 13-year-old spec) is
> >available and so is POSIX 1003.1-2008 (except for Windows).  We may want to
> >have a nice `#ifdef __STDC__ < 200112L` (and a similar check for POSIX) to just
> >produce an `#error` if the system is too old.
> I wish this were the case. I have 2 years before C11 is guaranteed to
> be available on platforms that I maintain. Can we wait until mid-late
> 2025 before doing this? I do not want to lose access to git.

As mentioned in the original proposal, we don't have to support all
platforms in the libified code.  The main Git binaries will continue to
function and be supported, but the new libified code will rely on newer
features.  You will still be able to have all the Git binaries and
functionality, but if you want the new shared library to compile
against, you'll have to furnish a newer compiler.

As a side note, I don't think requiring porters to support a 13-year-old
spec is unreasonable for new, independent parts of the codebase.  As a
side note, if your platform supported GCC or LLVM, then this would be an
easy goal to achieve.  I know it doesn't right now, but it might be an
incentive to get it there.

> This is not a particularly good assumption. Some architectures do not
> support kernel-level threading. PUT threading is possible on some
> platforms but attempts to port git to PUT require that all
> dependencies also support PUT, which is not a good assumption. Most of
> the dependencies that I have to work with actually do not support PUT
> or any other form of threading.

I don't believe this is true.  Every architecture which supports Linux
or any other modern Unix has threading support.  You're compiling on
ia64 and x86, which definitely do support threading and have had it on
Linux and NetBSD for years (before they removed ia64 support).

Threading is a reasonable thing to have on a modern operating system,
and if we're adding new, independent functionality, that should be able
to safely work with threading.  You can continue to use the binaries
without threading, just not the new shared libraries.

I'll add on that I'm not opposed to continuing to support NonStop in
principle, but I _am_ opposed to having to continue to support really
ancient versions of common standards[0].  POSIX 1003.1-2008 is about 16
years old; it could drive a car in much of North America.  I think it's
the responsibility of porters to provide this functionality, and in
general most open source OSes do this with little or no paid staff, so
it should be reasonable to expect corporate-backed operating systems to
do so.

I would strongly recommend that NonStop start supporting modern compiler
and POSIX standards, as well at least one of GCC or LLVM, and that you
push very hard to make that happen.  It's not just Git that's pushing
forward here; there's a lot of open source software that simply will not
compile with the functionality you support, including the increasing
amount of software written in Go or Rust, and it's unreasonable to
expect people not to want to use standard functionality that's over a
decade old.  If NonStop doesn't move in that direction, I anticipate we
will eventually drop support for it sooner or later.

[0] This is not just NonStop; Microsoft's long-time refusal to implement
C99 or a newer version of C really ground my gears and I basically gave
up on supporting it for all personal projects as a result.  Fortunately,
they've now come up to a modern standard.
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2024-04-08  1:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 14:18 [RFD] Libification proposal: separate internal and external interfaces Calvin Wan
2024-04-07 21:33 ` brian m. carlson
2024-04-07 21:48   ` rsbecker
2024-04-08  1:09     ` brian m. carlson [this message]
2024-04-08 11:07       ` rsbecker
2024-04-08 21:29       ` Junio C Hamano
2024-04-09  0:35         ` brian m. carlson
2024-04-09 17:26           ` Calvin Wan
2024-04-09  9:40         ` Phillip Wood
2024-04-09 17:30           ` Calvin Wan
2024-04-22 16:26 ` Calvin Wan
2024-04-22 20:28   ` Junio C Hamano
2024-04-23  9:57   ` phillip.wood123
2024-05-09  1:00   ` Kyle Lippincott
2024-05-10  9:52     ` Phillip Wood
2024-05-10 21:35       ` Kyle Lippincott
2024-05-09 19:45   ` Kyle Lippincott
2024-05-09 20:14     ` Junio C Hamano

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:

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

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).