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-20 08:19:10 +0000 |
commit | c3c122466455ea4592d4bef2de2dd7163bc49c85 (patch) | |
tree | 6cf3e26cc67296d174a1afcb46163839c7de5b50 | |
parent | 01cafb753b314458215f8583e92cae407c2da10a (diff) | |
download | poky-c3c122466455ea4592d4bef2de2dd7163bc49c85.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: 8f852648fe730615c99bcdaace8a4748ef4e96a5)
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>
-rw-r--r-- | meta/classes/sanity.bbclass | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 37354af9d5..33e5e5952f 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -561,6 +561,14 @@ def check_tar_version(sanity_data): | |||
561 | version = result.split()[3] | 561 | version = result.split()[3] |
562 | if LooseVersion(version) < LooseVersion("1.28"): | 562 | if LooseVersion(version) < LooseVersion("1.28"): |
563 | 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" | 563 | 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" |
564 | |||
565 | try: | ||
566 | result = subprocess.check_output(["tar", "--help"], stderr=subprocess.STDOUT).decode('utf-8') | ||
567 | if "--xattrs" not in result: | ||
568 | return "Your tar doesn't support --xattrs, please use GNU tar.\n" | ||
569 | except subprocess.CalledProcessError as e: | ||
570 | return "Unable to execute tar --help, exit code %d\n%s\n" % (e.returncode, e.output) | ||
571 | |||
564 | return None | 572 | return None |
565 | 573 | ||
566 | # We use git parameters and functionality only found in 1.7.8 or later | 574 | # We use git parameters and functionality only found in 1.7.8 or later |