On Mon, 7 Apr 2025, Jonathan Perkin wrote:
* On 2025-04-06 at 23:40 BST, Makoto Fujiwara wrote:| What I do is to use the same gcc version for all packages. So if one of | them requires gcc12, I set GCC_REQD+= 12 in /etc/mk.conf. It will be a | while before you need to increase that number but when that happens you | probably have to rebuild them all. This is what I'm thinking. Various packages ask for different gcc versions.It will result that serveral versions of gcc will be packaged. But if the onlyone version is packaged for that run, it may be straight out some mixed (libstdc++) versions. Can this be automated ? (hopefully at least pbulk scan) -> I may be wrong, Let me rewrite: At particular package, serveral version of gcc may be packaged, because of depending packages ask for different level, but if the only one at most required is included .... (?)It's not possible to automate, because you will run into circular dependencies.
Something like this will stop the circular dependency: .if \\ \${OPSYS} == "NetBSD" && \${OPSYS_VERSION} < 100000 && \\ empty(PKGPATH:Mdevel/gmake) && \\ empty(PKGPATH:Mlang/gcc10) && \\ empty(PKGPATH:Mlang/gcc10-libs) && \\ empty(PKGPATH:Mlang/perl5) && \\ empty(PKGPATH:Mpkgtools/cwrappers) && \\ empty(PKGPATH:Mpkgtools/digest) && \\ empty(PKGPATH:Mpkgtools/mktools) && \\ empty(PKGPATH:Mtextproc/gsed) GCC_REQD+=10 .endif
But yes, I also wholeheartedly recommend the approach of using a single modern compiler and runtime libraries for all packages.
for the record, I used the above to rebuild all packages with GCC 10 on NetBSD 9 and I got coredumps with certain combinations of PHP modules. I ended up reverting back to the base compiler.
-- Stephen