diff options
author | Ross Burton <ross.burton@arm.com> | 2022-10-28 16:23:53 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-14 15:59:15 +0000 |
commit | d8917f76bc2a39be523fa9232ee2c3bdb1cc53b9 (patch) | |
tree | a50ee48bf6e22e925b54e32a923ffde1ef6a5d48 /meta | |
parent | d5add7c5b7d5c04e0b3240dece4e104f73ee32a4 (diff) | |
download | poky-d8917f76bc2a39be523fa9232ee2c3bdb1cc53b9.tar.gz |
sanity: check for GNU tar specifically
We need the system tar to be GNU tar, as we reply on --xattrs. Some
distributions may be using libarchive's tar binary, which is definitely
not as featureful, so check for this and abort early with a clear
message instead of later with mysterious errors.
(From OE-Core rev: fd92cdc6d2b9b3b808503b3274860a7c301587cb)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 7dd2b1cd1bb10e67485dab8600c0787df6c2eee7)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes-global/sanity.bbclass | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index 15067e78d3..606444cae1 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass | |||
@@ -504,6 +504,14 @@ def check_tar_version(sanity_data): | |||
504 | version = result.split()[3] | 504 | version = result.split()[3] |
505 | if bb.utils.vercmp_string_op(version, "1.28", "<"): | 505 | if bb.utils.vercmp_string_op(version, "1.28", "<"): |
506 | return "Your version of tar is older than 1.28 and does not have the support needed to enable reproducible builds. Please install a newer version of tar (you could use the project's buildtools-tarball from our last release or use scripts/install-buildtools).\n" | 506 | return "Your version of tar is older than 1.28 and does not have the support needed to enable reproducible builds. Please install a newer version of tar (you could use the project's buildtools-tarball from our last release or use scripts/install-buildtools).\n" |
507 | |||
508 | try: | ||
509 | result = subprocess.check_output(["tar", "--help"], stderr=subprocess.STDOUT).decode('utf-8') | ||
510 | if "--xattrs" not in result: | ||
511 | return "Your tar doesn't support --xattrs, please use GNU tar.\n" | ||
512 | except subprocess.CalledProcessError as e: | ||
513 | return "Unable to execute tar --help, exit code %d\n%s\n" % (e.returncode, e.output) | ||
514 | |||
507 | return None | 515 | return None |
508 | 516 | ||
509 | # We use git parameters and functionality only found in 1.7.8 or later | 517 | # We use git parameters and functionality only found in 1.7.8 or later |