kas icon indicating copy to clipboard operation
kas copied to clipboard

Enable printout bitbake error stack

Open mark2b opened this issue 5 months ago • 4 comments

Is there a way to enable printout bitbake error stack (IN RED) by calling kas build

Not just 2025-07-24 07:40:27 - ERROR - Command "/workspace/poky/bitbake/bin/bitbake -c build my-project-image" failed with error 1

mark2b avatar Jul 24 '25 07:07 mark2b

Hi, kas just calls bitbake and prints all data that is emitted on stderr and stdout. If a task fails, you also should see the error log directly in the output. Which kind of error stacks are you referring to?

fmoessbauer avatar Jul 24 '25 08:07 fmoessbauer

Hi, any errors during bitbake build, usually they colored to RED

mark2b avatar Jul 24 '25 11:07 mark2b

I just tested this by injecting a exit 1 into do_configure of zlib:

kas-container checkout examples/openembedded.yml
# Inject error into zlib recipe
kas-container build examples/openembedded.yml 
2025-07-24 14:14:27 - INFO     - kas 4.8.1 started
2025-07-24 14:14:27 - INFO     - Repository poky already contains 7e081bd98fdc5435e850d1df79a5e0f1e30293d0 as commit
2025-07-24 14:14:27 - WARNING  - Repo poky is dirty - no checkout
2025-07-24 14:14:27 - INFO     - Repository poky signature valid: Fingerprint 2AFB 13F2 8FBB B0D1 B9DA F630 87EB 3D32 FB63 1AD9 from "Yocto Build and Release <[email protected]>"
2025-07-24 14:14:27 - INFO     - /work/build$ /work/poky/bitbake/bin/bitbake -c build zlib-native
Loading cache: 100% |########################################################################################################################################################################################| Time: 0:00:00
Loaded 1867 entries from dependency cache.
Parsing recipes: 100% |######################################################################################################################################################################################| Time: 0:00:00
Parsing of 916 .bb files complete (915 cached, 1 parsed). 1867 targets, 50 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "2.9.1"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "qemux86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "5.1.1"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta                 
meta-poky            = "HEAD:7e081bd98fdc5435e850d1df79a5e0f1e30293d0"

Sstate summary: Wanted 9 Local 0 Mirrors 0 Missed 9 Current 0 (0% match, 0% complete)#####################################################################################################                   | ETA:  0:00:00
Initialising tasks: 100% |###################################################################################################################################################################################| Time: 0:00:00
NOTE: Executing Tasks
ERROR: zlib-native-1.3.1-r0 do_configure: Execution of '/work/build/tmp/work/x86_64-linux/zlib-native/1.3.1/temp/run.do_configure.1512' failed with exit code 1
ERROR: Logfile of failure stored in: /work/build/tmp/work/x86_64-linux/zlib-native/1.3.1/temp/log.do_configure.1512
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/work/build/../poky/meta/recipes-devtools/quilt/quilt-native_0.68.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['quilt-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_configure
| Checking for shared library support...
| Building shared library libz.so.1.3.1 with gcc .
| Checking for size_t... Yes.
| Checking for off64_t... Yes.
| Checking for fseeko... Yes.
| Checking for strerror... Yes.
| Checking for unistd.h... Yes.
| Checking for stdarg.h... Yes.
| Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
| Checking for vsnprintf() in stdio.h... Yes.
| Checking for return value of vsnprintf()... Yes.
| Checking for attribute(visibility) support... Yes.
| WARNING: exit code 1 from a shell command.
ERROR: Task (virtual:native:/work/build/../poky/meta/recipes-core/zlib/zlib_1.3.1.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 19 tasks of which 0 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  virtual:native:/work/build/../poky/meta/recipes-core/zlib/zlib_1.3.1.bb:do_configure
    log: /work/build/tmp/work/x86_64-linux/zlib-native/1.3.1/temp/log.do_configure.1512
Summary: There was 1 ERROR message, returning a non-zero exit code.
2025-07-24 14:14:35 - ERROR    - Command "/work/poky/bitbake/bin/bitbake -c build zlib-native" failed with error 1

Is this the output you are expecting?

fmoessbauer avatar Jul 24 '25 12:07 fmoessbauer

Is this resolved now?

jan-kiszka avatar Sep 08 '25 06:09 jan-kiszka