]> 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)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 3 Jun 2021 22:09:18 +0000 (23:09 +0100)
commit0b5e3b33187bf78a2d62cc886463e4b27d6bd228
tree308a7f31b1a5f5025b3d97f3851d572673574926
parenta634a0555d000d93a23890b68e54f06370f0a97e
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>
meta/classes/reproducible_build.bbclass