On 2012/05/05 17:57, Tobias Ulmer wrote:
> Setting DEBUG not only sets additional CFLAGS, it also disables
> stripping during the 'fake' stage for ports that use BSD make as build
> system.
>
> Curiously this does not work for ports that have a custom 'do-install'
> target (or friends) and use INSTALL_PROGRAM.
>
> After pulling my hair a bit, it became obvious that _SUDOMAKESYS
> filters out most environment variables, including DEBUG (usage begins
> in bsd.port.mk:2527, implementation is in pkgpath.mk:115).
>
> I can see two options to fix this: Either extend the default sudoers to
> pass DEBUG/INSTALL_STRIP(?). Or pass MAKE_ENV like the standard install
> target does. It seems to do the right thing in my light testing. I've
> also modified _SUDOMAKE for symmetry.
>
> devel/csup is a port that ignores DEBUG partially.
> x11/spectrwm as an example where it works.
>
> Comments?
> -_SUDOMAKESYS = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${SUDO}
> ${_SYSTRACE_CMD} ${MAKE}
> +_SUDOMAKESYS = cd ${.CURDIR} && exec ${SUDO} ${SETENV} ${MAKE_ENV}
> PKGPATH=${PKGPATH} ${_SYSTRACE_CMD} ${MAKE}
This passes HOME from MAKE_ENV to systrace which it can't cope with.
I noticed this failing with php but I'm sure it will affect (all?) other
ports if you use systrace.
Going to do some more extensive testing with sudo=SUDO and removing the
env_keep list from sudoers (that will be without systrace, for now).
Index: pkgpath.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/pkgpath.mk,v
retrieving revision 1.45
diff -u -p -r1.45 pkgpath.mk
--- pkgpath.mk 7 May 2012 21:11:44 -0000 1.45
+++ pkgpath.mk 8 May 2012 20:26:13 -0000
@@ -112,9 +112,9 @@ _cache_fragment = \
HTMLIFY = sed -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g'
_MAKE = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${MAKE}
-_SUDOMAKE = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${SUDO} ${MAKE}
+_SUDOMAKE = cd ${.CURDIR} && exec ${SUDO} ${SETENV} ${MAKE_ENV}
PKGPATH=${PKGPATH} ${MAKE}
_MAKESYS = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${_SYSTRACE_CMD} ${MAKE}
-_SUDOMAKESYS = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${SUDO}
${_SYSTRACE_CMD} ${MAKE}
+_SUDOMAKESYS = cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} ${SETENV}
${MAKE_ENV} PKGPATH=${PKGPATH} ${MAKE}
REPORT_PROBLEM_LOGFILE ?=
.if !empty(REPORT_PROBLEM_LOGFILE)