]> code.ossystems Code Review - openembedded-core.git/commit
verify-bashisms: fix problems with tinfoil2
authorPatrick Ohly <patrick.ohly@intel.com>
Tue, 31 Jan 2017 12:50:29 +0000 (13:50 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 31 Jan 2017 15:28:35 +0000 (15:28 +0000)
commitaa439f11c7f414774843720d68ebe0a6d3375ea6
tree899bfae3878bea88e7c1a517046adb0543a98c60
parent62f42ce063115f4a02c219e323252223818a150f
verify-bashisms: fix problems with tinfoil2

tinfoil2 is based on a client/server architecture, which broke the
verify-bashisms script:

- The tinfoil instance and its data proxies can't be pickled, so
  all interaction with the bitbake server has to run in the main
  script process and only processing of the plain scripts can
  be done with multiprocessing:

  _pickle.PicklingError: Can't pickle <class 'bb.tinfoil.TinfoilCookerAdapter.TinfoilRecipeCacheAdapter'>: attribute lookup TinfoilRecipeCacheAdapter on bb.tinfoil failed

- The multiprocessing pool has to be created before initializing
  tinfoil, otherwise the pool workers end up trying to communicate
  with the bitbake server during shutdown:

  ERROR: UI received SIGTERM
  Process ForkPoolWorker-2:
  Traceback (most recent call last):
    File "/usr/lib/python3.4/multiprocessing/process.py", line 257, in _bootstrap
      util._exit_function()
    File "/usr/lib/python3.4/multiprocessing/util.py", line 286, in _exit_function
      _run_finalizers(0)
    ...
    File "/usr/lib/python3.4/multiprocessing/process.py", line 131, in is_alive
      assert self._parent_pid == os.getpid(), 'can only test a child process'
   AssertionError: can only test a child process

- func() needs to defined before creating the pool to avoid:

  AttributeError: Can't get attribute 'func' on <module '__main__' from '/work/openembedded-core/scripts/verify-bashisms'>

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/verify-bashisms