From 9bdb2db85487811ca90e5c08edbeb9dbc742f830 Mon Sep 17 00:00:00 2001 From: Michael Opdenacker Date: Tue, 19 Oct 2021 14:35:58 +0200 Subject: ref-manual: document "reproducible_build" class and SOURCE_DATE_EPOCH (From yocto-docs rev: ab6d3dbf57cac560b9b142cf5becf11d3edf09b7) Signed-off-by: Michael Opdenacker Signed-off-by: Richard Purdie --- documentation/migration-guides/migration-3.1.rst | 5 +++-- documentation/ref-manual/classes.rst | 12 ++++++++++++ documentation/ref-manual/variables.rst | 17 +++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'documentation') diff --git a/documentation/migration-guides/migration-3.1.rst b/documentation/migration-guides/migration-3.1.rst index 80b8f6baa5..a7614e5da4 100644 --- a/documentation/migration-guides/migration-3.1.rst +++ b/documentation/migration-guides/migration-3.1.rst @@ -55,8 +55,9 @@ Reproducible builds now enabled by default In order to avoid unnecessary differences in output files (aiding binary reproducibility), the Poky distribution configuration -(``DISTRO = "poky"``) now inherits the ``reproducible_build`` class by -default. +(``DISTRO = "poky"``) now inherits the +:ref:`reproducible-build ` class +by default. .. _migration-3.1-ptest-feature-impact: diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index 79af45ada5..381c5d1dd7 100644 --- a/documentation/ref-manual/classes.rst +++ b/documentation/ref-manual/classes.rst @@ -2209,6 +2209,18 @@ commit, and log. From the information, report files using a JSON format are created and stored in ``${``\ :term:`LOG_DIR`\ ``}/error-report``. +.. _ref-classes-reproducible-build: + +``reproducible_build.bbclass`` +============================== + +The ``reproducible_build.bbclass`` class enables +:ref:`test-manual/reproducible-builds:reproducible builds` by computing +a :term:`SOURCE_DATE_EPOCH` value in each component's build environment, so +that the build is independent from the time when the component was built. + +Poky inherits this class by default since version 3.1. + .. _ref-classes-rm-work: ``rm_work.bbclass`` diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index 9daf230a59..241d5aa2d5 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -6938,6 +6938,23 @@ system and gives an overview of their function and contents. You will see this variable referenced in the default values of ``FILES:${PN}-dev``. + :term:`SOURCE_DATE_EPOCH` + This defines a date expressed in number of seconds since + the UNIX EPOCH (01 Jan 1970 00:00:00 UTC), which is used by + multiple build systems to force a timestamp in built binaries. + Many upstream projects already support this variable. + + You will find more details in the `official specifications + `__. + + A value for each recipe is computed from the sources by + the :ref:`reproducible-build ` class. + + If a recipe wishes to override the default behavior, it should set its + own :term:`SOURCE_DATE_EPOCH` value:: + + SOURCE_DATE_EPOCH = "1613559011" + :term:`SOURCE_MIRROR_FETCH` When you are fetching files to create a mirror of sources (i.e. creating a source mirror), setting :term:`SOURCE_MIRROR_FETCH` to "1" in -- cgit v1.2.3-54-g00ecf