Skip to contentSkip to conversation

Add bblock documentation

PATCH Superseded Julien Stephan 3 participants 14 messages Oct 31, 2024 – Nov 4, 2024

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

cover Add bblock documentation

Hello,

The main purpose of this series is to add documentation for bblock.

bblock uses internally the 3 following variables: SIGGEN_LOCKEDSIGS, SIGGEN_LOCKEDSIGS_TASKSIG_CHECK and SIGGEN_LOCKEDSIGS_TYPE which are not documentated, so adding them to the glossary.

This series also adds SPHINXLINTDOCS variable in documentation/Makefile to help cheking subset of the documentation.

documentation/README is also updated to show how to use SHPHINXLINTDOCS and VALEDOCS to help user sylecheck and lintcheck their own documentation file.

I also added "sstate" into the Yocto vocabulary to avoir error when running Vale.

This series was built and checked with:

  $ make html
  $ make stylecheck VALEDOCS=dev-manual/bblock.rst
  $ make sphinx-lint SPHINXLINTDOCS=dev-manual/bblock.rst

I tried my best to make Vale happy, but I still have the following warnings:

dev-manual/bblock.rst

 1:1  warning     Try to keep the Coleman–Liau Index grade (10.29) below 9.                           Readability.ColemanLiau
 1:1  warning     Try to keep the Flesch reading ease score (57.51) above 70.                         Readability.FleschReadingEase
 1:1  warning     Try to keep the Flesch–Kincaid grade level (8.28) below 8.                          Readability.FleschKincaid
 1:1  warning     Try to keep the SMOG grade (11.42) below 10.                                        Readability.SMOG
 1:1  warning     Try to keep the LIX score (38.20) below 35.                                         Readability.LIX
 3:1  suggestion  Use sentence-style capitalization in 'Locking and Unlocking Recipes Using ******'.  RedHat.Headings

About the Readability, I am not sure I can do better ^^ But anyone with better english skills than me can help here!

About the capitalization: I decided to ignore it to keep consistency with all other headings of the reference manual.

---
Julien Stephan (5):
README: add instruction to run Vale on a subset
documentation: Makefile: add SPHINXLINTDOCS to specify subset to sphinx-lint
styles: vocabularies: Yocto: add sstate
ref-manual: variables: add SIGGEN_LOCKEDSIGS* variables
dev-manual: add bblock documentation

 documentation/Makefile                             |  23 ++--
 documentation/README                               |  16 ++-
 documentation/dev-manual/bblock.rst                | 129 +++++++++++++++++++++
 documentation/dev-manual/index.rst                 |   1 +
 documentation/ref-manual/variables.rst             |  33 ++++++
 .../styles/config/vocabularies/Yocto/accept.txt    |   1 +
 6 files changed, 191 insertions(+), 12 deletions(-)

---
base-commit: 9563855ccd92e21fb6f8320c96a3a83e115c947e
change-id: 20241031-add-bblock-documentation-4a5f8cf9c6d2

Best regards,

Signature · 1 line
Julien Stephan <[email protected]>
#1 lore raw

PATCH 1/5 README: add instruction to run Vale on a subset

make stylecheck runs Vale on the whole documentation which can be long and reports a lot of errors/warnings. We can run Vale on a subset using the VALEDOCS variable, so update documentation to highlight it.

---
 documentation/README | 7 +++++++
 1 file changed, 7 insertions(+)
documentation/README +7 -0
index c888b666a8632a1d6f576c68e4f9ca966d79f134..6a4db97d65b9c23828163d8b548485b2e302bc97 100644
@@ -142,6 +142,13 @@ To run Vale:
 
  $ make stylecheck
 
+Style checking the whole documentation might take some time and generate a
+lot of warnings/errors, thus one can run Vale on a subset:
+
+  $ make stylecheck VALEDOCS=<file>
+  $ make stylecheck VALEDOCS="<file1> <file2>"
+  $ make stylecheck VALEDOCS=<dir>
+
 Link checking the Yocto Project documentation
 =============================================
 
Signature · 1 line
2.47.0
#2 lore raw

Re: [docs] [PATCH 1/5] README: add instruction to run Vale on a subset

Hi Julien,

Thanks for your patches.

Quoted 14 lines · Julien Stephan

make stylecheck runs Vale on the whole documentation which can be long and reports a lot of errors/warnings. We can run Vale on a subset using the VALEDOCS variable, so update documentation to highlight it.

---
 documentation/README | 7 +++++++
 1 file changed, 7 insertions(+)
documentation/README +0 -0
index c888b666a8632a1d6f576c68e4f9ca966d79f134..6a4db97d65b9c23828163d8b548485b2e302bc97 100644

documentation/README To run Vale: · line 146

Quoted 5 lines
documentation/README +2 -0
@@ -142,6 +142,13 @@ To run Vale:
 
  $ make stylecheck
 
+Style checking the whole documentation might take some time and generate a
+lot of warnings/errors, thus one can run Vale on a subset:

s/on a subset:/on a subset of files or directories:/ I would say

documentation/README To run Vale: · line 154

Quoted 7 lines
documentation/README +4 -0
+  $ make stylecheck VALEDOCS=<file>
+  $ make stylecheck VALEDOCS="<file1> <file2>"
+  $ make stylecheck VALEDOCS=<dir>
+
 Link checking the Yocto Project documentation
 =============================================
 

Cheers,
Antonin

Signature · 3 lines
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 2/5 documentation: Makefile: add SPHINXLINTDOCS to specify subset to sphinx-lint

In reply to Julien Stephan

make sphinx-lint runs sphinx-lint on the whole documentation which can be long and reports a lot or errors/warnings. Let's add a new SHPINXLINTDOCS variable to allow specifying a subset, just as VALEDOCS does. Keep variable assignment aligned and also use $(SOURCEDIR) by default for SPHINXLINTDOCS and VALEDOCS variables.

Also update the README file and fix a typo in Link checking section title.

---
 documentation/Makefile | 23 ++++++++++++-----------
 documentation/README   |  9 ++++++++-
 2 files changed, 20 insertions(+), 12 deletions(-)
documentation/Makefile +12 -11
index 189bd1dfac69d3b3185aa3a2ff7c212084ae280b..0bd9db5eaeb9122f9f396cda61631c403a1325a0 100644
@@ -3,17 +3,18 @@
 
 # You can set these variables from the command line, and also
 # from the environment for the first two.
-SPHINXOPTS    ?= -W --keep-going -j auto
-SPHINXBUILD   ?= sphinx-build
+SPHINXOPTS     ?= -W --keep-going -j auto
+SPHINXBUILD    ?= sphinx-build
 # Release notes are excluded because they contain contributor names and commit messages which can't be modified
-VALEOPTS      ?= --no-wrap --glob '!migration-guides/release-notes-*.rst'
-VALEDOCS      ?= .
-SOURCEDIR     = .
-IMAGEDIRS     = */svg
-BUILDDIR      = _build
-DESTDIR       = final
-SVG2PNG       = inkscape
-SVG2PDF       = inkscape
+VALEOPTS       ?= --no-wrap --glob '!migration-guides/release-notes-*.rst'
+SOURCEDIR      = .
+VALEDOCS       ?= $(SOURCEDIR)
+SPHINXLINTDOCS ?= $(SOURCEDIR)
+IMAGEDIRS      = */svg
+BUILDDIR       = _build
+DESTDIR        = final
+SVG2PNG        = inkscape
+SVG2PDF        = inkscape
 
 ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0)
 $(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed")
@@ -54,7 +55,7 @@ stylecheck:
 	vale $(VALEOPTS) $(VALEDOCS)
 
 sphinx-lint:
-	sphinx-lint $(SOURCEDIR)
+	sphinx-lint $(SPHINXLINTDOCS)
 
 epub: $(PNGs)
 	$(SOURCEDIR)/set_versions.py
documentation/README +8 -1
index 6a4db97d65b9c23828163d8b548485b2e302bc97..d2676ae2de9cb9c2dbe4191c0e38f8847cd8603b 100644
@@ -149,7 +149,7 @@ lot of warnings/errors, thus one can run Vale on a subset:
   $ make stylecheck VALEDOCS="<file1> <file2>"
   $ make stylecheck VALEDOCS=<dir>
 
-Link checking the Yocto Project documentation
+Lint checking the Yocto Project documentation
 =============================================
 
 To fix errors which are not reported by Sphinx itself,
@@ -163,6 +163,13 @@ To run sphinx-lint:
 
  $ make sphinx-lint
 
+Lint checking the whole documentation might take some time and generate a
+lot of warnings/errors, thus one can run sphinx-lint on a specific file:
+
+  $ make sphinx-lint SPHINXLINTDOCS=<file>
+  $ make sphinx-lint SPHINXLINTDOCS="<file1> <file2>"
+  $ make sphinx-lint SPHINXLINTDOCS=<dir>
+
 Sphinx theme and CSS customization
 ==================================
 
Signature · 1 line
2.47.0
#4 lore raw

Re: [docs] [PATCH 2/5] documentation: Makefile: add SPHINXLINTDOCS to specify subset to sphinx-lint

Hi Julien,

Quoted 71 lines · Julien Stephan

make sphinx-lint runs sphinx-lint on the whole documentation which can be long and reports a lot or errors/warnings. Let's add a new SHPINXLINTDOCS variable to allow specifying a subset, just as VALEDOCS does. Keep variable assignment aligned and also use $(SOURCEDIR) by default for SPHINXLINTDOCS and VALEDOCS variables.

Also update the README file and fix a typo in Link checking section title.

---
 documentation/Makefile | 23 ++++++++++++-----------
 documentation/README   |  9 ++++++++-
 2 files changed, 20 insertions(+), 12 deletions(-)
documentation/Makefile +12 -11
index 189bd1dfac69d3b3185aa3a2ff7c212084ae280b..0bd9db5eaeb9122f9f396cda61631c403a1325a0 100644
@@ -3,17 +3,18 @@
 
 # You can set these variables from the command line, and also
 # from the environment for the first two.
-SPHINXOPTS    ?= -W --keep-going -j auto
-SPHINXBUILD   ?= sphinx-build
+SPHINXOPTS     ?= -W --keep-going -j auto
+SPHINXBUILD    ?= sphinx-build
 # Release notes are excluded because they contain contributor names and commit messages which can't be modified
-VALEOPTS      ?= --no-wrap --glob '!migration-guides/release-notes-*.rst'
-VALEDOCS      ?= .
-SOURCEDIR     = .
-IMAGEDIRS     = */svg
-BUILDDIR      = _build
-DESTDIR       = final
-SVG2PNG       = inkscape
-SVG2PDF       = inkscape
+VALEOPTS       ?= --no-wrap --glob '!migration-guides/release-notes-*.rst'
+SOURCEDIR      = .
+VALEDOCS       ?= $(SOURCEDIR)
+SPHINXLINTDOCS ?= $(SOURCEDIR)
+IMAGEDIRS      = */svg
+BUILDDIR       = _build
+DESTDIR        = final
+SVG2PNG        = inkscape
+SVG2PDF        = inkscape
 
 ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0)
 $(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed")
@@ -54,7 +55,7 @@ stylecheck:
 	vale $(VALEOPTS) $(VALEDOCS)
 
 sphinx-lint:
-	sphinx-lint $(SOURCEDIR)
+	sphinx-lint $(SPHINXLINTDOCS)
 
 epub: $(PNGs)
 	$(SOURCEDIR)/set_versions.py
documentation/README +1 -1
index 6a4db97d65b9c23828163d8b548485b2e302bc97..d2676ae2de9cb9c2dbe4191c0e38f8847cd8603b 100644
@@ -149,7 +149,7 @@ lot of warnings/errors, thus one can run Vale on a subset:
   $ make stylecheck VALEDOCS="<file1> <file2>"
   $ make stylecheck VALEDOCS=<dir>
 
-Link checking the Yocto Project documentation
+Lint checking the Yocto Project documentation
 =============================================
 
 To fix errors which are not reported by Sphinx itself,

documentation/README To run sphinx-lint: · line 167

Quoted 5 lines
documentation/README +2 -0
@@ -163,6 +163,13 @@ To run sphinx-lint:
 
  $ make sphinx-lint
 
+Lint checking the whole documentation might take some time and generate a
+lot of warnings/errors, thus one can run sphinx-lint on a specific file:

s/on a specific file:/on a subset of files or directories:/

documentation/README To run sphinx-lint: · line 175

Quoted 8 lines
documentation/README +5 -0
+
+  $ make sphinx-lint SPHINXLINTDOCS=<file>
+  $ make sphinx-lint SPHINXLINTDOCS="<file1> <file2>"
+  $ make sphinx-lint SPHINXLINTDOCS=<dir>
+
 Sphinx theme and CSS customization
 ==================================
 

Cheers,
Antonin

--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#5 lore raw

PATCH 3/5 styles: vocabularies: Yocto: add sstate

In reply to Julien Stephan

Add sstate as an accepted word to avoid errors when runnign make stylecheck.

---
 documentation/styles/config/vocabularies/Yocto/accept.txt | 1 +
 1 file changed, 1 insertion(+)
documentation/styles/config/vocabularies/Yocto/accept.txt +1 -0
index ca622ba41274c892f1fc1e16d8332a02f07a3531..7fedda8ae23c22f3660292faa0a1c3df23da353e 100644
@@ -2,4 +2,5 @@ BitBake
 BSP
 crosstap
 OpenEmbedded
+sstate
 Yocto
Signature · 1 line
2.47.0
#6 lore raw

PATCH 4/5 ref-manual: variables: add SIGGEN_LOCKEDSIGS* variables

In reply to Julien Stephan

Variables SIGGEN_LOCKEDSIGS, SIGGEN_LOCKEDSIGS_TASKSIG_CHECK and SIGGEN_LOCKEDSIGS_TYPES are used to lock specific tasks to specific signatures. They are used by bitbake -S <lockedsigs> and bblock, so add documentation for them.

---
 documentation/ref-manual/variables.rst | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
documentation/ref-manual/variables.rst +33 -0
index 07ed143ac5606617c720301ac6621355a341f90a..8cfb978e795e43e3ef25f3e18e11baf7c2a28d54 100644
@@ -7880,6 +7880,39 @@ system and gives an overview of their function and contents.
          might break at runtime if the interface of the recipe was changed
          after the other had been built.
 
+   :term:`SIGGEN_LOCKEDSIGS`
+     The list of locked taks, with the form::
+
+       SIGGEN_LOCKEDSIGS += "<package>:<task>:<signature>"
+
+     If ``<signature>`` exists for the specified ``<task>`` and ``<package>``
+     in sstate, BitBake will use the cached output instead of rebuilding the
+     ``<task>``. If it does not exist, BitBake will build the ``<task>`` and
+     the sstate will be used next time.
+
+   :term:`SIGGEN_LOCKEDSIGS_TASKSIG_CHECK`
+     Specifies the debug level of task signature check. 3 levels are supported:
+
+     * info: displays a "Note" message to remind user that a task is locked
+       and current signature matches the locked one.
+     * warn: displays a "Warning" message if a task is locked and current
+       signature does not match the locked one.
+     * error: same as warn but displays an “Error” message and abort.
+
+   :term:`SIGGEN_LOCKEDSIGS_TYPES`
+     Allowed overrides for :term:`SIGGEN_LOCKEDSIGS`. This is mainly used
+     for achitecture specific lock. A common value for :term:`SIGGEN_LOCKEDSIGS_TYPES`
+     is ``${PACKAGE_ARCHS}``::
+
+       SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+       SIGGEN_LOCKEDSIGS_core2-64 += "bc:do_compile:abcd"
+       SIGGEN_LOCKEDSIGS_cortexa57 += "bc:do_compile:efgh"
+
+     Here, the ``do_compile`` task from ``bc`` will be locked only for
+     ``x86-64`` and ``arm64`` but not for other architectures such as
+     ``qemumips``.
+
    :term:`SITEINFO_BITS`
       Specifies the number of bits for the target system CPU. The value
       should be either "32" or "64".
Signature · 1 line
2.47.0
#7 lore raw

Re: [docs] [PATCH 4/5] ref-manual: variables: add SIGGEN_LOCKEDSIGS* variables

Hi Julien,

thanks for your documentation work!
Please find some typo fixes below.

Quoted 22 lines · Julien Stephan

Variables SIGGEN_LOCKEDSIGS, SIGGEN_LOCKEDSIGS_TASKSIG_CHECK and SIGGEN_LOCKEDSIGS_TYPES are used to lock specific tasks to specific signatures. They are used by bitbake -S <lockedsigs> and bblock, so add documentation for them.

---
 documentation/ref-manual/variables.rst | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
documentation/ref-manual/variables.rst +4 -0
index 07ed143ac5606617c720301ac6621355a341f90a..8cfb978e795e43e3ef25f3e18e11baf7c2a28d54 100644
@@ -7880,6 +7880,39 @@ system and gives an overview of their function and contents.
          might break at runtime if the interface of the recipe was changed
          after the other had been built.
 
+   :term:`SIGGEN_LOCKEDSIGS`
+     The list of locked taks, with the form::
+
+       SIGGEN_LOCKEDSIGS += "<package>:<task>:<signature>"

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7896

Quoted 10 lines
documentation/ref-manual/variables.rst +10 -0
+
+     If ``<signature>`` exists for the specified ``<task>`` and ``<package>``
+     in sstate, BitBake will use the cached output instead of rebuilding the
+     ``<task>``. If it does not exist, BitBake will build the ``<task>`` and
+     the sstate will be used next time.
+
+   :term:`SIGGEN_LOCKEDSIGS_TASKSIG_CHECK`
+     Specifies the debug level of task signature check. 3 levels are supported:
+
+     * info: displays a "Note" message to remind user that a task is locked

s/to remind user/to remind the user/

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7897

Quoted 1 line
documentation/ref-manual/variables.rst +1 -0
+       and current signature matches the locked one.

s/and current signature/and the current signature/

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7898

Quoted 1 line
documentation/ref-manual/variables.rst +1 -0
+     * warn: displays a "Warning" message if a task is locked and current

s/and current/and the current/

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7900

Quoted 2 lines
documentation/ref-manual/variables.rst +2 -0
+       signature does not match the locked one.
+     * error: same as warn but displays an “Error” message and abort.

s/and abort./and aborts./

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7904

Quoted 4 lines
documentation/ref-manual/variables.rst +4 -0
+
+   :term:`SIGGEN_LOCKEDSIGS_TYPES`
+     Allowed overrides for :term:`SIGGEN_LOCKEDSIGS`. This is mainly used
+     for achitecture specific lock. A common value for :term:`SIGGEN_LOCKEDSIGS_TYPES`

s/for achitecture specific lock./for achitecture specific locks./

Best regards
Ulrich

Quoted 14 lines
documentation/ref-manual/variables.rst +11 -0
+     is ``${PACKAGE_ARCHS}``::
+
+       SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+       SIGGEN_LOCKEDSIGS_core2-64 += "bc:do_compile:abcd"
+       SIGGEN_LOCKEDSIGS_cortexa57 += "bc:do_compile:efgh"
+
+     Here, the ``do_compile`` task from ``bc`` will be locked only for
+     ``x86-64`` and ``arm64`` but not for other architectures such as
+     ``qemumips``.
+
    :term:`SITEINFO_BITS`
       Specifies the number of bits for the target system CPU. The value
       should be either "32" or "64".
Signature · 4 lines
Pengutronix e.K.                           | Ulrich Ölmann               |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#8 lore raw

Re: [docs] [PATCH 4/5] ref-manual: variables: add SIGGEN_LOCKEDSIGS* variables

In reply to Julien Stephan

Hi Julien,

On top of Ulrich's comments, here are my suggestions/corrections:

Quoted 15 lines · Julien Stephan

Variables SIGGEN_LOCKEDSIGS, SIGGEN_LOCKEDSIGS_TASKSIG_CHECK and SIGGEN_LOCKEDSIGS_TYPES are used to lock specific tasks to specific signatures. They are used by bitbake -S <lockedsigs> and bblock, so add documentation for them.

---
 documentation/ref-manual/variables.rst | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
documentation/ref-manual/variables.rst +0 -0
index 07ed143ac5606617c720301ac6621355a341f90a..8cfb978e795e43e3ef25f3e18e11baf7c2a28d54 100644

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7888

Quoted 9 lines
documentation/ref-manual/variables.rst +6 -0
@@ -7880,6 +7880,39 @@ system and gives an overview of their function and contents.
          might break at runtime if the interface of the recipe was changed
          after the other had been built.
 
+   :term:`SIGGEN_LOCKEDSIGS`
+     The list of locked taks, with the form::
+
+       SIGGEN_LOCKEDSIGS += "<package>:<task>:<signature>"
+
+     If ``<signature>`` exists for the specified ``<task>`` and ``<package>``

How would I find such a signature by hand? Maybe worth explaining it here?

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7891

Quoted 3 lines
documentation/ref-manual/variables.rst +3 -0
+     in sstate, BitBake will use the cached output instead of rebuilding the
+     ``<task>``. If it does not exist, BitBake will build the ``<task>`` and
+     the sstate will be used next time.

Could you give a real-life example of that at the end here?

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7900

Quoted 8 lines
documentation/ref-manual/variables.rst +8 -0
+   :term:`SIGGEN_LOCKEDSIGS_TASKSIG_CHECK`
+     Specifies the debug level of task signature check. 3 levels are supported:
+
+     * info: displays a "Note" message to remind user that a task is locked
+       and current signature matches the locked one.
+     * warn: displays a "Warning" message if a task is locked and current
+       signature does not match the locked one.
+     * error: same as warn but displays an “Error” message and abort.

For "info", "warn" and "error" could you enclose that in double ticks? ``info`` and so on.

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7904

Quoted 3 lines
documentation/ref-manual/variables.rst +3 -0
+   :term:`SIGGEN_LOCKEDSIGS_TYPES`
+     Allowed overrides for :term:`SIGGEN_LOCKEDSIGS`. This is mainly used
+     for achitecture specific lock. A common value for :term:`SIGGEN_LOCKEDSIGS_TYPES`

s/achitecture/architecture/

By "mainly", do you mean "only" or could there by anything other than architectures covered by the variable?

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7910

Quoted 6 lines
documentation/ref-manual/variables.rst +6 -0
+     is ``${PACKAGE_ARCHS}``::
+
+       SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+       SIGGEN_LOCKEDSIGS_core2-64 += "bc:do_compile:abcd"
+       SIGGEN_LOCKEDSIGS_cortexa57 += "bc:do_compile:efgh"

Maybe real hashes would be better here

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7913

Quoted 3 lines
documentation/ref-manual/variables.rst +3 -0
+
+     Here, the ``do_compile`` task from ``bc`` will be locked only for
+     ``x86-64`` and ``arm64`` but not for other architectures such as

Wouldn't it be locked for ``core2-64`` and ``cortexa57`` more specifically? I might misunderstand something here. :)

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7918

Quoted 5 lines
documentation/ref-manual/variables.rst +2 -0
+     ``qemumips``.
+
    :term:`SITEINFO_BITS`
       Specifies the number of bits for the target system CPU. The value
       should be either "32" or "64".

Also I could suggest splitting the series in patches for sphinx-lint/vale and patches for documentation of variables/bblock.

Thanks!
Antonin

Signature · 3 lines
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#9 lore raw

Re: [docs] [PATCH 4/5] ref-manual: variables: add SIGGEN_LOCKEDSIGS* variables

Quoted 51 lines · Antonin Godard

Hi Julien,

On top of Ulrich's comments, here are my suggestions/corrections:

Quoted 15 lines · Julien Stephan

Variables SIGGEN_LOCKEDSIGS, SIGGEN_LOCKEDSIGS_TASKSIG_CHECK and SIGGEN_LOCKEDSIGS_TYPES are used to lock specific tasks to specific signatures. They are used by bitbake -S <lockedsigs> and bblock, so add documentation for them.

---
 documentation/ref-manual/variables.rst | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
documentation/ref-manual/variables.rst +0 -0
index 07ed143ac5606617c720301ac6621355a341f90a..8cfb978e795e43e3ef25f3e18e11baf7c2a28d54 100644

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7888

Quoted 9 lines
documentation/ref-manual/variables.rst +6 -0
@@ -7880,6 +7880,39 @@ system and gives an overview of their function and contents.
          might break at runtime if the interface of the recipe was changed
          after the other had been built.
 
+   :term:`SIGGEN_LOCKEDSIGS`
+     The list of locked taks, with the form::
+
+       SIGGEN_LOCKEDSIGS += "<package>:<task>:<signature>"
+
+     If ``<signature>`` exists for the specified ``<task>`` and ``<package>``

How would I find such a signature by hand? Maybe worth explaining it here?

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7891

Quoted 3 lines
documentation/ref-manual/variables.rst +3 -0
+     in sstate, BitBake will use the cached output instead of rebuilding the
+     ``<task>``. If it does not exist, BitBake will build the ``<task>`` and
+     the sstate will be used next time.

Could you give a real-life example of that at the end here?

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7900

Quoted 8 lines
documentation/ref-manual/variables.rst +8 -0
+   :term:`SIGGEN_LOCKEDSIGS_TASKSIG_CHECK`
+     Specifies the debug level of task signature check. 3 levels are supported:
+
+     * info: displays a "Note" message to remind user that a task is locked
+       and current signature matches the locked one.
+     * warn: displays a "Warning" message if a task is locked and current
+       signature does not match the locked one.
+     * error: same as warn but displays an “Error” message and abort.

For "info", "warn" and "error" could you enclose that in double ticks? ``info`` and so on.

Quoted 8 lines

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7904

Quoted 3 lines
documentation/ref-manual/variables.rst +3 -0
+   :term:`SIGGEN_LOCKEDSIGS_TYPES`
+     Allowed overrides for :term:`SIGGEN_LOCKEDSIGS`. This is mainly used
+     for achitecture specific lock. A common value for :term:`SIGGEN_LOCKEDSIGS_TYPES`

s/achitecture/architecture/

By "mainly", do you mean "only" or could there by anything other than architectures covered by the variable?

You can literally put anything you want in this variable..

Quoted 9 lines

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7910

Quoted 6 lines
documentation/ref-manual/variables.rst +6 -0
+     is ``${PACKAGE_ARCHS}``::
+
+       SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+       SIGGEN_LOCKEDSIGS_core2-64 += "bc:do_compile:abcd"
+       SIGGEN_LOCKEDSIGS_cortexa57 += "bc:do_compile:efgh"

Maybe real hashes would be better here

Quoted 6 lines

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7913

Quoted 3 lines
documentation/ref-manual/variables.rst +3 -0
+
+     Here, the ``do_compile`` task from ``bc`` will be locked only for
+     ``x86-64`` and ``arm64`` but not for other architectures such as

Wouldn't it be locked for ``core2-64`` and ``cortexa57`` more specifically? I might misunderstand something here. :)

You're right. I wanted to give an example for machines first, then decided to keep architecture and forgot to update. Thank you for pointing it out.

Quoted 9 lines

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 7918

Quoted 6 lines
documentation/ref-manual/variables.rst +2 -0
+     ``qemumips``.
+
    :term:`SITEINFO_BITS`
       Specifies the number of bits for the target system CPU. The value
       should be either "32" or "64".

Also I could suggest splitting the series in patches for sphinx-lint/vale and patches for documentation of variables/bblock.

Sure, I'll do that

Cheers
Julien

Quoted 9 lines

Thanks!
Antonin

--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#10 lore raw

PATCH 5/5 dev-manual: add bblock documentation

In reply to Julien Stephan

bblock is a helper tool to lock/unlock tasks and recipes to specific signatures. Add a documentation page for it.

---
 documentation/dev-manual/bblock.rst | 129 ++++++++++++++++++++++++++++++++++++
 documentation/dev-manual/index.rst  |   1 +
 2 files changed, 130 insertions(+)
documentation/dev-manual/bblock.rst new file +129 -0
new file mode 100644
index 0000000000000000000000000000000000000000..3df75799aa638d173764607df191bd99612034cf
@@ -0,0 +1,129 @@
+.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
+
+Locking and Unlocking Recipes Using ``bblock``
+**********************************************
+
+By design, the OpenEmbedded build system builds everything from scratch
+unless BitBake determines that specific parts do not require rebuilding.
+At startup, it computes a signature for each tasks, based on the task's input.
+Then, it compares these signatures with the ones from sstate (if exist). Any
+changes cause the task to rerun.
+
+During development, changes might trigger BitBake to rebuild certain
+recipes, even when we know they do not require rebuilding at that stage.
+For example, modifying a recipe can lead to the rebuilding of its native
+counterpart, which might proves unnecessary. Editing the ``python3`` recipe,
+for instance, can prompt BitBake to rebuild ``python3-native`` along with any
+recipes that depend on it.
+
+To prevent this, use ``bblock`` to lock specific tasks or recipes to
+specific signatures, forcing BitBake to use the sstate cache for them.
+
+.. attention::
+
+   Use ``bblock`` only during the development phase.
+
+   Forcing BitBake to use sstate cache, regardless of input changes, means
+   the recipe metadata no longer directly reflect the output. Use this feature
+   with caution. If you do not understand why signatures change, see the section
+   on `understanding what changed <https://wiki.yoctoproject.org/wiki/TipsAndTricks/Understanding_what_changed_(diffsigs_etc)>`__.
+
+
+Locking tasks and recipes
+-------------------------
+
+To lock a recipe, use::
+
+   $ bblock recipe
+
+You can also use a space-separated list of recipes to lock many recipes::
+
+   $ bblock recipe1 recipe2
+
+Locking a recipe, means locking all tasks of the recipe. If you need to
+lock only particular tasks use the `-t` switch with a comma-separated
+list of tasks::
+
+  $ bblock -t task1,task2 recipe
+
+
+Unlocking tasks and recipes
+---------------------------
+
+To unlock a recipe, use::
+
+   $ bblock -r recipe
+
+You can also use a space-separated list of recipes to unlock many recipes::
+
+   $ bblock -r recipe1 recipe2
+
+Unlocking a recipe, means unlocking all tasks of the recipe. If you need to
+unlock only particular tasks use the `-t` switch with a comma-separated
+list of tasks::
+
+  $ bblock -r -t task1,task2 recipe
+
+To unlock all recipes, do not specify any recipe::
+
+  $ bblock -r
+
+
+Configuration file
+------------------
+
+``bblock`` will dump the signatures in the ``build/conf/bblock.conf`` file,
+included by default in ``poky/meta/conf/bitbake.conf``.
+
+To dump it, use::
+
+  $ bblock -d
+
+
+Locking mechanism
+-----------------
+
+``bblock`` computes the signature(s) of the task(s) then uses the 3 following
+variables: :term:`SIGGEN_LOCKEDSIGS`, :term:`SIGGEN_LOCKEDSIGS_TYPES`
+and :term:`SIGGEN_LOCKEDSIGS_TASKSIG_CHECK`.
+
+In particular, ``bblock`` sets::
+
+  SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
+  SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+  SIGGEN_LOCKEDSIGS_<package_arch> += "<recipe>:<task>:<signature>"
+
+This produces architecture specific locks and reminds user that some tasks
+have locked signatures.
+
+Example
+-------
+
+When working on ``python3`` recipe, we can lock ``pyton3-native`` with the
+following::
+
+  $ bblock python3-native
+  $ bblock -d
+  # Generated by bblock
+  SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
+  SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_patch:865859c27e603ba42025b7bb766c3cd4c0f477e4962cfd39128c0619d695fce7"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_sysroot:f8fa5d3194cef638416000252b959e86d0a19f6b7898e1f56b643c588cdd8605"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_prepare_recipe_sysroot:fe295ac505d9d1143313424b201c6f3f2a0a90da40a13a905b86b874705f226a"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_fetch:1b6e4728fee631bc7a8a7006855c5b8182a8224579e32e3d0a2db77c26459f25"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_unpack:2ad74d6f865ef75c35c0e6bbe3f9a90923a6b2c62c18a3ddef514ea31fbc588f"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_deploy_source_date_epoch:15f89b8483c1ad7507480f337619bb98c26e231227785eb3543db163593e7b42"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_configure:7960c13d23270fdb12b3a7c426ce1da0d2f5c7cf5e5d3f5bdce5fa330eb7d482"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_compile:012e1d4a63f1a78fc2143bd90d704dbcf5865c5257d6272aa7540ec1cd3063d9"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_install:d3401cc2afa4c996beb154beaad3e45fa0272b9c56fb86e9db14ec3544c68f9d"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_build:fa88bb7afb9046c0417c24a3fa98a058653805a8b00eda2c2d7fea68fc42f882"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_collect_spdx_deps:cc9c53ba7c495567e9a38ec4801830c425c0d1f895aa2fc66930a2edd510d9b4"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_spdx:766a1d09368438b7b5a1a8e2a8f823b2b731db44b57e67d8b3196de91966f9c5"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_package_spdx:46f80faeab25575e9977ba3bf14c819489c3d489432ae5145255635108c21020"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_recipe_qa:cb960cdb074e7944e894958db58f3dc2a0436ecf87c247feb3e095e214fec0e4"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_lic:15657441621ee83f15c2e650e7edbb036870b56f55e72e046c6142da3c5783fd"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_manifest:24f0abbec221d27bbb2909b6e846288b12cab419f1faf9f5006ed80423d37e28"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_addto_recipe_sysroot:bcb6a1905f113128de3f88d702b706befd6a786267c045ee82532759a7c214d7"
+
documentation/dev-manual/index.rst +1 -0
index 9ccf60f7012ea344612298e77ebabed84ad6de3e..7afd0d820e94d56cb2145962b9b1a976c7951936 100644
@@ -48,5 +48,6 @@ Yocto Project Development Tasks Manual
    error-reporting-tool
    wayland
    qemu
+   bblock
 
 .. include:: /boilerplate.rst
Signature · 1 line
2.47.0
#11 lore raw

Re: [docs] [PATCH 5/5] dev-manual: add bblock documentation

Hi Julien,

great to have that documented!
Just some typos I came across.

Quoted 15 lines · Julien Stephan

bblock is a helper tool to lock/unlock tasks and recipes to specific signatures. Add a documentation page for it.

---
 documentation/dev-manual/bblock.rst | 129 ++++++++++++++++++++++++++++++++++++
 documentation/dev-manual/index.rst  |   1 +
 2 files changed, 130 insertions(+)
documentation/dev-manual/bblock.rst new file +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..3df75799aa638d173764607df191bd99612034cf

documentation/dev-manual/bblock.rst line 8

Quoted 8 lines
documentation/dev-manual/bblock.rst new file +8 -0
@@ -0,0 +1,129 @@
+.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
+
+Locking and Unlocking Recipes Using ``bblock``
+**********************************************
+
+By design, the OpenEmbedded build system builds everything from scratch
+unless BitBake determines that specific parts do not require rebuilding.
+At startup, it computes a signature for each tasks, based on the task's input.

s/for each tasks/for each task/ or perhaps s/for each tasks/for all tasks/

documentation/dev-manual/bblock.rst line 9

Quoted 1 line
documentation/dev-manual/bblock.rst new file +1 -0
+Then, it compares these signatures with the ones from sstate (if exist). Any

s/if exist/if they exist/ or s/if exist/if it exists/ depending on
if you meant the signatures or the sstate to exist.

documentation/dev-manual/bblock.rst line 14

Quoted 5 lines
documentation/dev-manual/bblock.rst new file +5 -0
+changes cause the task to rerun.
+
+During development, changes might trigger BitBake to rebuild certain
+recipes, even when we know they do not require rebuilding at that stage.
+For example, modifying a recipe can lead to the rebuilding of its native

s/to the rebuilding/to rebuilding/

documentation/dev-manual/bblock.rst line 15

Quoted 1 line
documentation/dev-manual/bblock.rst new file +1 -0
+counterpart, which might proves unnecessary. Editing the ``python3`` recipe,

s/which might proves/which might prove/

Quoted 18 lines
documentation/dev-manual/bblock.rst new file +18 -0
+for instance, can prompt BitBake to rebuild ``python3-native`` along with any
+recipes that depend on it.
+
+To prevent this, use ``bblock`` to lock specific tasks or recipes to
+specific signatures, forcing BitBake to use the sstate cache for them.
+
+.. attention::
+
+   Use ``bblock`` only during the development phase.
+
+   Forcing BitBake to use sstate cache, regardless of input changes, means
+   the recipe metadata no longer directly reflect the output. Use this feature
+   with caution. If you do not understand why signatures change, see the section
+   on `understanding what changed <https://wiki.yoctoproject.org/wiki/TipsAndTricks/Understanding_what_changed_(diffsigs_etc)>`__.
+
+
+Locking tasks and recipes
+-------------------------

documentation/dev-manual/bblock.rst line 43

Quoted 10 lines
documentation/dev-manual/bblock.rst new file +10 -0
+
+To lock a recipe, use::
+
+   $ bblock recipe
+
+You can also use a space-separated list of recipes to lock many recipes::
+
+   $ bblock recipe1 recipe2
+
+Locking a recipe, means locking all tasks of the recipe. If you need to

s/Locking a recipe, means locking/Locking a recipe means locking/

Quoted 8 lines
documentation/dev-manual/bblock.rst new file +8 -0
+lock only particular tasks use the `-t` switch with a comma-separated
+list of tasks::
+
+  $ bblock -t task1,task2 recipe
+
+
+Unlocking tasks and recipes
+---------------------------

documentation/dev-manual/bblock.rst line 61

Quoted 10 lines
documentation/dev-manual/bblock.rst new file +10 -0
+
+To unlock a recipe, use::
+
+   $ bblock -r recipe
+
+You can also use a space-separated list of recipes to unlock many recipes::
+
+   $ bblock -r recipe1 recipe2
+
+Unlocking a recipe, means unlocking all tasks of the recipe. If you need to

s/Unlocking a recipe, means unlocking/Unlocking a recipe means unlocking/

Quoted 26 lines
documentation/dev-manual/bblock.rst new file +26 -0
+unlock only particular tasks use the `-t` switch with a comma-separated
+list of tasks::
+
+  $ bblock -r -t task1,task2 recipe
+
+To unlock all recipes, do not specify any recipe::
+
+  $ bblock -r
+
+
+Configuration file
+------------------
+
+``bblock`` will dump the signatures in the ``build/conf/bblock.conf`` file,
+included by default in ``poky/meta/conf/bitbake.conf``.
+
+To dump it, use::
+
+  $ bblock -d
+
+
+Locking mechanism
+-----------------
+
+``bblock`` computes the signature(s) of the task(s) then uses the 3 following
+variables: :term:`SIGGEN_LOCKEDSIGS`, :term:`SIGGEN_LOCKEDSIGS_TYPES`

documentation/dev-manual/bblock.rst line 97

Quoted 10 lines
documentation/dev-manual/bblock.rst new file +10 -0
+and :term:`SIGGEN_LOCKEDSIGS_TASKSIG_CHECK`.
+
+In particular, ``bblock`` sets::
+
+  SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
+  SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+  SIGGEN_LOCKEDSIGS_<package_arch> += "<recipe>:<task>:<signature>"
+
+This produces architecture specific locks and reminds user that some tasks

s/reminds user/reminds the user/

Best regards
Ulrich

Quoted 43 lines
documentation/dev-manual/bblock.rst new file +32 -0
+have locked signatures.
+
+Example
+-------
+
+When working on ``python3`` recipe, we can lock ``pyton3-native`` with the
+following::
+
+  $ bblock python3-native
+  $ bblock -d
+  # Generated by bblock
+  SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
+  SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_patch:865859c27e603ba42025b7bb766c3cd4c0f477e4962cfd39128c0619d695fce7"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_sysroot:f8fa5d3194cef638416000252b959e86d0a19f6b7898e1f56b643c588cdd8605"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_prepare_recipe_sysroot:fe295ac505d9d1143313424b201c6f3f2a0a90da40a13a905b86b874705f226a"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_fetch:1b6e4728fee631bc7a8a7006855c5b8182a8224579e32e3d0a2db77c26459f25"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_unpack:2ad74d6f865ef75c35c0e6bbe3f9a90923a6b2c62c18a3ddef514ea31fbc588f"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_deploy_source_date_epoch:15f89b8483c1ad7507480f337619bb98c26e231227785eb3543db163593e7b42"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_configure:7960c13d23270fdb12b3a7c426ce1da0d2f5c7cf5e5d3f5bdce5fa330eb7d482"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_compile:012e1d4a63f1a78fc2143bd90d704dbcf5865c5257d6272aa7540ec1cd3063d9"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_install:d3401cc2afa4c996beb154beaad3e45fa0272b9c56fb86e9db14ec3544c68f9d"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_build:fa88bb7afb9046c0417c24a3fa98a058653805a8b00eda2c2d7fea68fc42f882"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_collect_spdx_deps:cc9c53ba7c495567e9a38ec4801830c425c0d1f895aa2fc66930a2edd510d9b4"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_spdx:766a1d09368438b7b5a1a8e2a8f823b2b731db44b57e67d8b3196de91966f9c5"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_package_spdx:46f80faeab25575e9977ba3bf14c819489c3d489432ae5145255635108c21020"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_recipe_qa:cb960cdb074e7944e894958db58f3dc2a0436ecf87c247feb3e095e214fec0e4"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_lic:15657441621ee83f15c2e650e7edbb036870b56f55e72e046c6142da3c5783fd"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_manifest:24f0abbec221d27bbb2909b6e846288b12cab419f1faf9f5006ed80423d37e28"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_addto_recipe_sysroot:bcb6a1905f113128de3f88d702b706befd6a786267c045ee82532759a7c214d7"
+
documentation/dev-manual/index.rst +1 -0
index 9ccf60f7012ea344612298e77ebabed84ad6de3e..7afd0d820e94d56cb2145962b9b1a976c7951936 100644
@@ -48,5 +48,6 @@ Yocto Project Development Tasks Manual
    error-reporting-tool
    wayland
    qemu
+   bblock
 
 .. include:: /boilerplate.rst
Signature · 4 lines
Pengutronix e.K.                           | Ulrich Ölmann               |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#12 lore raw

Re: [docs] [PATCH 5/5] dev-manual: add bblock documentation

In reply to Julien Stephan

Hi Julien,

Thanks for taking the time to document your tool!
On top of Ulrich's comments, here are my suggestions/corrections:

Quoted 15 lines · Julien Stephan

bblock is a helper tool to lock/unlock tasks and recipes to specific signatures. Add a documentation page for it.

---
 documentation/dev-manual/bblock.rst | 129 ++++++++++++++++++++++++++++++++++++
 documentation/dev-manual/index.rst  |   1 +
 2 files changed, 130 insertions(+)
documentation/dev-manual/bblock.rst new file +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..3df75799aa638d173764607df191bd99612034cf

documentation/dev-manual/bblock.rst line 7

Quoted 7 lines
documentation/dev-manual/bblock.rst new file +7 -0
@@ -0,0 +1,129 @@
+.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
+
+Locking and Unlocking Recipes Using ``bblock``
+**********************************************
+
+By design, the OpenEmbedded build system builds everything from scratch
+unless BitBake determines that specific parts do not require rebuilding.

s/parts/tasks/?

documentation/dev-manual/bblock.rst line 9

Quoted 2 lines
documentation/dev-manual/bblock.rst new file +2 -0
+At startup, it computes a signature for each tasks, based on the task's input.
+Then, it compares these signatures with the ones from sstate (if exist). Any

s/from sstate/from the sstate cache/?
s/if exist/if they exist/

Quoted 8 lines
documentation/dev-manual/bblock.rst new file +8 -0
+changes cause the task to rerun.
+
+During development, changes might trigger BitBake to rebuild certain
+recipes, even when we know they do not require rebuilding at that stage.
+For example, modifying a recipe can lead to the rebuilding of its native
+counterpart, which might proves unnecessary. Editing the ``python3`` recipe,
+for instance, can prompt BitBake to rebuild ``python3-native`` along with any
+recipes that depend on it.

documentation/dev-manual/bblock.rst line 27

Quoted 10 lines
documentation/dev-manual/bblock.rst new file +10 -0
+
+To prevent this, use ``bblock`` to lock specific tasks or recipes to
+specific signatures, forcing BitBake to use the sstate cache for them.
+
+.. attention::
+
+   Use ``bblock`` only during the development phase.
+
+   Forcing BitBake to use sstate cache, regardless of input changes, means
+   the recipe metadata no longer directly reflect the output. Use this feature

s/reflect/reflects/ unless metadata is a plural by default?

documentation/dev-manual/bblock.rst line 29

Quoted 2 lines
documentation/dev-manual/bblock.rst new file +2 -0
+   with caution. If you do not understand why signatures change, see the section
+   on `understanding what changed <https://wiki.yoctoproject.org/wiki/TipsAndTricks/Understanding_what_changed_(diffsigs_etc)>`__.

You can use :yocto_wiki: here:

:yocto_wiki:understanding what changed </TipsAndTricks/Understanding_what_changed_(diffsigs_etc)>.

(syntax needs double-checking ;))

documentation/dev-manual/bblock.rst line 43

Quoted 13 lines
documentation/dev-manual/bblock.rst new file +13 -0
+
+Locking tasks and recipes
+-------------------------
+
+To lock a recipe, use::
+
+   $ bblock recipe
+
+You can also use a space-separated list of recipes to lock many recipes::
+
+   $ bblock recipe1 recipe2
+
+Locking a recipe, means locking all tasks of the recipe. If you need to

No comma "," between recipe and means, I think.

documentation/dev-manual/bblock.rst line 44

Quoted 1 line
documentation/dev-manual/bblock.rst new file +1 -0
+lock only particular tasks use the `-t` switch with a comma-separated

Comma after "tasks" I think would make more sense here (to me at least).

documentation/dev-manual/bblock.rst line 48

Quoted 4 lines
documentation/dev-manual/bblock.rst new file +4 -0
+list of tasks::
+
+  $ bblock -t task1,task2 recipe
+

Maybe a real-life example would be great here!

documentation/dev-manual/bblock.rst line 53

Quoted 4 lines
documentation/dev-manual/bblock.rst new file +4 -0
+Unlocking tasks and recipes
+---------------------------
+
+To unlock a recipe, use::

...use the ``-r`` option::

documentation/dev-manual/bblock.rst line 57

Quoted 4 lines
documentation/dev-manual/bblock.rst new file +4 -0
+
+   $ bblock -r recipe
+
+You can also use a space-separated list of recipes to unlock many recipes::

s/many/multiple/ (many means "a lot of")

Quoted 9 lines
documentation/dev-manual/bblock.rst new file +9 -0
+
+   $ bblock -r recipe1 recipe2
+
+Unlocking a recipe, means unlocking all tasks of the recipe. If you need to
+unlock only particular tasks use the `-t` switch with a comma-separated
+list of tasks::
+
+  $ bblock -r -t task1,task2 recipe
+

documentation/dev-manual/bblock.rst line 76

Quoted 10 lines
documentation/dev-manual/bblock.rst new file +10 -0
+To unlock all recipes, do not specify any recipe::
+
+  $ bblock -r
+
+
+Configuration file
+------------------
+
+``bblock`` will dump the signatures in the ``build/conf/bblock.conf`` file,
+included by default in ``poky/meta/conf/bitbake.conf``.

Here you can use:

:oe_git:meta/conf/bitbake.conf </openembedded-core/tree/meta/conf/bitbake.conf>

Also, I believe that bblock.conf is a candidate for being in documentation/ref-manual/structure.rst, alongside local.conf and bblayers.conf in the section "The Build Directory --- ``build/``". Could you add a section there that explains this file briefly and that redirects the user to this document?

documentation/dev-manual/bblock.rst line 76

Quoted 2 lines
documentation/dev-manual/bblock.rst new file +2 -0
+
+To dump it, use::

s/To dump it/To dump the file/

documentation/dev-manual/bblock.rst line 86

Quoted 8 lines
documentation/dev-manual/bblock.rst new file +8 -0
+
+  $ bblock -d
+
+
+Locking mechanism
+-----------------
+
+``bblock`` computes the signature(s) of the task(s) then uses the 3 following

s/then uses/and sets/? I.e. explain what it really does with them.

Quoted 7 lines
documentation/dev-manual/bblock.rst new file +7 -0
+variables: :term:`SIGGEN_LOCKEDSIGS`, :term:`SIGGEN_LOCKEDSIGS_TYPES`
+and :term:`SIGGEN_LOCKEDSIGS_TASKSIG_CHECK`.
+
+In particular, ``bblock`` sets::
+
+  SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
+  SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"

documentation/dev-manual/bblock.rst line 103

Quoted 10 lines
documentation/dev-manual/bblock.rst new file +10 -0
+
+  SIGGEN_LOCKEDSIGS_<package_arch> += "<recipe>:<task>:<signature>"
+
+This produces architecture specific locks and reminds user that some tasks
+have locked signatures.
+
+Example
+-------
+
+When working on ``python3`` recipe, we can lock ``pyton3-native`` with the

s/on ``python3`` recipe/on the ``python3`` recipe/ s/pyton3-native/python3-native/

Quoted 31 lines
documentation/dev-manual/bblock.rst new file +26 -0
+following::
+
+  $ bblock python3-native
+  $ bblock -d
+  # Generated by bblock
+  SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
+  SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_patch:865859c27e603ba42025b7bb766c3cd4c0f477e4962cfd39128c0619d695fce7"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_sysroot:f8fa5d3194cef638416000252b959e86d0a19f6b7898e1f56b643c588cdd8605"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_prepare_recipe_sysroot:fe295ac505d9d1143313424b201c6f3f2a0a90da40a13a905b86b874705f226a"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_fetch:1b6e4728fee631bc7a8a7006855c5b8182a8224579e32e3d0a2db77c26459f25"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_unpack:2ad74d6f865ef75c35c0e6bbe3f9a90923a6b2c62c18a3ddef514ea31fbc588f"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_deploy_source_date_epoch:15f89b8483c1ad7507480f337619bb98c26e231227785eb3543db163593e7b42"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_configure:7960c13d23270fdb12b3a7c426ce1da0d2f5c7cf5e5d3f5bdce5fa330eb7d482"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_compile:012e1d4a63f1a78fc2143bd90d704dbcf5865c5257d6272aa7540ec1cd3063d9"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_install:d3401cc2afa4c996beb154beaad3e45fa0272b9c56fb86e9db14ec3544c68f9d"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_build:fa88bb7afb9046c0417c24a3fa98a058653805a8b00eda2c2d7fea68fc42f882"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_collect_spdx_deps:cc9c53ba7c495567e9a38ec4801830c425c0d1f895aa2fc66930a2edd510d9b4"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_spdx:766a1d09368438b7b5a1a8e2a8f823b2b731db44b57e67d8b3196de91966f9c5"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_package_spdx:46f80faeab25575e9977ba3bf14c819489c3d489432ae5145255635108c21020"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_recipe_qa:cb960cdb074e7944e894958db58f3dc2a0436ecf87c247feb3e095e214fec0e4"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_lic:15657441621ee83f15c2e650e7edbb036870b56f55e72e046c6142da3c5783fd"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_manifest:24f0abbec221d27bbb2909b6e846288b12cab419f1faf9f5006ed80423d37e28"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_addto_recipe_sysroot:bcb6a1905f113128de3f88d702b706befd6a786267c045ee82532759a7c214d7"
+
documentation/dev-manual/index.rst +0 -0
index 9ccf60f7012ea344612298e77ebabed84ad6de3e..7afd0d820e94d56cb2145962b9b1a976c7951936 100644

documentation/dev-manual/index.rst Yocto Project Development Tasks Manual · line 53

Quoted 6 lines
documentation/dev-manual/index.rst +1 -0
@@ -48,5 +48,6 @@ Yocto Project Development Tasks Manual
    error-reporting-tool
    wayland
    qemu
+   bblock
 
 .. include:: /boilerplate.rst

Thanks!
Antonin

--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#13 lore raw

Re: [docs] [PATCH 5/5] dev-manual: add bblock documentation

Quoted 50 lines · Antonin Godard

Hi Julien,

Thanks for taking the time to document your tool!
On top of Ulrich's comments, here are my suggestions/corrections:

Quoted 15 lines · Julien Stephan

bblock is a helper tool to lock/unlock tasks and recipes to specific signatures. Add a documentation page for it.

---
 documentation/dev-manual/bblock.rst | 129 ++++++++++++++++++++++++++++++++++++
 documentation/dev-manual/index.rst  |   1 +
 2 files changed, 130 insertions(+)
documentation/dev-manual/bblock.rst new file +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..3df75799aa638d173764607df191bd99612034cf

documentation/dev-manual/bblock.rst line 7

Quoted 7 lines
documentation/dev-manual/bblock.rst new file +7 -0
@@ -0,0 +1,129 @@
+.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
+
+Locking and Unlocking Recipes Using ``bblock``
+**********************************************
+
+By design, the OpenEmbedded build system builds everything from scratch
+unless BitBake determines that specific parts do not require rebuilding.

s/parts/tasks/?

documentation/dev-manual/bblock.rst line 9

Quoted 2 lines
documentation/dev-manual/bblock.rst new file +2 -0
+At startup, it computes a signature for each tasks, based on the task's input.
+Then, it compares these signatures with the ones from sstate (if exist). Any

s/from sstate/from the sstate cache/?
s/if exist/if they exist/

Quoted 12 lines
documentation/dev-manual/bblock.rst new file +12 -0
+changes cause the task to rerun.
+
+During development, changes might trigger BitBake to rebuild certain
+recipes, even when we know they do not require rebuilding at that stage.
+For example, modifying a recipe can lead to the rebuilding of its native
+counterpart, which might proves unnecessary. Editing the ``python3`` recipe,
+for instance, can prompt BitBake to rebuild ``python3-native`` along with any
+recipes that depend on it.
+
+To prevent this, use ``bblock`` to lock specific tasks or recipes to
+specific signatures, forcing BitBake to use the sstate cache for them.
+
Quoted 8 lines

documentation/dev-manual/bblock.rst line 27

Quoted 6 lines
documentation/dev-manual/bblock.rst new file +6 -0
+.. attention::
+
+   Use ``bblock`` only during the development phase.
+
+   Forcing BitBake to use sstate cache, regardless of input changes, means
+   the recipe metadata no longer directly reflect the output. Use this feature

s/reflect/reflects/ unless metadata is a plural by default?

I tend to consider metadata plural by default. Maybe I'm wrong?

Quoted 28 lines

documentation/dev-manual/bblock.rst line 29

Quoted 3 lines
documentation/dev-manual/bblock.rst new file +2 -0
+   with caution. If you do not understand why signatures change, see the section
+   on `understanding what changed <https://wiki.yoctoproject.org/wiki/TipsAndTricks/Understanding_what_changed_(diffsigs_etc)>`__.

You can use :yocto_wiki: here:

:yocto_wiki:understanding what changed </TipsAndTricks/Understanding_what_changed_(diffsigs_etc)>.

(syntax needs double-checking ;))

documentation/dev-manual/bblock.rst line 43

Quoted 13 lines
documentation/dev-manual/bblock.rst new file +13 -0
+
+Locking tasks and recipes
+-------------------------
+
+To lock a recipe, use::
+
+   $ bblock recipe
+
+You can also use a space-separated list of recipes to lock many recipes::
+
+   $ bblock recipe1 recipe2
+
+Locking a recipe, means locking all tasks of the recipe. If you need to

No comma "," between recipe and means, I think.

documentation/dev-manual/bblock.rst line 44

Quoted 1 line
documentation/dev-manual/bblock.rst new file +1 -0
+lock only particular tasks use the `-t` switch with a comma-separated
Quoted 8 lines

Comma after "tasks" I think would make more sense here (to me at least).

documentation/dev-manual/bblock.rst line 48

Quoted 4 lines
documentation/dev-manual/bblock.rst new file +4 -0
+list of tasks::
+
+  $ bblock -t task1,task2 recipe
+

Maybe a real-life example would be great here!

I already put a real life example at the end. The idea was to avoid having an example in each section. Is it sufficient?

Quoted 8 lines

documentation/dev-manual/bblock.rst line 53

Quoted 5 lines
documentation/dev-manual/bblock.rst new file +4 -0
+Unlocking tasks and recipes
+---------------------------
+
+To unlock a recipe, use::

...use the ``-r`` option::

Quoted 6 lines

documentation/dev-manual/bblock.rst line 57

Quoted 4 lines
documentation/dev-manual/bblock.rst new file +4 -0
+
+   $ bblock -r recipe
+
+You can also use a space-separated list of recipes to unlock many recipes::

s/many/multiple/ (many means "a lot of")

Yeah.. I will put "multiple" back.. But according to Vale:

warning 'multiple' is too wordy.
write-good.TooWordy
warning 'several' is a weasel word!
write-good.Weasel

That's the reason why I put "many" ^^(but I agree it does not fit well here)

Quoted 23 lines
Quoted 10 lines
documentation/dev-manual/bblock.rst new file +9 -0
+
+   $ bblock -r recipe1 recipe2
+
+Unlocking a recipe, means unlocking all tasks of the recipe. If you need to
+unlock only particular tasks use the `-t` switch with a comma-separated
+list of tasks::
+
+  $ bblock -r -t task1,task2 recipe
+

documentation/dev-manual/bblock.rst line 76

Quoted 10 lines
documentation/dev-manual/bblock.rst new file +10 -0
+To unlock all recipes, do not specify any recipe::
+
+  $ bblock -r
+
+
+Configuration file
+------------------
+
+``bblock`` will dump the signatures in the ``build/conf/bblock.conf`` file,
+included by default in ``poky/meta/conf/bitbake.conf``.

Here you can use:

Quoted 8 lines

:oe_git:meta/conf/bitbake.conf </openembedded-core/tree/meta/conf/bitbake.conf>

Also, I believe that bblock.conf is a candidate for being in documentation/ref-manual/structure.rst, alongside local.conf and bblayers.conf in the section "The Build Directory --- ``build/``". Could you add a section there that explains this file briefly and that redirects the user to this document?

Sure!

Quoted 83 lines

documentation/dev-manual/bblock.rst line 76

Quoted 2 lines
documentation/dev-manual/bblock.rst new file +2 -0
+
+To dump it, use::

s/To dump it/To dump the file/

documentation/dev-manual/bblock.rst line 86

Quoted 8 lines
documentation/dev-manual/bblock.rst new file +8 -0
+
+  $ bblock -d
+
+
+Locking mechanism
+-----------------
+
+``bblock`` computes the signature(s) of the task(s) then uses the 3 following

s/then uses/and sets/? I.e. explain what it really does with them.

Quoted 7 lines
documentation/dev-manual/bblock.rst new file +7 -0
+variables: :term:`SIGGEN_LOCKEDSIGS`, :term:`SIGGEN_LOCKEDSIGS_TYPES`
+and :term:`SIGGEN_LOCKEDSIGS_TASKSIG_CHECK`.
+
+In particular, ``bblock`` sets::
+
+  SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
+  SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"

documentation/dev-manual/bblock.rst line 103

Quoted 10 lines
documentation/dev-manual/bblock.rst new file +10 -0
+
+  SIGGEN_LOCKEDSIGS_<package_arch> += "<recipe>:<task>:<signature>"
+
+This produces architecture specific locks and reminds user that some tasks
+have locked signatures.
+
+Example
+-------
+
+When working on ``python3`` recipe, we can lock ``pyton3-native`` with the

s/on ``python3`` recipe/on the ``python3`` recipe/ s/pyton3-native/python3-native/

Quoted 31 lines
documentation/dev-manual/bblock.rst new file +26 -0
+following::
+
+  $ bblock python3-native
+  $ bblock -d
+  # Generated by bblock
+  SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "info"
+  SIGGEN_LOCKEDSIGS_TYPES += "${PACKAGE_ARCHS}"
+
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_patch:865859c27e603ba42025b7bb766c3cd4c0f477e4962cfd39128c0619d695fce7"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_sysroot:f8fa5d3194cef638416000252b959e86d0a19f6b7898e1f56b643c588cdd8605"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_prepare_recipe_sysroot:fe295ac505d9d1143313424b201c6f3f2a0a90da40a13a905b86b874705f226a"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_fetch:1b6e4728fee631bc7a8a7006855c5b8182a8224579e32e3d0a2db77c26459f25"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_unpack:2ad74d6f865ef75c35c0e6bbe3f9a90923a6b2c62c18a3ddef514ea31fbc588f"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_deploy_source_date_epoch:15f89b8483c1ad7507480f337619bb98c26e231227785eb3543db163593e7b42"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_configure:7960c13d23270fdb12b3a7c426ce1da0d2f5c7cf5e5d3f5bdce5fa330eb7d482"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_compile:012e1d4a63f1a78fc2143bd90d704dbcf5865c5257d6272aa7540ec1cd3063d9"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_install:d3401cc2afa4c996beb154beaad3e45fa0272b9c56fb86e9db14ec3544c68f9d"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_build:fa88bb7afb9046c0417c24a3fa98a058653805a8b00eda2c2d7fea68fc42f882"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_collect_spdx_deps:cc9c53ba7c495567e9a38ec4801830c425c0d1f895aa2fc66930a2edd510d9b4"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_spdx:766a1d09368438b7b5a1a8e2a8f823b2b731db44b57e67d8b3196de91966f9c5"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_package_spdx:46f80faeab25575e9977ba3bf14c819489c3d489432ae5145255635108c21020"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_recipe_qa:cb960cdb074e7944e894958db58f3dc2a0436ecf87c247feb3e095e214fec0e4"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_populate_lic:15657441621ee83f15c2e650e7edbb036870b56f55e72e046c6142da3c5783fd"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_create_manifest:24f0abbec221d27bbb2909b6e846288b12cab419f1faf9f5006ed80423d37e28"
+  SIGGEN_LOCKEDSIGS_x86_64 += "python3-native:do_addto_recipe_sysroot:bcb6a1905f113128de3f88d702b706befd6a786267c045ee82532759a7c214d7"
+
documentation/dev-manual/index.rst +0 -0
index 9ccf60f7012ea344612298e77ebabed84ad6de3e..7afd0d820e94d56cb2145962b9b1a976c7951936 100644

documentation/dev-manual/index.rst Yocto Project Development Tasks Manual · line 53

Quoted 6 lines
documentation/dev-manual/index.rst +1 -0
@@ -48,5 +48,6 @@ Yocto Project Development Tasks Manual
    error-reporting-tool
    wayland
    qemu
+   bblock
 
 .. include:: /boilerplate.rst

Thanks!
Antonin

--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com