[pacman-dev] makepkg misses to export variables
i wonder why you have removed all the "export" commands in front of the variables in /etc/makepkg.conf put an "export" or "env" on top of the build section and compare: FTPAGENT CARCH CHOST DISTCC_HOSTS PKGDEST PACKAGER all these are not set! and i have wondered why my builds take so long as i would have restrictive -j1 set. i hope not too much packages were built without the right CARCH/CHOST. some try to selfdetect it and would set it probably wrong! please fix it quickly. Andy
On 5/15/07, Andreas Radke <a.radke@arcor.de> wrote:
i wonder why you have removed all the "export" commands in front of the variables in /etc/makepkg.conf
put an "export" or "env" on top of the build section and compare:
FTPAGENT CARCH CHOST DISTCC_HOSTS PKGDEST PACKAGER
all these are not set! and i have wondered why my builds take so long as i would have restrictive -j1 set.
i hope not too much packages were built without the right CARCH/CHOST. some try to selfdetect it and would set it probably wrong!
please fix it quickly.
Patches welcome, although I'm not completely sure that all of these need to be exported. (look around line 888 of makepkg). CARCH and CHOST are truly necessary? However, someone wiith more building experience than I should comment on this. PACKAGER really seems unnecessary to export. PKGDEST? I don't think so. FTPAGENT? Same as the others in this paragraph. -Dan
On Wed, 16 May 2007 00:45:24 -0400 "Dan McGee" <dpmcgee@gmail.com> wrote:
Patches welcome, although I'm not completely sure that all of these need to be exported. (look around line 888 of makepkg). CARCH and CHOST are truly necessary? However, someone wiith more building experience than I should comment on this.
-Dan
CARCH and CHOST are necessary. Small example from the kernel PKGBUILD: if [ "$CARCH" = "x86_64" ]; then cat ../config.x86_64 >./.config else # get rid of the 'i' in i686 carch=`echo $CARCH | sed 's|i||'` cat ../config | sed "s|#CARCH#|$carch|g" >./.config fi without CARCH there is going this things wrong.... I will look if I can apply a patch, if I will find a little bit of freetime... Daniel
On 5/16/07, Daniel Isenmann <daniel.isenmann@gmx.de> wrote:
CARCH and CHOST are necessary. Small example from the kernel PKGBUILD:
without CARCH there is going this things wrong....
I think there's a misunderstanding here... Try this PKGBUILD pkgname=foo pkgver=1.0 pkgrel=1 pkgdesc="A dummy package" arch=('i686') build() { echo ">>>>" echo $FTPAGENT echo $CARCH echo $CHOST echo $DISTCC_HOSTS echo $PKGDEST echo $PACKAGER echo "<<<<" } My output:
/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3 --no-check-certificate i686 i686-pc-linux-gnu
/home/griff/build/local/foo <<<< Export is not needed for a variable to exist inside makepkg
On 5/16/07, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 5/16/07, Daniel Isenmann <daniel.isenmann@gmx.de> wrote:
CARCH and CHOST are necessary. Small example from the kernel PKGBUILD:
without CARCH there is going this things wrong....
I think there's a misunderstanding here...
Try this PKGBUILD
pkgname=foo pkgver=1.0 pkgrel=1 pkgdesc="A dummy package" arch=('i686')
build() { echo ">>>>" echo $FTPAGENT echo $CARCH echo $CHOST echo $DISTCC_HOSTS echo $PKGDEST echo $PACKAGER echo "<<<<" }
My output:
/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3 --no-check-certificate i686 i686-pc-linux-gnu
/home/griff/build/local/foo
<<<<
Export is not needed for a variable to exist inside makepkg
Export is ONLY needed if a new process is started with the callers environment. This occurs during calls to ./configure and make, but NOT within the PKGBUILD. -Dan
Am Wed, 16 May 2007 12:03:29 -0400 schrieb "Dan McGee" <dpmcgee@gmail.com>:
Export is ONLY needed if a new process is started with the callers environment. This occurs during calls to ./configure and make, but NOT within the PKGBUILD.
therefore we need to export the MAKEFLAGS and DISTCC_HOST. anything else should be safe without an export call. i could confirm that both variables are not working properly. -j4 falls back to -j1 and distcc is not working without. would you prefer to export them in the makepkg.conf or in /usr/bin/makepkg ? both would be easy to fix. Andy
On 5/16/07, Andreas Radke <a.radke@arcor.de> wrote:
Am Wed, 16 May 2007 12:03:29 -0400 schrieb "Dan McGee" <dpmcgee@gmail.com>:
Export is ONLY needed if a new process is started with the callers environment. This occurs during calls to ./configure and make, but NOT within the PKGBUILD.
therefore we need to export the MAKEFLAGS and DISTCC_HOST. anything else should be safe without an export call. i could confirm that both variables are not working properly. -j4 falls back to -j1 and distcc is not working without.
would you prefer to export them in the makepkg.conf or in /usr/bin/makepkg ?
Seriously? Anyway, here is a patch. We wouldn't export half the variables in one place and half elsewhere: Index: scripts/makepkg =================================================================== RCS file: /home/cvs-pacman/pacman-lib/scripts/makepkg,v retrieving revision 1.72 diff -u -r1.72 makepkg --- scripts/makepkg 28 Apr 2007 08:26:37 -0000 1.72 +++ scripts/makepkg 16 May 2007 17:10:36 -0000 @@ -862,9 +862,10 @@ # use distcc if it is requested (check buildenv and PKGBUILD opts) if [ "$(check_buildenv distcc)" = "y" -a "$(check_option distcc)" != "n" ]; then [ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH + export DISTCC_HOSTS elif [ "$(check_option distcc)" = "n" ]; then # if it is not wanted, clear the makeflags too - export MAKEFLAGS="" + MAKEFLAGS="" fi # use ccache if it is requested (check buildenv and PKGBUILD opts) @@ -874,7 +875,7 @@ # clear user-specified makeflags if requested if [ "$(check_option makeflags)" = "n" ]; then - export MAKEFLAGS="" + MAKEFLAGS="" fi # build @@ -884,9 +885,8 @@ unset LC_ALL LC_MESSAGES LANG umask 0022 - # ensure CFLAGS and CXXFLAGS are used - export CFLAGS - export CXXFLAGS + # ensure all necessary build variables are exported + export CFLAGS CXXFLAGS MAKEFLAGS #check for "exit on syntax error" shell option echo $SHELLOPTS | grep errexit 2>&1 >/dev/null
Wednesday 16 of May 2007 19:12:22 Dan McGee napisał(a):
On 5/16/07, Andreas Radke <a.radke@arcor.de> wrote:
Am Wed, 16 May 2007 12:03:29 -0400
schrieb "Dan McGee" <dpmcgee@gmail.com>:
Export is ONLY needed if a new process is started with the callers environment. This occurs during calls to ./configure and make, but NOT within the PKGBUILD.
therefore we need to export the MAKEFLAGS and DISTCC_HOST. anything else should be safe without an export call. i could confirm that both variables are not working properly. -j4 falls back to -j1 and distcc is not working without.
would you prefer to export them in the makepkg.conf or in /usr/bin/makepkg ?
Seriously? Anyway, here is a patch. We wouldn't export half the variables in one place and half elsewhere:
Index: scripts/makepkg =================================================================== RCS file: /home/cvs-pacman/pacman-lib/scripts/makepkg,v retrieving revision 1.72 diff -u -r1.72 makepkg --- scripts/makepkg 28 Apr 2007 08:26:37 -0000 1.72 +++ scripts/makepkg 16 May 2007 17:10:36 -0000 @@ -862,9 +862,10 @@ # use distcc if it is requested (check buildenv and PKGBUILD opts) if [ "$(check_buildenv distcc)" = "y" -a "$(check_option distcc)" != "n" ]; then [ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH + export DISTCC_HOSTS elif [ "$(check_option distcc)" = "n" ]; then # if it is not wanted, clear the makeflags too - export MAKEFLAGS="" + MAKEFLAGS="" fi
# use ccache if it is requested (check buildenv and PKGBUILD opts) @@ -874,7 +875,7 @@
# clear user-specified makeflags if requested if [ "$(check_option makeflags)" = "n" ]; then - export MAKEFLAGS="" + MAKEFLAGS="" fi
# build @@ -884,9 +885,8 @@ unset LC_ALL LC_MESSAGES LANG umask 0022
- # ensure CFLAGS and CXXFLAGS are used - export CFLAGS - export CXXFLAGS + # ensure all necessary build variables are exported + export CFLAGS CXXFLAGS MAKEFLAGS
#check for "exit on syntax error" shell option echo $SHELLOPTS | grep errexit 2>&1 >/dev/null
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
I concur with the threads severity, on my system I neither get my CFLAGS/CPPFLAGS nor MAKEFLAGS (-j3) exported. Using latest pacman (pacman 3.0.4-2) Regards, //m. -- Mateusz Jędrasik <m.jedrasik@gmail.com> tel. +48(79)022-9393, +48(51)69-444-90 http://imachine.szklo.eu.org
On 5/16/07, Mateusz Jedrasik <m.jedrasik@gmail.com> wrote:
Wednesday 16 of May 2007 19:12:22 Dan McGee napisał(a):
On 5/16/07, Andreas Radke <a.radke@arcor.de> wrote:
Am Wed, 16 May 2007 12:03:29 -0400
schrieb "Dan McGee" <dpmcgee@gmail.com>:
Export is ONLY needed if a new process is started with the callers environment. This occurs during calls to ./configure and make, but NOT within the PKGBUILD.
therefore we need to export the MAKEFLAGS and DISTCC_HOST. anything else should be safe without an export call. i could confirm that both variables are not working properly. -j4 falls back to -j1 and distcc is not working without.
would you prefer to export them in the makepkg.conf or in /usr/bin/makepkg ?
Seriously? Anyway, here is a patch. We wouldn't export half the variables in one place and half elsewhere:
Index: scripts/makepkg =================================================================== RCS file: /home/cvs-pacman/pacman-lib/scripts/makepkg,v retrieving revision 1.72 diff -u -r1.72 makepkg --- scripts/makepkg 28 Apr 2007 08:26:37 -0000 1.72 +++ scripts/makepkg 16 May 2007 17:10:36 -0000 @@ -862,9 +862,10 @@ # use distcc if it is requested (check buildenv and PKGBUILD opts) if [ "$(check_buildenv distcc)" = "y" -a "$(check_option distcc)" != "n" ]; then [ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH + export DISTCC_HOSTS elif [ "$(check_option distcc)" = "n" ]; then # if it is not wanted, clear the makeflags too - export MAKEFLAGS="" + MAKEFLAGS="" fi
# use ccache if it is requested (check buildenv and PKGBUILD opts) @@ -874,7 +875,7 @@
# clear user-specified makeflags if requested if [ "$(check_option makeflags)" = "n" ]; then - export MAKEFLAGS="" + MAKEFLAGS="" fi
# build @@ -884,9 +885,8 @@ unset LC_ALL LC_MESSAGES LANG umask 0022
- # ensure CFLAGS and CXXFLAGS are used - export CFLAGS - export CXXFLAGS + # ensure all necessary build variables are exported + export CFLAGS CXXFLAGS MAKEFLAGS
#check for "exit on syntax error" shell option echo $SHELLOPTS | grep errexit 2>&1 >/dev/null
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
I concur with the threads severity, on my system I neither get my CFLAGS/CPPFLAGS nor MAKEFLAGS (-j3) exported.
Ummmm, CFLAGS would be a different issue, as they were already exported by makepkg before we addresed the MAKEFLAGS not being exported. I can verify on my builds that CFLAGS are respected. In addition, CXXFLAGS is the variable used for C++ by makepkg. -Dan
Thursday 17 of May 2007 03:16:22 Dan McGee napisał(a):
On 5/16/07, Mateusz Jedrasik <m.jedrasik@gmail.com> wrote:
Wednesday 16 of May 2007 19:12:22 Dan McGee napisał(a):
On 5/16/07, Andreas Radke <a.radke@arcor.de> wrote:
Am Wed, 16 May 2007 12:03:29 -0400
schrieb "Dan McGee" <dpmcgee@gmail.com>:
Export is ONLY needed if a new process is started with the callers environment. This occurs during calls to ./configure and make, but NOT within the PKGBUILD.
therefore we need to export the MAKEFLAGS and DISTCC_HOST. anything else should be safe without an export call. i could confirm that both variables are not working properly. -j4 falls back to -j1 and distcc is not working without.
would you prefer to export them in the makepkg.conf or in /usr/bin/makepkg ?
Seriously? Anyway, here is a patch. We wouldn't export half the variables in one place and half elsewhere:
Index: scripts/makepkg =================================================================== RCS file: /home/cvs-pacman/pacman-lib/scripts/makepkg,v retrieving revision 1.72 diff -u -r1.72 makepkg --- scripts/makepkg 28 Apr 2007 08:26:37 -0000 1.72 +++ scripts/makepkg 16 May 2007 17:10:36 -0000 @@ -862,9 +862,10 @@ # use distcc if it is requested (check buildenv and PKGBUILD opts) if [ "$(check_buildenv distcc)" = "y" -a "$(check_option distcc)" != "n" ]; then [ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH + export DISTCC_HOSTS elif [ "$(check_option distcc)" = "n" ]; then # if it is not wanted, clear the makeflags too - export MAKEFLAGS="" + MAKEFLAGS="" fi
# use ccache if it is requested (check buildenv and PKGBUILD opts) @@ -874,7 +875,7 @@
# clear user-specified makeflags if requested if [ "$(check_option makeflags)" = "n" ]; then - export MAKEFLAGS="" + MAKEFLAGS="" fi
# build @@ -884,9 +885,8 @@ unset LC_ALL LC_MESSAGES LANG umask 0022
- # ensure CFLAGS and CXXFLAGS are used - export CFLAGS - export CXXFLAGS + # ensure all necessary build variables are exported + export CFLAGS CXXFLAGS MAKEFLAGS
#check for "exit on syntax error" shell option echo $SHELLOPTS | grep errexit 2>&1 >/dev/null
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
I concur with the threads severity, on my system I neither get my CFLAGS/CPPFLAGS nor MAKEFLAGS (-j3) exported.
Ummmm, CFLAGS would be a different issue, as they were already exported by makepkg before we addresed the MAKEFLAGS not being exported. I can verify on my builds that CFLAGS are respected. In addition, CXXFLAGS is the variable used for C++ by makepkg.
-Dan _______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
Hi, Sorry, typo. I tried this pkgbuild: pkgname=foo pkgver=1.0 pkgrel=1 pkgdesc="A dummy package" arch=('i686') build() { echo ">>>>" echo $FTPAGENT echo $CARCH echo $CHOST echo $DISTCC_HOSTS echo $PKGDEST echo $PACKAGER echo $CFLAGS echo $CXXFLAGS echo $MAKEFLAGS echo "<<<<" } Resulting with:
/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3 --no-check-certificate i686 i686-pc-linux-gnu
/home/imachine -march=prescott -O2 -pipe -fomit-frame-pointer -march=prescott -O2 -pipe -fomit-frame-pointer -j3 <<<< Seems the flags get exported... but my builds still dont build with the cflags specified nor with -j3... Maybe something's wrong with the build process, i.e., the stuff gets exported but then gets neglected/overwritten during ./configure and make/gmake. Cheers, //m. -- Mateusz Jędrasik <m.jedrasik@gmail.com> tel. +48(79)022-9393, +48(51)69-444-90 http://imachine.szklo.eu.org
On 5/16/07, Mateusz Jedrasik <m.jedrasik@gmail.com> wrote:
Seems the flags get exported... but my builds still dont build with the cflags specified nor with -j3...
Maybe something's wrong with the build process, i.e., the stuff gets exported but then gets neglected/overwritten during ./configure and make/gmake.
Things are MUCH easier to debug if you give us a specific package or PKGBUILD that fails, instead of trying to generalize the issue. Can you do this? -Dan
Thursday 17 of May 2007 04:41:12 Dan McGee napisał(a):
On 5/16/07, Mateusz Jedrasik <m.jedrasik@gmail.com> wrote:
Seems the flags get exported... but my builds still dont build with the cflags specified nor with -j3...
Maybe something's wrong with the build process, i.e., the stuff gets exported but then gets neglected/overwritten during ./configure and make/gmake.
Things are MUCH easier to debug if you give us a specific package or PKGBUILD that fails, instead of trying to generalize the issue. Can you do this?
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
Pretty much any package doesn't work properly. If the package uses g++ for compilation, no CFLAGS are used at all (for example, aurbuild -s nanodc) and neither are MAKEFLAGS (-j3). Well maybe they are, just the package's Makefiles cannot support it... but I doubt it. If a package uses C (such as irssi-svn), then the flags are passed, so 'only' MAKEFLAGS don't work. Hope this helps... Regards, //m. -- Mateusz Jędrasik <m.jedrasik@gmail.com> tel. +48(79)022-9393, +48(51)69-444-90 http://imachine.szklo.eu.org
Mateusz Jedrasik wrote:
Thursday 17 of May 2007 04:41:12 Dan McGee napisał(a):
On 5/16/07, Mateusz Jedrasik <m.jedrasik@gmail.com> wrote:
Seems the flags get exported... but my builds still dont build with the cflags specified nor with -j3...
Maybe something's wrong with the build process, i.e., the stuff gets exported but then gets neglected/overwritten during ./configure and make/gmake. Things are MUCH easier to debug if you give us a specific package or PKGBUILD that fails, instead of trying to generalize the issue. Can you do this?
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
Pretty much any package doesn't work properly.
If the package uses g++ for compilation, no CFLAGS are used at all (for example, aurbuild -s nanodc) and neither are MAKEFLAGS (-j3). Well maybe they are, just the package's Makefiles cannot support it... but I doubt it.
If a package uses C (such as irssi-svn), then the flags are passed, so 'only' MAKEFLAGS don't work.
Hope this helps...
Regards,
//m.
I've tested the latest version of makepkg out of git and it works perfectly all the required variables (CFLAGS, CXXFLAGS, MAKEFLAGS, DISTCC_HOST) are exported to the shell. If a package isn't picking them up it's probably the package that's broken. Andrew
On 5/21/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Mateusz Jedrasik wrote:
Thursday 17 of May 2007 04:41:12 Dan McGee napisał(a):
On 5/16/07, Mateusz Jedrasik <m.jedrasik@gmail.com> wrote:
Seems the flags get exported... but my builds still dont build with the cflags specified nor with -j3...
Maybe something's wrong with the build process, i.e., the stuff gets exported but then gets neglected/overwritten during ./configure and make/gmake. Things are MUCH easier to debug if you give us a specific package or PKGBUILD that fails, instead of trying to generalize the issue. Can you do this?
-Dan
Pretty much any package doesn't work properly.
If the package uses g++ for compilation, no CFLAGS are used at all (for example, aurbuild -s nanodc) and neither are MAKEFLAGS (-j3). Well maybe they are, just the package's Makefiles cannot support it... but I doubt it.
If a package uses C (such as irssi-svn), then the flags are passed, so 'only' MAKEFLAGS don't work.
Hope this helps...
Regards,
//m.
I've tested the latest version of makepkg out of git and it works perfectly all the required variables (CFLAGS, CXXFLAGS, MAKEFLAGS, DISTCC_HOST) are exported to the shell. If a package isn't picking them up it's probably the package that's broken.
Andrew
Thanks for the testing, I (we) appreciate it. I would have to agree with Andrew now if you are having problems with the makepkg in GIT now- it would be a broken package (in the build process) rather than a broken makepkg. -Dan
participants (6)
-
Aaron Griffin
-
Andreas Radke
-
Andrew Fyfe
-
Dan McGee
-
Daniel Isenmann
-
Mateusz Jedrasik