tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: C++20 and gcc12/10
On Sun, Apr 06, 2025 at 02:49:24PM +0100, Jonathan Perkin wrote:
> > Ahem. There's nothing OS-specific about "it works with gcc10".
>
> Well, you know what I mean. The only reason this is being proposed is to
> work around an OS-specific issue, i.e. NetBSD's latest release shipping
> gcc10 and an aversion to using a more modern pkgsrc GCC. If NetBSD 10 had
> shipped GCC 12 or newer then we probably wouldn't be having this
> discussion.
No, I don't. NetBSD is not exactly the only user of gcc10. The reason
it's come up is that forcing everyone using NetBSD-10 to build gcc12
(and recompile all their C++ packages with it, for which there's no
adequate user-facing update procedure) impacts a sizeable number of
people that otherwise probably wouldn't notice or care about C++
version constraints in detail.
Especially since so far all of the packages with this constraint that
I've come across so far have built fine with gcc10. So it's not only
expensive and administratively complicated, and affecting a lot of
people, it's _completely unnecessary_.
But there's still nothing OS-specific about it.
> My point is that the way this works should be:
>
> * Package simply declares "I need feature foo".
>
> * Infrastructure determines whether foo is available natively, and if
> not builds pkgsrc version to satisfy it.
This part I can't disagree with.
> * Any complicated logic to override this and have builtin satisfy foo
> for whatever reason belongs in mk/platform.
>
> and that putting mk/platform stuff in packages, like is effectively being
> proposed here, is the wrong approach.
This, however, is completely the wrong idea. This is a matter of
pkgsrc selecting the wrong compiler. The fact that it has expensive
consequences for a lot of people is why I'm posting about it, but
that's irrelevant to what the problem is or how it should be solved.
Unless you think all platform-independent problems with compiler or
builtin selection should be cutpasted into every platform :^)
> I mean like we already have for unique_ptr, regex, etc. Whatever the part
> of c++20 is that the package needs that is supported by the GCC in NetBSD
> 10.
Ok then, what is that? Maybe it's desirable in the abstract to sort
this out in detail and list every language feature (and require that
everyone updating any package that uses C++ be an expert well versed
in details of the C++ standard), but it's highly impractical in
practice.
I have no problem with encoding this choice into USE_CXX_FEATURES, but
it needs to be done pragmatically.
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index