diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-14 12:26:30 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-16 17:41:59 +0100 |
commit | f47a396964c4de76838f8c59b8226625817aa369 (patch) | |
tree | a4f0cfdbc8143b2a4f0be3df4808124e4e4faa95 /meta | |
parent | a28891c779fa85818a1572abfa8450e5930c01ca (diff) | |
download | poky-f47a396964c4de76838f8c59b8226625817aa369.tar.gz |
reproducible: Move variable definitions to bitbake.conf
The reproducibility code was originally developed as separate
standalone class but development is no longer experimental and
the code is widely tested and used by default for poky. Reproducible
builds are the direction we need to take as a project.
Transition the core variable definitions to bitbake.conf as part of
a move to make these part of the default workflow.
This also helps reduce test matrix complexity as there is now one
code path.
(From OE-Core rev: f38a8de19550ae216575b5b39163666f74b07e2d)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/reproducible_build.bbclass | 11 | ||||
-rw-r--r-- | meta/classes/reproducible_build_simple.bbclass | 9 | ||||
-rw-r--r-- | meta/conf/bitbake.conf | 19 |
3 files changed, 18 insertions, 21 deletions
diff --git a/meta/classes/reproducible_build.bbclass b/meta/classes/reproducible_build.bbclass index 0f45b782e5..f38be1a765 100644 --- a/meta/classes/reproducible_build.bbclass +++ b/meta/classes/reproducible_build.bbclass | |||
@@ -51,15 +51,6 @@ | |||
51 | # | 51 | # |
52 | # Once the value is determined, it is stored in the recipe's SDE_FILE. | 52 | # Once the value is determined, it is stored in the recipe's SDE_FILE. |
53 | 53 | ||
54 | BUILD_REPRODUCIBLE_BINARIES ??= '1' | ||
55 | inherit reproducible_build_simple | ||
56 | |||
57 | SDE_DIR = "${WORKDIR}/source-date-epoch" | ||
58 | SDE_FILE = "${SDE_DIR}/__source_date_epoch.txt" | ||
59 | SDE_DEPLOYDIR = "${WORKDIR}/deploy-source-date-epoch" | ||
60 | |||
61 | # A SOURCE_DATE_EPOCH of '0' might be misinterpreted as no SDE | ||
62 | export SOURCE_DATE_EPOCH_FALLBACK ??= "1302044400" | ||
63 | 54 | ||
64 | SSTATETASKS += "do_deploy_source_date_epoch" | 55 | SSTATETASKS += "do_deploy_source_date_epoch" |
65 | 56 | ||
@@ -103,5 +94,3 @@ do_unpack[postfuncs] += "create_source_date_epoch_stamp" | |||
103 | def get_source_date_epoch_value(d): | 94 | def get_source_date_epoch_value(d): |
104 | return oe.reproducible.epochfile_read(d.getVar('SDE_FILE'), d) | 95 | return oe.reproducible.epochfile_read(d.getVar('SDE_FILE'), d) |
105 | 96 | ||
106 | export SOURCE_DATE_EPOCH ?= "${@get_source_date_epoch_value(d)}" | ||
107 | BB_HASHBASE_WHITELIST += "SOURCE_DATE_EPOCH" | ||
diff --git a/meta/classes/reproducible_build_simple.bbclass b/meta/classes/reproducible_build_simple.bbclass deleted file mode 100644 index 393372993d..0000000000 --- a/meta/classes/reproducible_build_simple.bbclass +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | # Setup default environment for reproducible builds. | ||
2 | |||
3 | BUILD_REPRODUCIBLE_BINARIES = "1" | ||
4 | |||
5 | export PYTHONHASHSEED = "0" | ||
6 | export PERL_HASH_SEED = "0" | ||
7 | export SOURCE_DATE_EPOCH ??= "1520598896" | ||
8 | |||
9 | REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896" | ||
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index cd828251b9..1db9b3fc05 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -629,6 +629,22 @@ BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g -feliminate-unu | |||
629 | BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD" | 629 | BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD" |
630 | 630 | ||
631 | ################################################################## | 631 | ################################################################## |
632 | # Reproducibility | ||
633 | ################################################################## | ||
634 | |||
635 | SDE_DIR = "${WORKDIR}/source-date-epoch" | ||
636 | SDE_FILE = "${SDE_DIR}/__source_date_epoch.txt" | ||
637 | SDE_DEPLOYDIR = "${WORKDIR}/deploy-source-date-epoch" | ||
638 | |||
639 | BUILD_REPRODUCIBLE_BINARIES = "1" | ||
640 | export PYTHONHASHSEED = "0" | ||
641 | export PERL_HASH_SEED = "0" | ||
642 | export SOURCE_DATE_EPOCH ?= "${@get_source_date_epoch_value(d)}" | ||
643 | # A SOURCE_DATE_EPOCH of '0' might be misinterpreted as no SDE | ||
644 | export SOURCE_DATE_EPOCH_FALLBACK ??= "1302044400" | ||
645 | REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896" | ||
646 | |||
647 | ################################################################## | ||
632 | # Settings used by bitbake-layers. | 648 | # Settings used by bitbake-layers. |
633 | ################################################################## | 649 | ################################################################## |
634 | BBLAYERS_LAYERINDEX_URL ??= "https://layers.openembedded.org/layerindex/" | 650 | BBLAYERS_LAYERINDEX_URL ??= "https://layers.openembedded.org/layerindex/" |
@@ -908,7 +924,8 @@ BB_HASHEXCLUDE_COMMON ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH BBSERVER DL_DI | |||
908 | SSTATE_HASHEQUIV_METHOD SSTATE_HASHEQUIV_REPORT_TASKDATA \ | 924 | SSTATE_HASHEQUIV_METHOD SSTATE_HASHEQUIV_REPORT_TASKDATA \ |
909 | SSTATE_HASHEQUIV_OWNER CCACHE_TOP_DIR BB_HASHSERVE GIT_CEILING_DIRECTORIES \ | 925 | SSTATE_HASHEQUIV_OWNER CCACHE_TOP_DIR BB_HASHSERVE GIT_CEILING_DIRECTORIES \ |
910 | OMP_NUM_THREADS BB_CURRENTTASK" | 926 | OMP_NUM_THREADS BB_CURRENTTASK" |
911 | BB_HASHBASE_WHITELIST ?= "${BB_HASHEXCLUDE_COMMON} PSEUDO_IGNORE_PATHS BUILDHISTORY_DIR SSTATE_DIR " | 927 | BB_HASHBASE_WHITELIST ?= "${BB_HASHEXCLUDE_COMMON} PSEUDO_IGNORE_PATHS BUILDHISTORY_DIR \ |
928 | SSTATE_DIR SOURCE_DATE_EPOCH" | ||
912 | BB_HASHCONFIG_WHITELIST ?= "${BB_HASHEXCLUDE_COMMON} DATE TIME SSH_AGENT_PID \ | 929 | BB_HASHCONFIG_WHITELIST ?= "${BB_HASHEXCLUDE_COMMON} DATE TIME SSH_AGENT_PID \ |
913 | SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_EXTRAWHITE DISABLE_SANITY_CHECKS \ | 930 | SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_EXTRAWHITE DISABLE_SANITY_CHECKS \ |
914 | PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \ | 931 | PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \ |