FS#13214 - makepkg/fakeroot seems to break kernel configuration scripts.
Attached to Project:
Arch Linux
Opened by kludge (kludge) - Wednesday, 11 February 2009, 20:16 GMT
Last edited by Allan McRae (Allan) - Friday, 20 March 2009, 23:22 GMT
Opened by kludge (kludge) - Wednesday, 11 February 2009, 20:16 GMT
Last edited by Allan McRae (Allan) - Friday, 20 March 2009, 23:22 GMT
|
Details
Description:
http://bbs.archlinux.org/viewtopic.php?id=63488 http://bbs.archlinux.org/viewtopic.php?id=64403 i realize this is a pretty vague description, but i haven't had the time to track it down more specifically yet. i will look at it more closely as soon as a i can. Additional info: * kernels 2.6.28.2 - .4 (using the abs kernel26 PKGBUILD and the kernel26-vanilla and parallel PKGBUILDS for me) * pacman 3.2.2-1 * fakeroot 1.2.1-1 Steps to reproduce: run 'makepkg' against any kernel PKGBUILD that calls 'make {x,g,menu}config' |
This task depends upon
Closed by Allan McRae (Allan)
Friday, 20 March 2009, 23:22 GMT
Reason for closing: Not a bug
Additional comments about closing: See final comment
Friday, 20 March 2009, 23:22 GMT
Reason for closing: Not a bug
Additional comments about closing: See final comment
FS#12653. This will be fixed when pacman-3.3 comes out and makepkg allows the build to be done outside the fakeroot.when running makepkg on kernel PKGBUILDs, the kernel configuration interfaces (usually) break. i have encountered this behavior with the kernel26 PKGBUILD from the ABS, the kernel26-parallel PKGBUILD from the AUR [1], a pkgbuild of my own for totally vanilla kernel sources (essentially the ABS PKGBUILD minus the arch patches), and the 'Custom Kernel Compilation with ABS' PKGBUILD from the wiki [2].
with 'make menuconfig' the menu is unuseable. the arrow keys produce '[[B[[C[[A', etc. and the options are not selectable. i can only exit the menu with <ctrl>-C, which also aborts makepkg.
this occurs in both a terminal emulator within an x session and at the console. when 'makepkg' is run in the console, the 'make menuconfig' menu takes up only the upper-left quarter of the screen and exhibits the behavior described above. 'make menuconfig' run mannually inside ${startdir}/src/linux-2.6.28/ occupies the whole console and works properly.
with 'make xconfig,' the x configuration app fails to launch with:
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
CHECK qt
HOSTCC scripts/kconfig/conf.o
sed < scripts/kconfig/lkc_proto.h > scripts/kconfig/lkc_defs.h 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
SHIPPED scripts/kconfig/zconf.tab.c
HOSTCC scripts/kconfig/kxgettext.o
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
/opt/qt/bin/moc -i scripts/kconfig/qconf.h -o scripts/kconfig/qconf.moc
HOSTCC scripts/kconfig/kconfig_load.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTCXX scripts/kconfig/qconf.o
HOSTLD scripts/kconfig/qconf
scripts/kconfig/qconf arch/x86/Kconfig
make[1]: *** [xconfig] Segmentation fault
make: *** [xconfig] Error 2
'make xconfig' run manually inside ${startdir}/src/linux-2.6.28/ works as expected.
this behavior is not 100% consistent. occassionally, the 'xconfig' and 'menuconfig' make targets work properly when called by 'makepkg.' i have not found any pattern that determines when they work and when they break, though i haven't had the time yet to add debugging statements to 'makepkg' or 'fakeroot'.
these errors aside, kernel compilation works as expected with all of the PKGBUILDs mentioned above.
[1] http://aur.archlinux.org/packages.php?ID=23467
[2] http://wiki.archlinux.org/index.php/Custom_Kernel_Compilation_with_ABS
Can you try running "bash --noprofile --norc" and THEN running makepkg with menuconfig?
@jan: in short, yes, though i've never seen it documented that PKGBUILDs are supposed to be non-interactive.
@aaron: before trying "bash --noprofile --norc", i wanted to see if i could reliably reproduce the behavior. so i ran 'makepkg' with the 2.6.28.4-1 ABS PGKBUILD, with 'yes "" | make config' changed to 'make menuconfig.' 'menuconfig' worked as expected. then i tried the same thing with the kernel26parallel PKGBUILG from the AUR, only i ran 'makepkg -L', and 'menuconfig' fails as described. (i got into the habit of using the '-L' flag when tracking down http://bugs.archlinux.org/task/12864.)
i removed src/ from both and ran 'makepkg' again, swapping the '-L' flags. ('makepkg -L' against the ABS PKGBUILD, 'makepkg' against kernel26parallel.) 'menuconfig' worked for kernel26parallel, and failed on the ABS PKGBUILD.
somehow, i hadn't noticed that was what made the difference before. it's almost certainly the cause is this line in /usr/bin/makepkg:
line 696: build 2>&1 | tee "$BUILDLOG"; ret=${PIPESTATUS[0]}
i'm going to hypothesize that it's 'tee' grabbing the ncurses output of 'make menuconfig'.
the '-L' flag seems to have no effect on 'make xconfig', for which i can't reproduce the breakage. it's most likely a separate issue entirely.
@all: so, if PKGBUILDs are expected to be entirely non-interactive, then makepkg seems to be working exactly as expected, and i've created a furor over a user error. crap. my bad.
Still, this brings up a good point that the -L flag may be confusing and make some things more error prone.
I wonder if there's a solution....
To test this out replace:
build 2>&1 | tee "$BUILDLOG"; ret=${PIPESTATUS[0]}
with:
logpipe=$(mktemp -u "$startdir/logpipe.XXXXXXXX")
mknod "$logpipe" p
exec 3>&1
tee "$BUILDLOG" < "$logpipe" &
exec 1>"$logpipe" 2>"$logpipe"
$pkgfunc 2>&1 || ret=$?
sync
exec 1>&3 2>&3 3>&-
rm "$logpipe"
FS#12592unlikely. i don't have a single nvidia anything installed on this system.
For the 'xconfig' is related that the fakeroot sometimes crash on multithreads programs randomly. For this cases fakeroot recommend to use the "tcp version".
Please recompile your fakeroot with --with-ipc=tcp and test again.
you can see that qconf is linked agains libpthread, run in at your linux source dir
$ ldd scripts/kconfig/qconf | grep pthread
libpthread.so.0 => /lib/libpthread.so.0 (0xb76f3000)
Also, the build step will be able to be run outside of fakeroot once pacman-3.3 is release so this will then work (apart from logging, but makepkg, non-interactive, remember...).