tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: PKGSRC_SETENV?= ${SETENV} -i
Date: Wed, 5 Jun 2013 16:19:57 +0000
From: Taylor R Campbell <campbell+netbsd-tech-pkg%mumble.net@localhost>
Date: Mon, 3 Jun 2013 23:40:52 +0000
From: Taylor R Campbell <campbell+netbsd-tech-pkg%mumble.net@localhost>
I committed a change to make PKGSRC_SETENV be `env -i' by default.
This should fix the build breakage of security/openssl in tool
dependencies that has been broken for far too long (sorry, folks --
entirely my fault), but it may break various other parts of the world,
so please let me know if I have broken anything -- or, more likely,
exposed latent bugs -- by doing this.
So, although I think this change is fundamentally the right idea...
Another idea, suggested by dholland: Split PKGSRC_SETENV into two
variables, one for recursive pkgsrc makes without `-i' by default and
the other for package phases (configure, build, &c.) with `-i' by
default. How does the attached patch look?
I called the new variable PHASE_SETENV since it is used for various
phases. If you have a better idea for a name I'm all for it. We
could split it further into CONFIGURE_SETENV, BUILD_SETENV, &c., but I
don't see an obvious reason to at the moment.
Index: mk/bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1992
diff -p -u -r1.1992 bsd.pkg.mk
--- mk/bsd.pkg.mk 5 Jun 2013 08:19:57 -0000 1.1992
+++ mk/bsd.pkg.mk 5 Jun 2013 18:57:53 -0000
@@ -153,11 +153,10 @@ ${_var_}+= ${${_var_}.*}
CPPFLAGS+= ${CPP_PRECOMP_FLAGS}
-# To sanitise environment set PKGSRC_SETENV=${SETENV} -i
-# This will however cause build failures (e.g. "www/firefox"). Settings
-# like "ALLOW_VULNERABLE_PACKAGES" will also not be correctly passed
-# to dependence builds.
+CLEAN_SETENV= ${SETENV} -i
+
PKGSRC_SETENV?= ${SETENV}
+PHASE_SETENV?= ${CLEAN_SETENV} -i
ALL_ENV+= CC=${CC:Q}
ALL_ENV+= CFLAGS=${CFLAGS:M*:Q}
Index: mk/build/build.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/build/build.mk,v
retrieving revision 1.21
diff -p -u -r1.21 build.mk
--- mk/build/build.mk 27 May 2012 14:32:29 -0000 1.21
+++ mk/build/build.mk 5 Jun 2013 18:57:53 -0000
@@ -46,7 +46,7 @@ BUILD_MAKE_FLAGS?= # none
BUILD_TARGET?= all
BUILD_MAKE_CMD= \
- ${PKGSRC_SETENV} ${MAKE_ENV} \
+ ${PHASE_SETENV} ${MAKE_ENV} \
${MAKE_PROGRAM} ${_MAKE_JOBS} \
${MAKE_FLAGS} ${BUILD_MAKE_FLAGS} \
-f ${MAKE_FILE}
@@ -183,7 +183,7 @@ BUILD_ENV_SHELL?= ${SH}
build-env: .PHONY configure
@${STEP_MSG} "Entering the build environment for ${PKGNAME}"
${RUN}${_ULIMIT_CMD} \
- cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${BUILD_ENV_SHELL}
+ cd ${WRKSRC} && ${PHASE_SETENV} ${MAKE_ENV} ${BUILD_ENV_SHELL}
.else
build-env: barrier
.endif
Index: mk/configure/configure.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/configure/configure.mk,v
retrieving revision 1.25
diff -p -u -r1.25 configure.mk
--- mk/configure/configure.mk 1 Jun 2012 12:52:37 -0000 1.25
+++ mk/configure/configure.mk 5 Jun 2013 18:57:53 -0000
@@ -205,7 +205,7 @@ do-configure-script:
.for _dir_ in ${CONFIGURE_DIRS}
${RUN}${_ULIMIT_CMD} \
cd ${WRKSRC} && cd ${_dir_} && \
- ${PKGSRC_SETENV} ${_CONFIGURE_SCRIPT_ENV} \
+ ${PHASE_SETENV} ${_CONFIGURE_SCRIPT_ENV} \
${CONFIG_SHELL} ${CONFIG_SHELL_FLAGS} \
${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
.endfor
@@ -224,7 +224,7 @@ do-configure-imake:
.for _dir_ in ${CONFIGURE_DIRS}
${RUN} \
cd ${WRKSRC} && cd ${_dir_} && \
- ${PKGSRC_SETENV} ${_CONFIGURE_IMAKE_ENV} ${XMKMF}
+ ${PHASE_SETENV} ${_CONFIGURE_IMAKE_ENV} ${XMKMF}
.endfor
######################################################################
@@ -242,7 +242,7 @@ do-configure-cmake:
.for _dir_ in ${CONFIGURE_DIRS}
${RUN}${_ULIMIT_CMD} \
cd ${WRKSRC} && cd ${_dir_} && \
- ${PKGSRC_SETENV} ${_CONFIGURE_CMAKE_ENV} \
+ ${PHASE_SETENV} ${_CONFIGURE_CMAKE_ENV} \
cmake ${CMAKE_ARGS} ${CMAKE_ARG_PATH}
.endfor
@@ -280,5 +280,5 @@ post-configure:
#
configure-help:
.for d in ${CONFIGURE_DIRS}
- ${RUN} cd ${WRKSRC} && cd ${d} && ${PKGSRC_SETENV}
${_CONFIGURE_SCRIPT_ENV} ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} --help
+ ${RUN} cd ${WRKSRC} && cd ${d} && ${PHASE_SETENV}
${_CONFIGURE_SCRIPT_ENV} ${CONFIG_SHELL} ${CONFIGURE_SCRIPT} --help
.endfor
Index: mk/install/install.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/install/install.mk,v
retrieving revision 1.66
diff -p -u -r1.66 install.mk
--- mk/install/install.mk 5 Jan 2013 07:32:49 -0000 1.66
+++ mk/install/install.mk 5 Jun 2013 18:57:53 -0000
@@ -325,7 +325,7 @@ do-install:
. for _dir_ in ${INSTALL_DIRS}
${RUN} ${_ULIMIT_CMD} \
cd ${WRKSRC} && cd ${_dir_} && \
- ${PKGSRC_SETENV} ${INSTALL_ENV} ${MAKE_ENV} \
+ ${PHASE_SETENV} ${INSTALL_ENV} ${MAKE_ENV} \
${MAKE_PROGRAM} ${MAKE_FLAGS} ${INSTALL_MAKE_FLAGS} \
-f ${MAKE_FILE} ${INSTALL_TARGET}
. endfor
Home |
Main Index |
Thread Index |
Old Index