Date
1 - 9 of 9
yocto-kernel-tools and multiple users
Trevor Woerner
I believe a recent change in the yocto-kernel-tools is causing some funny
issue I saw this morning on my overnight jenkins builds. commit 08463d684c1952e74c25344cddace4c3f24c739d Date: Mon Oct 31 14:30:12 2016 -0400 scc: exit on error If there is an error in the processing of the input files, scc should exit and inform the user. scc is executed on a combined/preprocessed file and as a result it doesn't have the granularity to see each input file individually. Rather than moving preprocessing into scc (from spp), we can trap the line number of the error and dump context around the line. This gives the user a pointer to the input file and the specific line that caused the problem. Signed-off-by: Bruce Ashfield <bruce.ashfield@...> diff --git a/tools/scc b/tools/scc index b6ab747..0294103 100755 --- a/tools/scc +++ b/tools/scc @@ -238,18 +238,37 @@ process_file() done unset PATH - if [ -n "${verbose}" ]; then - eval . $in $outfile_append - else - # hide stderr if we aren't verbose - eval . $in $outfile_append 2> /dev/null - fi + ( + set -e + eval . $in $outfile_append > /tmp/scc-output 2>&1 + ) + ) - if [ $? -ne 0 ]; then - echo "[ERROR]: processing of file $in failed" - exit 1 + if [ $? -ne 0 ]; then + echo "[ERROR]: processing of file $in failed" + cat /tmp/scc-output + + # look for common errors so we can point to the right input file + + # 1) /tmp/tmp.gfN6WsbDHN: line 403: cat: No such file or directory + # "grep -oh" will only output what matches, which gets us "line 404: .." + # cut gets us the second field, which is the line number + line=$(cat /tmp/scc-output | grep -oh "line.*:" | cut -f2 -d' ' | sed 's/://g') + if [ -n "$line" ]; then + let start_line=$line-20 + let end_line=$line+10 + if [ $start_line -lt 0 ]; then + start_line=0 + fi + echo "" + echo "Context around the error is:" + echo "" + sed -n -e "$start_line,$end_line p" -e "$end_line q" $in | sed 's/^/ /' + echo "" + echo "See pre-processed file $in for more details" fi - ) + exit 1 + fi return 0 } In order to catch errors, scc's output is being hardcoded to /tmp/scc-output. But on my box there are two users who perform builds: jenkins and myself. When the second person comes along to do a build it finds inadequate permissions on /tmp/scc-output. Is anyone else seeing this? |
|
Bruce Ashfield
On Thu, Dec 1, 2016 at 3:05 PM, Trevor Woerner <twoerner@...> wrote: I believe a recent change in the yocto-kernel-tools is causing some funny Gah, that's my bad. I'm currently in transit for a trip to Europe, but I'll fix this to use mktmp and friends tomorrow and send out a patch. Bruce -- -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"
|
|
Trevor Woerner
On Thu 2016-12-01 @ 05:28:20 PM, Bruce Ashfield wrote:
Gah, that's my bad. I'm currently in transit for a trip to Europe, but I'llGreat, thanks :-) I think there might be a second issue too. When scc-cmds/patch.cmd is run from the native sysroot, it errors out as follows: | /z/layerindex-master/raspi2-basic/tmp-glibc/sysroots/x86_64-linux/usr/bin/scc-cmds/patch.cmd: line 29: : No such file or directory Line 29 of patch.cmd looks like: eval echo "\"patches/${cbranch_name}/${relative_patch_dir}/${simple_patch_name}\"" >> "${branch_patch_queue}" I *think* it's complaining about "${branch_patch_queue}" but I can't be certain. Philip is also seeing this (second) issue too. Does that look like something you can figure out, or should I keep digging? |
|
Bruce Ashfield <bruce.ashfield@...>
On 12/01/2016 05:44 PM, Trevor Woerner wrote:
On Thu 2016-12-01 @ 05:28:20 PM, Bruce Ashfield wrote:I can figure it out, it just looks like not all the parts of theGah, that's my bad. I'm currently in transit for a trip to Europe, but I'llGreat, thanks :-) tools are being installed properly. Can you just provide me the details of exactly how you are invoking the build that triggers the error ? Bruce |
|
Trevor Woerner
On Thu 2016-12-01 @ 05:50:21 PM, Bruce Ashfield wrote:
Can you just provide me the details of exactly how you are invoking$ git clone git://git.openembedded.org/openembedded-core.git (HEAD @ 11063a01d4511b2688ea7ba2d7359e4e07328c66) $ git clone git://git.yoctoproject.org/meta-raspberrypi (HEAD @ 44d41bf3e94c4c8fe5ad5a3650572c8d17ef36c9) $ git clone git://git.openembedded.org/bitbake.git (HEAD @ 0bb188f01e396052b127e170a25246d79a6d6741) $ openembedded-core/oe-init-build-env raspi2-test bitbake $ bitbake-layers add-layer ../meta-raspberrypi $ MACHINE=raspberrypi2 bitbake virtual/kernel Build Configuration: BB_VERSION = "1.32.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "opensuse-42.2" TARGET_SYS = "arm-oe-linux-gnueabi" MACHINE = "raspberrypi2" DISTRO = "nodistro" DISTRO_VERSION = "nodistro.0" TUNE_FEATURES = "arm armv7ve vfp thumb neon vfpv4 callconvention-hard cortexa7" TARGET_FPU = "hard" meta = "master:11063a01d4511b2688ea7ba2d7359e4e07328c66" meta-raspberrypi = "master:44d41bf3e94c4c8fe5ad5a3650572c8d17ef36c9" ERROR: linux-raspberrypi-1_4.4.28+gitAUTOINC+5afda48c34-r0 do_kernel_metadata: Function failed: do_kernel_metadata (log file is located at /z/layerindex-master/raspi2-basic-2/tmp-glibc/work/raspberrypi2-oe-linux-gnueabi/linux-raspberrypi/1_4.4.28+gitAUTOINC+5afda48c34-r0/temp/log.do_kernel_metadata.9670) ERROR: Logfile of failure stored in: /z/layerindex-master/raspi2-basic-2/tmp-glibc/work/raspberrypi2-oe-linux-gnueabi/linux-raspberrypi/1_4.4.28+gitAUTOINC+5afda48c34-r0/temp/log.do_kernel_metadata.9670 Log data follows: | DEBUG: Executing shell function do_kernel_metadata | [ERROR]: processing of file /tmp/tmp.G7DTQu11V3 failed | /z/layerindex-master/raspi2-basic-2/tmp-glibc/sysroots/x86_64-linux/usr/bin/scc-cmds/patch.cmd: line 29: : No such file or directory | | Context around the error is: | | # | prefix /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/ | kconf non-hardware /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/defconfig | prefix /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/ | patch "/z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch" | # run time: 0 seconds | # processed files: | # _cfg /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/defconfig | # _cfg /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch | | See pre-processed file /tmp/tmp.G7DTQu11V3 for more details | # | # scc v0.8 | # processed: Thu Dec 1 18:08:50 EST 2016 | # | # This is a scc output file, do not edit | # | [ERROR]: processing of file /tmp/tmp.zvbMU6XqZm failed | # _reloc_dir /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux | # _reloc_dir /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux | /z/layerindex-master/raspi2-basic-2/tmp-glibc/sysroots/x86_64-linux/usr/bin/scc-cmds/patch.cmd: line 29: : No such file or directory | | Context around the error is: | | # | prefix /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/ | kconf non-hardware /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/defconfig | prefix /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/ | patch "/z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch" | # run time: 0 seconds | # processed files: | # _cfg /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/defconfig | # _cfg /z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch | | See pre-processed file /tmp/tmp.zvbMU6XqZm for more details | ERROR: Function failed: do_kernel_metadata (log file is located at /z/layerindex-master/raspi2-basic-2/tmp-glibc/work/raspberrypi2-oe-linux-gnueabi/linux-raspberrypi/1_4.4.28+gitAUTOINC+5afda48c34-r0/temp/log.do_kernel_metadata.9670) ERROR: Task (/z/layerindex-master/layers/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bb:do_kernel_metadata) failed with exit code '1' |
|
Bruce Ashfield <bruce.ashfield@...>
On 12/01/2016 06:09 PM, Trevor Woerner wrote:
On Thu 2016-12-01 @ 05:50:21 PM, Bruce Ashfield wrote:perfect. Consider it fixed .. with something that shows upCan you just provide me the details of exactly how you are invoking$ git clone git://git.openembedded.org/openembedded-core.git that easily, I'll fix it when I'm doing the mktmp changes. Bruce $ openembedded-core/oe-init-build-env raspi2-test bitbake |
|
Trevor Woerner
Awesome! Thanks :-)
|
|
Bruce Ashfield <bruce.ashfield@...>
On 12/01/2016 06:09 PM, Trevor Woerner wrote:
On Thu 2016-12-01 @ 05:50:21 PM, Bruce Ashfield wrote:FYI: I've found the issue and will bundle it into the /tmp/ fixCan you just provide me the details of exactly how you are invoking$ git clone git://git.openembedded.org/openembedded-core.git tomorrow. Bruce
|
|
Philip Balister
On 12/01/2016 08:34 PM, Bruce Ashfield wrote:
On 12/01/2016 06:09 PM, Trevor Woerner wrote:Awesome, I unstuck myself reverting a commit, but looking forward to aOn Thu 2016-12-01 @ 05:50:21 PM, Bruce Ashfield wrote:FYI: I've found the issue and will bundle it into the /tmp/ fixCan you just provide me the details of exactly how you are invoking$ git clone git://git.openembedded.org/openembedded-core.git real fix. Philip
|
|