]> code.ossystems Code Review - openembedded-core.git/commit
classes/reproducible_build: Use atomic rename for SDE file
authorJoshua Watt <JPEWhacker@gmail.com>
Wed, 2 Jun 2021 02:36:48 +0000 (21:36 -0500)
committerSteve Sakoman <steve@sakoman.com>
Mon, 25 Oct 2021 23:28:19 +0000 (13:28 -1000)
commitb98d37da1554f524bd5b16287731d7b34945e92d
tree4632df33613394cdcbb9ce3c48e0e29572db2f2a
parent257eb2ee73831afe84600235c967cbb4c2627e26
classes/reproducible_build: Use atomic rename for SDE file

If an existing source date epoch file was found during do_unpack, it was
deleted and a new one would be written in its place. This causes a race
with check-before-use code in get_source_date_epoch_value. Resolve the
problem by making do_unpack write the new source date epoch to a
temporary file, then do an atomic rename to ensure it's always present,
and change the check-before-use code to use a EAFP exception instead of
checking for file existence.

[YOCTO #14384]

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0b5e3b33187bf78a2d62cc886463e4b27d6bd228)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/reproducible_build.bbclass