Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

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
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

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

Closed by  Allan McRae (Allan)
Monday, 18 April 2016, 04:33 GMT
Reason for closing:  Won't implement
Comment by Dave Reisner (falconindy) - Friday, 15 April 2016, 22:13 GMT
This is essentially a dupe of  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.
Comment by Allan McRae (Allan) - Monday, 18 April 2016, 04:33 GMT
Agreed - I am not unsetting environmental variables unless they are shown to break a command within makepkg (e.g. the CDPATH, GREP_OPTIONS unsets already in makepkg).
Comment by William Pursell (william.pursell) - Tuesday, 31 May 2016, 20:29 GMT
I think CONFIG_SITE is appropriate to treat as a build flag. Recommending:
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

Loading...