aparcar / openwrt-rebuilder

5 stars 5 forks source link

Print last logfile after encountering an error #4

Open kpcyrd opened 2 years ago

kpcyrd commented 2 years ago

I encountered an error and had trouble figuring out what went wrong because the script just failed with "make indicated an error":

Running ['./scripts/feeds', 'install', '-a'] in /asdf/rebuild
Downloading https://downloads.cdn.openwrt.org/releases/21.02.2/targets/zynq/generic/config.buildinfo
Running ['make', "IGNORE_ERRORS='n m'", 'BUILD_LOG=1', 'BUILD_LOG_DIR=/tmp/rebuilderdawkrmT/out/logs', '-j5', 'defconfig'] in /asdf/rebuild
Running ['make', "IGNORE_ERRORS='n m'", 'BUILD_LOG=1', 'BUILD_LOG_DIR=/tmp/rebuilderdawkrmT/out/logs', '-j5', 'clean', 'V=s'] in /asdf/rebuild
Running ['make', "IGNORE_ERRORS='n m'", 'BUILD_LOG=1', 'BUILD_LOG_DIR=/tmp/rebuilderdawkrmT/out/logs', '-j5', 'download'] in /asdf/rebuild
Downloading https://downloads.cdn.openwrt.org/releases/21.02.2/targets/zynq/generic/packages/Packages
storing to /asdf/rebuild/Packages
Downloading https://downloads.cdn.openwrt.org/releases/21.02.2/targets/zynq/generic/sha256sums
storing to /asdf/rebuild/sha256sums_origin
Running ['make', "IGNORE_ERRORS='n m'", 'BUILD_LOG=1', 'BUILD_LOG_DIR=/tmp/rebuilderdawkrmT/out/logs', '-j5', 'tools/tar/compile'] in /asdf/rebuild
Error running ['make', "IGNORE_ERRORS='n m'", 'BUILD_LOG=1', 'BUILD_LOG_DIR=/tmp/rebuilderdawkrmT/out/logs', '-j5', 'tools/tar/compile']
[2022-04-17T19:16:59Z INFO  rebuilderd_worker::proc] "/usr/local/libexec/rebuilderd/rebuilder-openwrt.sh" exited with exit=exit status: 0, captured 169697 bytes
[2022-04-17T19:16:59Z INFO  rebuilderd_worker::rebuild] No output artifact found, marking as BAD: "/tmp/rebuilderdawkrmT/out/openwrt-21.02.2-zynq-avnet_zynq-zed-squashfs-sdcard.img.gz"
[2022-04-17T19:16:59Z ERROR rebuilderd_worker] Package failed to verify

After catting all files in the log folder and going through the output I found the root cause, but maybe this should've been available on stdout of the rebuild log?

checking for mkfifo... yes
checking whether mkfifo rejects trailing slashes... yes
checking whether mknod can create fifo without root privileges... configure: error: in `/asdf/rebuild/build_dir/host/tar-1.32':
configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
See `config.log' for more details
make[2]: *** [Makefile:32: /asdf/rebuild/build_dir/host/tar-1.32/.configured] Error 1
time: tools/tar/compile#14.57#7.36#24.34

Thanks!

aparcar commented 2 years ago

I somewhat disabled verbose logs as it slows down the CIs, it's just massive amounts of text. I think I could implement something like printing the error.txt file so people know where to look specifically.

aparcar commented 2 years ago

Does this solve the issue? https://github.com/aparcar/openwrt-rebuilder/pull/6