libpayload is failing to build. The first pass it fails every time and is unable to find curses to link against. It usually succeeds in a retry so the failure is hidden, but sometimes it fails when retried.
These builds happened 3 days apart and both failed with the same issue. The build has completed several times in between so the issue is not consistently reproduced.
http://chromegw/i/chromeos/builders/fox%20canary/builds/21 http://chromegw/i/chromeos/builders/fox%20canary/builds/9
First try: (seen on every build)
libpayload-0.0.1-r491: CC drivers/video/video.libc.o libpayload-0.0.1-r491: CC drivers/usb/usbinit.libc.o libpayload-0.0.1-r491: drivers/keyboard.c:32:20: fatal error: curses.h: No such file or directory CC drivers/usb/usb.libc.o libpayload-0.0.1-r491: libpayload-0.0.1-r491: compilation terminated.
Retry: (only seen sometimes)
libpayload-0.0.1-r491: make: Entering directory `/build/fox_wtm2/tmp/portage/sys-boot/libpayload-0.0.1-r491/work/libpayload-0.0.1/payloads/libpayload' libpayload-0.0.1-r491: CC arch/x86/util.libc.o libpayload-0.0.1-r491: CC arch/x86/exec.libc.o libpayload-0.0.1-r491: CC libcbfs/cbfs.libcbfs.o libpayload-0.0.1-r491: CC liblzma/lzma.liblzma.o libpayload-0.0.1-r491: In file included from libcbfs/cbfs.c:30:0: libpayload-0.0.1-r491: include/endian.h:27:31: fatal error: libpayload-config.h: No such file or directory libpayload-0.0.1-r491: compilation terminated.
Comment #1
Posted on Mar 12, 2013 by Happy Panda(No comment was entered for this change.)
Comment #2
Posted on Mar 12, 2013 by Happy Pandalibpayload needs a build-time dependency on ncurses which should solve the first issue, I'm less sure about the second so I will wait for Gabe.
Comment #3
Posted on Mar 12, 2013 by Happy RabbitWhat seems to be happening is that we've got an include leak.
In drivers/keyboard.c, we've got this line
*/
include
include
include <<<<<<<<<<<<
define I8042_CMD_READ_MODE 0x20
define I8042_CMD_WRITE_MODE 0x60
If you do a find for curses.h, you'll see that libpayload does indeed provide that file.
$ find ./ -name curses.h ./curses/PDCurses-3.4/curses.h ./curses/curses.h
So then the question is how is it supposed to find it instead of falling back to the system include (which it shouldn't). In curses/Makefile.inc
includes-$(CONFIG_TINYCURSES) += curses.h
For other includes, they're appended to INCLUDES conditionally in that file, but nothing is done with curses.h. To be consistent with the other files it should be added to INCLUDE at least conditionally, but I'd say since curses.h is included in at least keyboard.c unconditionally, it would make sense to just append all those headers to the include search path unconditionally and be done with it.
So the only reason it works at all is because includes are leaking in from the host, and because it's almost certain that the host has ncurses installed, nobody has noticed until now. Making ncurses a dependency fixes the symptom by making it actually certain ncurses is installed, but really we need to make it not depend on that in the first place.
Comment #4
Posted on Mar 12, 2013 by Happy RabbitThen for the second problem, I found this in the main Makefile.inc:
libpci-c-deps = $(obj)/libpayload-config.h libc-c-deps = $(obj)/libpayload-config.h libcurses-c-deps = $(obj)/libpayload-config.h
It looks like libpayload-config.h is being added in as a dependency to some libraries but not all. I'm not sure why the automatic dependency finder thing wouldn't be able to figure out this dependency, but I guess it can't for some reason. I'd bet that normally libpayload-config.h is generated very quickly and is almost always available before other things are being compiled, but sometimes we lose the race condition.
Comment #5
Posted on Mar 14, 2013 by Quick RabbitProject: chromeos/third_party/coreboot Branch : chromeos-2012.05.10 Author : Gabe Black Commit : 84eb90ce1e4b8b50298f8db04ed49920b0a9b841
Code Review +1: Stefan Reinauer Code Review +2: Patrick Georgi Verified +1: Gabe Black Change-Id : Ib2f8cef8617af1ebcc621c2da9eb6762689f417e Reviewed-at : https://gerrit-int.chromium.org/33675
libpayload: Make keycode constants available outside of curses.h.
And include the new, split out version in drivers/keyboard.c and drivers/usb/usbhid.c. Those files were including curses.h just for those definitions, but the include path was only fixed up to to point to the libpayload versions of those files if one of the variants of curses was compiled in. If neither was, gcc would fall back to the system version of that header which is wrong.
BUG=chromium-os:39839 TEST=Built for fox_wtm2 in an otherwise empty build directory. Without this change, the build would fail reliably when it couldn't find curses.h either from within libpayload or from the system at large. After this change the build succeeded. BRANCH=None
Signed-off-by: Gabe Black
M payloads/libpayload/drivers/keyboard.c M payloads/libpayload/drivers/usb/usbhid.c A payloads/libpayload/include/keycodes.h
Comment #6
Posted on Mar 14, 2013 by Quick RabbitProject: chromeos/third_party/coreboot Branch : chromeos-2012.05.10 Author : Gabe Black Commit : 525b6f82ca10413edf634f2fbbdcc39f937abeaf
Code Review +2: Stefan Reinauer Verified +1: Gabe Black Change-Id : If16c25c623c4e1193dcbb13895f2a126b7eed8e6 Reviewed-at : https://gerrit-int.chromium.org/33676
libpayload: Fix the config file dependency in the Makefile template.
The template had a dependency on config.h which was correct for coreboot, where this build system originally came from, but not for libpayload which uses the differently named libpayload-config.h, presumably to avoid colliding with a config.h used by the actual payload. Because libpayload-config.h is now effectively a dependency of everything, it doesn't have to be added piecemeal in Makefile.inc.
BUG=chromium-os:39839 TEST=Built several times for fox_wtm2 and didn't see any compile failures, although I hadn't seen any before this change either. BRANCH=None
Signed-off-by: Gabe Black
M payloads/libpayload/Makefile M payloads/libpayload/Makefile.inc
Comment #7
Posted on Mar 15, 2013 by Massive Camel(No comment was entered for this change.)
Comment #8
Posted on Mar 19, 2013 by Quick RabbitMoved to: Issue chromium:221937
Status: Moved
Labels:
Type-Bug
Pri-2
Cr-OS-Firmware-BIOS
OS-Chrome
Hotlist-TreeCloser