From: Stuart Henderson Subject: Re: python: set CXX to prevent sccache detection in meson via To: Klemens Nanni , ports , Kurt Mosiejczuk Date: Sat, 05 Sep 2026 19:47:20 +0100 ok. -- Sent from a phone, apologies for poor formatting. On 5 September 2026 16:52:09 Klemens Nanni wrote: > 05.09.2026 12:19, Stuart Henderson пишет: >> On 2026/09/04 20:00, Klemens Nanni wrote: >>> 04.09.2026 22:32, Stuart Henderson пишет: >>>> I think it would be better to set it all the time, like MODSIMPLE_configure >>>> does in bsd.port.mk. >>> >>> Like so? >> >> I meant in python.port.mk, I'd be pretty happy to do that without wider >> testing in advance. Changing it in bsd.port.mk I'm a lot more twitchy >> about.. > > Sure, let's do the bare minium then wrt. compiler/tool detection: > > Index: python.port.mk > =================================================================== > RCS file: /cvs/ports/lang/python/3/python.port.mk,v > diff -u -p -r1.28 python.port.mk > --- python.port.mk 19 Jun 2026 13:49:04 -0000 1.28 > +++ python.port.mk 5 Sep 2026 15:46:12 -0000 > @@ -223,7 +223,7 @@ MODPY_DISTUTILS_BUILD ?= build --build-b > MODPY_DISTUTILS_INSTALL ?= install --prefix=${TRUEPREFIX} \ > --root=${DESTDIR} > > -MAKE_ENV += CC=${CC} > +MAKE_ENV += CC=${CC} CXX=${CXX} > CONFIGURE_ENV += PYTHON="${MODPY_BIN}" > .if ${CONFIGURE_STYLE:Mgnu} > CONFIGURE_ENV += ac_cv_prog_PYTHON="${MODPY_BIN}" \ > > > OK? > > For CXXFLAGS it'd take a closer look when time allows. > >> >> >>> I also just noticed -O3 in matplotlib build logs and passing CXXFLAGS >>> make meson append them, so default -O2 is used again and DEBUG gets honoured. >>> >>> bsd.port.mk already adds CFLAGS to MAKE_ENV outside MODSIMPLE_configure, >>> but not CXXFLAGS. >>> >>> How about adding all just there, dropping C* things in python.port.mk? >>> >>> 'make -V MAKE_ENV' in matplotlib shows them all without duplicates from >>> other places. >>> >>> >>> Index: lang/python/3/python.port.mk >>> =================================================================== >>> RCS file: /cvs/ports/lang/python/3/python.port.mk,v >>> diff -u -p -r1.28 python.port.mk >>> --- lang/python/3/python.port.mk 19 Jun 2026 13:49:04 -0000 1.28 >>> +++ lang/python/3/python.port.mk 4 Sep 2026 19:54:50 -0000 >>> @@ -223,7 +223,6 @@ MODPY_DISTUTILS_BUILD ?= build --build-b >>> MODPY_DISTUTILS_INSTALL ?= install --prefix=${TRUEPREFIX} \ >>> --root=${DESTDIR} >>> >>> -MAKE_ENV += CC=${CC} >>> CONFIGURE_ENV += PYTHON="${MODPY_BIN}" >>> .if ${CONFIGURE_STYLE:Mgnu} >>> CONFIGURE_ENV += ac_cv_prog_PYTHON="${MODPY_BIN}" \ >>> Index: infrastructure/mk/bsd.port.mk >>> =================================================================== >>> RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v >>> diff -u -p -r1.1651 bsd.port.mk >>> --- infrastructure/mk/bsd.port.mk 18 May 2026 23:38:23 -0000 1.1651 >>> +++ infrastructure/mk/bsd.port.mk 4 Sep 2026 19:58:38 -0000 >>> @@ -754,7 +759,8 @@ PORTHOME ?= /${PKGNAME}_writes_to_HOME >>> >>> MAKE_ENV += PATH='${PORTPATH}' PREFIX='${PREFIX}' \ >>> LOCALBASE='${LOCALBASE}' X11BASE='${X11BASE}' \ >>> - CFLAGS='${CFLAGS:C/ *$//}' \ >>> + CC=${CC} CFLAGS=${CFLAGS:Q} \ >>> + CXX=${CXX} CXXFLAGS=${CXXFLAGS:Q} \ >> >> have you looked into why it currently strips trailing spaces from >> CFLAGS? could it cause some subtle problem if it stops doing that? > > No, the original commit from 2004 just repeats the diff in words > without explaining anything. > > I'm inclined to use proper mechanisms like :Q and deal with fallout > when, that is if it should arise. > >> >>> TRUEPREFIX='${PREFIX}' ${DESTDIRNAME}='' \ >>> HOME='${PORTHOME}' >>> >>> >>