Commit Graph

11 Commits

Author SHA1 Message Date
Benoît Mauduit
4c8d17088f lib/oe/reproducible: Use git log without gpg signature
Previously, if "showSignature" is present in user gitconfig, parsing
of the timestamp will fail.

Ideally we should replace this command with a git plumbing command.

(From OE-Core rev: 3bd6f78f79b3d3e87d8db1e11f58d8021f929843)

Signed-off-by: Benoît Mauduit <bmauduit@beneth.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-13 17:32:46 +00:00
Richard Purdie
ce08cf4825 lib: Add copyright statements to files without one
Where there isn't a copyright statement, add one to make it explicit.
Also add license identifiers as MIT if there isn't one.

(From OE-Core rev: bb731d1f3d2a1d50ec0aed864dbca54cf795b040)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 12:00:43 +01:00
Richard Purdie
b890bca84d base/reproducible: Change Source Date Epoch generation methods
In bc, we found that there are files newer than Changelog (e.g. scan.l)
which means after install runs, the timestamp is clamped to SDE which means
"bitbake bc -C compile" would then try and regenerate generated files and
complain flex was missing.

Rather than assuming Changelog/NEWS are magic for dates, drop that scan
method and scan all unpacked files. This shouldn't be that slow as they'd
be in the disk cache already after an unpack.

For bc, this changes SDE by about two minutes and avoids the problems
rebuilding.

Add a version comment to the task definition as changes in python library
code won't trigger a rebuild and we need one here.

(From OE-Core rev: 32dda0ad91a9e7946351c897578b4c97ae142341)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-23 13:55:26 +01:00
Alexander Kanavin
51a8e28fe0 lib/oe/reproducible: correctly set .git location when recursively looking for git repos
(From OE-Core rev: ffdaa1a0527691d66dd28e86bd015bfad7a020f6)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-05 17:18:15 +00:00
Richard Purdie
4b424bdfdb reproducible: Merge code into base.bbclass
Reproducibility is here to stay and needs to be part of our default workflow.
Move the remaining code to base.bbclass so it is always a first class citizen
and it is clear people need to be mindful of it.

(From OE-Core rev: abb0671d2cebfd7e8df94796404bbe9c7f961058)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-16 17:41:59 +01:00
Richard Purdie
a28891c779 reproducible: Move class function code into library
To try and avoid parse/memory overhead of functions within bitbake,
move the bulk of the reproducibility functions to the function library.

(From OE-Core rev: f2fd1c9d75e774c8a5271cdc1ec6f65c4492f941)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-16 17:41:59 +01:00
Richard Purdie
c4baddc0d0 reproducible: Improve SOURCE_DATE_EPOCH_FALLBACK handling
Ensure the fallback value if used is written to the SDE file
and hence stored in sstate, reducing any confusion within the
code over '0' values.

Bump the HASHEQUIV_VERSION since we've had a ton of trouble
with ensuring this rolls out correctly on the autobuilder so
others may too, take a clean slate for it.

(From OE-Core rev: 53ffffa32b76330835287dfc05d4e4796841af08)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-24 00:19:38 +00:00
Alexander Kanavin
9b534f334d meta/lib/oe/reproducible.py: gitsm:// works just as fine as git:// for timestamps
This in particular addresses vulkan-samples reproducibility which made me scratch my
head for a while.

(From OE-Core rev: 4a2936126f12eeacecced051fa339c32c1f16576)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-09 12:20:33 +00:00
Joshua Watt
20e9df5721 lib/oe/reproducible.py: Fix git HEAD check
The check for a git HEAD still wasn't quite correct because it was using
the .git directory as the current working directory. Instead, it should
be passed as the --git-dir argument when running git. Running `git
rev-parse HEAD` in a .git directory with no HEAD reports 'HEAD' and
exits with success but then 'git log' will fail, which is not what we
want.

(From OE-Core rev: cdbd47dd7e1657b91b65a0940b7cbf119764240f)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-29 11:37:31 +01:00
Joshua Watt
5843460575 lib/oe/reproducible: Fix error when no git HEAD
Fixes an error that occurs when attempting to get the timestamp of the
latest commit when there is no HEAD in the git repository. The easiest
way to trigger this condition is to use the 'subdir=' option when
specifying a 'git://' SRC_URI.

(From OE-Core rev: a64caca5b5dbe4a76acd0b5709b2c3e75b245863)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-22 12:45:56 +01:00
Joshua Watt
ebb40b027c classes/reproducible: Move to library code
Moves most of the python code used for dealing with the source date
epoch to library code.

(From OE-Core rev: a7ede90955bc0c8bec1cbb3cab498ef2583b2f4e)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-22 12:45:56 +01:00