Re: [RFD] Libification proposal: separate internal and external interfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2024-04-07 at 21:48:07, rsbecker@xxxxxxxxxxxxx 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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux