bblock.rst 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Locking and Unlocking Recipes Using ``bblock``
  3. **********************************************
  4. By design, the OpenEmbedded build system builds everything from scratch
  5. unless BitBake determines that specific tasks do not require rebuilding.
  6. At startup, it computes a signature for all tasks, based on the task's input.
  7. Then, it compares these signatures with the ones from the sstate cache (if they
  8. exist). Any changes cause the task to rerun.
  9. During development, changes might trigger BitBake to rebuild certain
  10. recipes, even when we know they do not require rebuilding at that stage.
  11. For example, modifying a recipe can lead to rebuilding its native
  12. counterpart, which might prove unnecessary. Editing the ``python3`` recipe,
  13. for instance, can prompt BitBake to rebuild ``python3-native`` along with any
  14. recipes that depend on it.
  15. To prevent this, use ``bblock`` to lock specific tasks or recipes to
  16. specific signatures, forcing BitBake to use the sstate cache for them.
  17. .. warning::
  18. Use ``bblock`` only during the development phase.
  19. Forcing BitBake to use the sstate cache, regardless of input changes, means
  20. the recipe metadata no longer directly reflect the output. Use this feature
  21. with caution. If you do not understand why signatures change, see the section
  22. on :yocto_wiki:`understanding what changed </TipsAndTricks/Understanding_what_changed_(diffsigs_etc)>`.
  23. Locking tasks and recipes
  24. -------------------------
  25. To lock a recipe, use::
  26. $ bblock recipe
  27. You can also use a space-separated list of recipes to lock multiple recipes::
  28. $ bblock recipe1 recipe2
  29. Locking a recipe means locking all tasks of the recipe. If you need to
  30. lock only particular tasks, use the `-t` option with a comma-separated
  31. list of tasks::
  32. $ bblock -t task1,task2 recipe
  33. Unlocking tasks and recipes
  34. ---------------------------
  35. To unlock a recipe, use the ``-r`` option::
  36. $ bblock -r recipe
  37. You can also use a space-separated list of recipes to unlock multiple recipes::
  38. $ bblock -r recipe1 recipe2
  39. Unlocking a recipe means unlocking all tasks of the recipe. If you need to
  40. unlock only particular tasks use the ``-t`` option with a comma-separated
  41. list of tasks::
  42. $ bblock -r -t task1,task2 recipe
  43. To unlock all recipes, do not specify any recipe::
  44. $ bblock -r
  45. Configuration file
  46. ------------------
  47. ``bblock`` will dump the signatures in the ``build/conf/bblock.conf`` file,
  48. included by default in :oe_git:`meta/conf/bitbake.conf </openembedded-core/tree/meta/conf/bitbake.conf>`.
  49. To dump the file, use the ``-d`` option::
  50. $ bblock -d
  51. Locking mechanism
  52. -----------------
  53. ``bblock`` computes the signature(s) of the task(s) and sets the 3 following
  54. variables: :term:`SIGGEN_LOCKEDSIGS`, :term:`SIGGEN_LOCKEDSIGS_TYPES`
  55. and :term:`SIGGEN_LOCKEDSIGS_TASKSIG_CHECK`.
  56. In particular, ``bblock`` sets::
  57. SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
  58. SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
  59. SIGGEN_LOCKEDSIGS_<package_arch> += "<recipe>:<task>:<signature>"
  60. This produces architecture specific locks and reminds user that some tasks
  61. have locked signatures.
  62. Example
  63. -------
  64. When working on the ``python3`` recipe, we can lock ``python3-native`` with
  65. the following::
  66. $ bblock python3-native
  67. $ bblock -d
  68. # Generated by bblock
  69. SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
  70. SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
  71. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_patch:865859c27e603ba42025b7bb766c3cd4c0f477e4962cfd39128c0619d695fce7"
  72. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_sysroot:f8fa5d3194cef638416000252b959e86d0a19f6b7898e1f56b643c588cdd8605"
  73. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_prepare_recipe_sysroot:fe295ac505d9d1143313424b201c6f3f2a0a90da40a13a905b86b874705f226a"
  74. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_fetch:1b6e4728fee631bc7a8a7006855c5b8182a8224579e32e3d0a2db77c26459f25"
  75. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_unpack:2ad74d6f865ef75c35c0e6bbe3f9a90923a6b2c62c18a3ddef514ea31fbc588f"
  76. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_deploy_source_date_epoch:15f89b8483c1ad7507480f337619bb98c26e231227785eb3543db163593e7b42"
  77. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_configure:7960c13d23270fdb12b3a7c426ce1da0d2f5c7cf5e5d3f5bdce5fa330eb7d482"
  78. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_compile:012e1d4a63f1a78fc2143bd90d704dbcf5865c5257d6272aa7540ec1cd3063d9"
  79. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_install:d3401cc2afa4c996beb154beaad3e45fa0272b9c56fb86e9db14ec3544c68f9d"
  80. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_build:fa88bb7afb9046c0417c24a3fa98a058653805a8b00eda2c2d7fea68fc42f882"
  81. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_collect_spdx_deps:cc9c53ba7c495567e9a38ec4801830c425c0d1f895aa2fc66930a2edd510d9b4"
  82. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_spdx:766a1d09368438b7b5a1a8e2a8f823b2b731db44b57e67d8b3196de91966f9c5"
  83. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_package_spdx:46f80faeab25575e9977ba3bf14c819489c3d489432ae5145255635108c21020"
  84. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_recipe_qa:cb960cdb074e7944e894958db58f3dc2a0436ecf87c247feb3e095e214fec0e4"
  85. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_lic:15657441621ee83f15c2e650e7edbb036870b56f55e72e046c6142da3c5783fd"
  86. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_manifest:24f0abbec221d27bbb2909b6e846288b12cab419f1faf9f5006ed80423d37e28"
  87. SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_addto_recipe_sysroot:bcb6a1905f113128de3f88d702b706befd6a786267c045ee82532759a7c214d7"