summaryrefslogtreecommitdiffstats
path: root/meta/classes-global/sanity.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2022-10-28 16:23:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-10-29 16:28:36 +0100
commit05de18eae7217f8a75922538eac6933a11634afa (patch)
tree25f4be8579b49ae8857afe6ef6198206d947266b /meta/classes-global/sanity.bbclass
parentb06633b6ae91132f444a15a7f11dd778f01d5b6f (diff)
downloadpoky-05de18eae7217f8a75922538eac6933a11634afa.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: 7dd2b1cd1bb10e67485dab8600c0787df6c2eee7) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global/sanity.bbclass')
-rw-r--r--meta/classes-global/sanity.bbclass8
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