0

I'm a Yocto newbie porting an SBC project from Buildroot, setting up a custom layer called meta-x. I initially added meta-x to the bblayers.conf in /build/conf/ but wanted to run the yocto-check-layer script -- it returned that I should remove meta-x from the /build/conf/bblayers.conf and run it again:

    INFO: meta-remora already in /home/hal/build/conf/bblayers.conf. To capture initial      
    signatures, layer under test should not present in BBLAYERS. Please remove meta-remora   
    from BBLAYERS.`

The yocto-check-layers script then runs normally, but hangs on the "Getting initial signatures …" stage. Sending a keyboard interrupt prints the following error output:

    Traceback (most recent call last):
     File "/home/hal/poky/scripts/yocto-check-layer", line 251, in <module>
       ret =  main()
     File "/home/hal/poky/scripts/yocto-check-layer", line 214, in main
       td['sigs'], td['tunetasks'] = get_signatures(td['builddir'])
     File "/home/hal/poky/scripts/lib/checklayer/__init__.py", line 316, in get_signatures
       cmd, builddir)
     File "/home/hal/poky/scripts/lib/checklayer/__init__.py", line 284, in check_command
       output, _ = p.communicate()
     File "/usr/lib/python3.6/subprocess.py", line 850, in communicate
       stdout = self.stdout.read()
     File "/home/hal/poky/scripts/yocto-check-layer", line 160, in cleanup_bblayers
       shutil.copyfile(bblayersconf + '.backup', bblayersconf)
     File "/usr/lib/python3.6/shutil.py", line 120, in copyfile
       with open(src, 'rb') as fsrc:
    FileNotFoundError: [Errno 2] No such file or directory:    
    '/home/hal/build/conf/bblayers.conf.backup'

My build setup has Ubuntu 18.04 LTS in WSL2.

Neither restarting the shell nor restarting WSL2 have any effect. Without diving into the source (a bit too new for that) I have not found any references to a bblayers.conf.backup file online. Is this common knowledge? If I have to create the file what should it include - it seems like something that should be auto-generated.

I followed the Yocto Quick-Build guide to get where I am now, and have been using the basic core-image-base recipe to build images.

Thanks,

hal.

Edit 1 - top output during Getting initial signatures stage which I believe hangs:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
  104 hal       20   0  688068 621324  10496 S   0.3  4.8   0:07.55 Cooker
  113 hal       20   0  204756  58184   7288 S   0.3  0.5   0:00.13 Cooker
    1 root      20   0     908    540    472 S   0.0  0.0   0:00.01 init
    7 root      20   0     908     88     20 S   0.0  0.0   0:00.00 init
    8 root      20   0     908     88     20 S   0.0  0.0   0:00.04 init
    9 hal       20   0    4636    800    736 S   0.0  0.0   0:00.00 sh
   12 hal       20   0   20320   4024   3416 S   0.0  0.0   0:00.02 bash
   55 hal       20   0  167824  32984   9432 S   0.0  0.3   0:00.17 python3
  101 hal       20   0    4640    812    744 S   0.0  0.0   0:00.00 sh
  102 hal       20   0  161780  30052   9364 S   0.0  0.2   0:00.56 KnottyUI
  152 root      20   0     908     88     20 S   0.0  0.0   0:00.00 init
  153 root      20   0     908     88     20 S   0.0  0.0   0:00.00 init
  154 hal       20   0    4636    860    796 S   0.0  0.0   0:00.00 sh
  157 hal       20   0   20320   3868   3420 S   0.0  0.0   0:00.00 bash
  165 hal       20   0   38272   3436   2992 R   0.0  0.0   0:00.00 top

Edit 2 - interesting bitbake output after interrupting the previously frozen yocto-check-layers stage (error output earlier in post).

hal@disguise-000557:~/build$ bitbake
^CTraceback (most recent call last):
  File "/home/hal/poky/bitbake/bin/bitbake", line 37, in <module>
    cookerdata.CookerConfiguration()))
  File "/home/hal/poky/bitbake/lib/bb/main.py", line 360, in bitbake_main
    server_connection, ui_module = setup_bitbake(configParams)
  File "/home/hal/poky/bitbake/lib/bb/main.py", line 449, in setup_bitbake
    server_connection = bb.server.process.connectProcessServer(sockname, featureset)
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 608, in connectProcessServer
    server_connection.connection.updateFeatureSet(featureset)
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 415, in updateFeatureSet
    _, error = self.runCommand(["setFeatures", featureset])
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 403, in runCommand
    if not self.recv.poll(30):
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 719, in poll
    return self.reader.poll(timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 257, in poll
    return self._poll(timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 414, in _poll
    r = wait([self], timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 911, in wait
    ready = selector.select(timeout)
  File "/usr/lib/python3.6/selectors.py", line 376, in select
    fd_event_list = self._poll.poll(timeout)
KeyboardInterrupt
NOTE: Reconnecting to bitbake server...

Edit 3 - the contents of the poky/scripts/lib/checklayer/__init.py__ file that is generating the initial error

   290  def get_signatures(builddir, failsafe=False, machine=None, extravars=None):
   291      import re
   292
   293      # some recipes needs to be excluded like meta-world-pkgdata
   294      # because a layer can add recipes to a world build so signature
   295      # will be change
   296      exclude_recipes = ('meta-world-pkgdata',)
   297
   298      sigs = {}
   299      tune2tasks = {}
   300
   301      cmd = 'BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS BB_SIGNATURE_HANDLER" BB_SIGNATURE_HANDLER="OEBasicHash" '
   302      if extravars:
   303          cmd += extravars
   304          cmd += ' '
   305      if machine:
   306          cmd += 'MACHINE=%s ' % machine
   307      cmd += 'bitbake '
   308      if failsafe:
   309          cmd += '-k '
   310      cmd += '-S none world'
   311      sigs_file = os.path.join(builddir, 'locked-sigs.inc')
   312      if os.path.exists(sigs_file):
   313          os.unlink(sigs_file)
   314      try:
   315          check_command('Generating signatures failed. This might be due to some parse error and/or general layer incompatibilities.',
   316                        cmd, builddir)
   317      except RuntimeError as ex:
   318          if failsafe and os.path.exists(sigs_file):
   319              # Ignore the error here. Most likely some recipes active
   320              # in a world build lack some dependencies. There is a
   321              # separate test_machine_world_build which exposes the
   322              # failure.
   323              pass
   324          else:
   325              raise
   326
   327      sig_regex = re.compile("^(?P<task>.*:.*):(?P<hash>.*) .$")
   328      tune_regex = re.compile("(^|\s)SIGGEN_LOCKEDSIGS_t-(?P<tune>\S*)\s*=\s*")
   329      current_tune = None
   330      with open(sigs_file, 'r') as f:
   331          for line in f.readlines():
   332              line = line.strip()
   333              t = tune_regex.search(line)
   334              if t:
   335                  current_tune = t.group('tune')
   336              s = sig_regex.match(line)
   337              if s:
   338                  exclude = False
   339                  for er in exclude_recipes:
   340                      (recipe, task) = s.group('task').split(':')
   341                      if er == recipe:
   342                          exclude = True
   343                          break
   344                  if exclude:
   345                      continue
   346
   347                  sigs[s.group('task')] = s.group('hash')
   348                  tune2tasks.setdefault(current_tune, []).append(s.group('task'))
   349
   350      if not sigs:
   351          raise RuntimeError('Can\'t load signatures from %s' % sigs_file)
   352
   353      return (sigs, tune2tasks)

Edit 4 - output of the fail command line 301 in the yocto-check-layer

BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS BB_SIGNATURE_HANDLER" BB_SIGNATURE_HANDLER="OEBasicHash" bitbake -S none world
^CTraceback (most recent call last):
  File "/home/hal/poky/bitbake/bin/bitbake", line 37, in <module>
    cookerdata.CookerConfiguration()))
  File "/home/hal/poky/bitbake/lib/bb/main.py", line 360, in bitbake_main
    server_connection, ui_module = setup_bitbake(configParams)
  File "/home/hal/poky/bitbake/lib/bb/main.py", line 449, in setup_bitbake
    server_connection = bb.server.process.connectProcessServer(sockname, featureset)
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 608, in connectProcessServer
    server_connection.connection.updateFeatureSet(featureset)
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 415, in updateFeatureSet
    _, error = self.runCommand(["setFeatures", featureset])
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 405, in runCommand
    if not self.recv.poll(30):
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 719, in poll
    return self.reader.poll(timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 257, in poll
    return self._poll(timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 414, in _poll
    r = wait([self], timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 911, in wait
    ready = selector.select(timeout)
  File "/usr/lib/python3.6/selectors.py", line 376, in select
    fd_event_list = self._poll.poll(timeout)
KeyboardInterrupt
NOTE: Reconnecting to bitbake server...
NOTE: No reply from server in 30s

Edit 5 - ps aux | grep bitbake output while the previous cmd is run

ps aux | grep bitbake
hal         63  0.4  0.2 168348 28872 pts/0    Sl+  17:51   0:00 python3 /home/hal/poky/bitbake/bin/bitbake -v -S none world
hal         65  4.5  4.8 690048 622924 ?       S    17:51   0:08 bitbake-server /home/hal/poky/bitbake/bin/bitbake-server decafbad 3 5 /home/hal/build/bitbake-cookerdaemon.log /home/hal/build/bitbake.lock /home/hal/build/bitbake.sock 0 None 0
hal         74  0.3  0.4 205772 59148 ?        Sl   17:51   0:00 bitbake-server /home/hal/poky/bitbake/bin/bitbake-server decafbad 3 5 /home/hal/build/bitbake-cookerdaemon.log /home/hal/build/bitbake.lock /home/hal/build/bitbake.sock 0 None 0

Edit 6 - ran with -verbose, hangs again, following error after 3 keyboard interrupts:

Keyboard Interrupt, closing down...


Second Keyboard Interrupt, stopping...

Traceback (most recent call last):
  File "/home/hal/poky/bitbake/lib/bb/ui/knotty.py", line 644, in main
    event = eventHandler.waitEvent(0.25)
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 685, in waitEvent
    self.eventQueueNotify.wait(delay)
  File "/usr/lib/python3.6/threading.py", line 551, in wait
    signaled = self._cond.wait(timeout)
  File "/usr/lib/python3.6/threading.py", line 299, in wait
    gotit = waiter.acquire(True, timeout)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hal/poky/bitbake/lib/bb/ui/knotty.py", line 873, in main
    _, error = server.runCommand(["stateShutdown"])
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 403, in runCommand
    if not self.recv.poll(30):
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 719, in poll
    return self.reader.poll(timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 257, in poll
    return self._poll(timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 414, in _poll
    r = wait([self], timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 911, in wait
    ready = selector.select(timeout)
  File "/usr/lib/python3.6/selectors.py", line 376, in select
    fd_event_list = self._poll.poll(timeout)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hal/poky/bitbake/bin/bitbake", line 37, in <module>
    cookerdata.CookerConfiguration()))
  File "/home/hal/poky/bitbake/lib/bb/main.py", line 379, in bitbake_main
    configParams)
  File "/home/hal/poky/bitbake/lib/bb/ui/knotty.py", line 877, in main
    state_force_shutdown()
  File "/home/hal/poky/bitbake/lib/bb/ui/knotty.py", line 861, in state_force_shutdown
    _, error = server.runCommand(["stateForceShutdown"])
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 403, in runCommand
    if not self.recv.poll(30):
  File "/home/hal/poky/bitbake/lib/bb/server/process.py", line 719, in poll
    return self.reader.poll(timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 257, in poll
    return self._poll(timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 414, in _poll
    r = wait([self], timeout)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 911, in wait
    ready = selector.select(timeout)
  File "/usr/lib/python3.6/selectors.py", line 376, in select
    fd_event_list = self._poll.poll(timeout)
KeyboardInterrupt
hal
  • 33
  • 6
  • The backup file is created by the script itself during execution, by copying the bblayers.conf file. But note, that when the script is interrupted by a signal, a cleanup method is called, with is trying to delete the temporary files - this one is one of those files. However it seems that at the time you are interrupting it, it doesn't exist yet. You might want to print out the bitbake cmd it is trying to execute in line 316 `/home/hal/poky/scripts/lib/checklayer/__init__.py`, and see why it is hanging when running manually. – skandigraun Jun 14 '23 at 10:18
  • Also, are you sure that it is hanging? Is there 0% CPU usage, or it is still at the same step after a coffee break? Depending on the size of the layer and on your CPU, it might take a few minutes to go through all recipes – skandigraun Jun 14 '23 at 10:42
  • thanks for your response, I'll add the relevant section to the post, not sure how to run manually – hal Jun 14 '23 at 14:21
  • Print it, it's a bitbake command. Then just copy it, and paste it in your terminal. – skandigraun Jun 14 '23 at 14:58
  • its a `yocto-check-layer` script command, not bitbake? debug and output_log options don't provide additional info – hal Jun 14 '23 at 15:13
  • `yocto-check-layer` is a python script, that is executing a bitbake terminal command in line 316 of checklayer. That bitbake command seems to take its time. Just stick a `print("Now running command: %s" % cmd)` or similar after line 310 to see what is it exactly. – skandigraun Jun 14 '23 at 15:20
  • Ahh I see, thanks, it prints the command on line 301, and the failsafe condition "bitbake -S none world" -- `BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS BB_SIGNATURE_HANDLER" BB_SIGNATURE_HANDLER="OEBasicHash" bitbake -S none world` – hal Jun 14 '23 at 16:32
  • Add a `-v` argument (for verbose) between `bitbake` and `-S` command, and see if it tells you anything new... – skandigraun Jun 14 '23 at 16:39
  • That `NOTE: No reply from server in 30s` looks strange... do you have maybe some zombie bitbake processes in `ps aux | grep bitbake` ? You could try killing them (though that should be fixed by a reboot also, which you already did...) – skandigraun Jun 14 '23 at 16:50
  • I don't think so? Added the ps aux output to the post. I reran with -v as you suggested, it printed a build configuration as if running a build and has been stuck at Initialising tasks: 44% for ~5 min. It continues hanging after a first keyboard interrupt, I've added that to the post as edit 6 (sorry it's getting a bit long wew) – hal Jun 14 '23 at 16:57
  • Hmmm... gets stuck during initializing? What happens if you nuke the `build` folder? (You can also rename it for a test, if it takes a very long time to rebuild it) – skandigraun Jun 14 '23 at 17:02
  • As part of that I assume you mean rerun the `source poky/oe-init-build-env` cmd? because otherwise it throws a conf/bitbake.conf not found exception – hal Jun 14 '23 at 17:07
  • ...most likely. It shouldn't hurt. (I guess that creates the empty build folder) – skandigraun Jun 14 '23 at 17:08
  • That worked! Finished the build stage so I reran `yocto-check-layer meta-x` and it got past Signature stage, will report when it finishes. – hal Jun 14 '23 at 17:11
  • Failed the compatibility test, but at least the command works and there's some recommendations based on the log, thanks mate! – hal Jun 14 '23 at 17:12
  • Wohooooooooooo! – skandigraun Jun 14 '23 at 17:13

0 Answers0