FS#48966 - makepkg is broken when CONFIG_SITE is set
Attached to Project:
Pacman
Opened by William Pursell (william.pursell) - Friday, 15 April 2016, 19:07 GMT
Last edited by Allan McRae (Allan) - Monday, 18 April 2016, 04:33 GMT
Opened by William Pursell (william.pursell) - Friday, 15 April 2016, 19:07 GMT
Last edited by Allan McRae (Allan) - Monday, 18 April 2016, 04:33 GMT
|
Details
Description: In configure scripts generated by autoconf, the
user can override settings by using a CONFIG_SITE. This can
break many package builds.
For example: cat << EOF > $HOME/config.site prefix=/some/directory datadir=/p/a/t/h sbindir=/some/otherpath EOF CONFIG_SITE=$HOME/config.site makepkg Steps to reproduce: As above Simple solution: --- makepkg 2016-04-15 19:05:19.582252497 +0000 +++ makepkg-new 2016-04-15 19:05:05.395261092 +0000 @@ -36,6 +36,8 @@ # file -i does not work on Mac OSX unless legacy mode is set export COMMAND_MODE='legacy' +# Ensure CONFIG_SITE doesn't screw with any configure scripts +unset CONFIG_SITE # Ensure CDPATH doesn't screw with our cd calls unset CDPATH # Ensure GREP_OPTIONS doesn't screw with our grep calls |
This task depends upon
FS#36195, albeit with a narrowed scope.The variables we unset in makepkg are those which have a direct effect on makepkg, not the user-defined PKGBUILD functions it runs. There's too many variables which could affect the build for us to know what could be included in this list. Really, the solution is for you the user to clean the environment before running makepkg if you want reliable results.
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index f80e37a..37d0d4d 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -788,7 +788,7 @@ run_function() {
# clear user-specified buildflags if requested
if check_option "buildflags" "n"; then
- unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS
+ unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS CONFIG_SITE
fi
if check_option "debug" "y"; then