tech-pkg archive

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

Re: A better method to require compiler features



On Fri, Jul 14, 2023 at 11:03:51AM +0200, Michael Buerle wrote:
> I think in general this change would be a good idea. But for a package
> maintainer it may be harder to declare what is required with the
> proposed new system.
> 
> It is unlikely that upstreams document the features used. Manually
> searching for all of them in the source code looks not very convenient,
> particularly if the list gets long in the future.
> 
> There should be some tool that checks for the features used in a
> source tree. Maybe as simple as searching for the header corresponding
> to a feature (e.g. "#include <filesystem>") and print the feature name
> that has to be added to USE_CXX_FEATURES.

Detecting precise language versions automatically seems like A Hard
Problem.  A package might use a newer dialect than what's possible to
detect by simple header file inclusion, for example. I don't want to
write a C++ parser in shell and bmake ;)

The status quo is that I currently go through CentOS 7 and NetBSD 8
bulk builds occasionally and adjust package Makefiles accordingly,
and I think that's fine. Casual readers can simply set USE_CXX_FEATURES
to whatever -std=cXX flags the package wants to use. So not much
changes.


Home | Main Index | Thread Index | Old Index