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:17 +0000 |
| commit | 28787fba96d9b60bf491ae032b15d19ae0aeb6da (patch) | |
| tree | fd6ebd423799a335dbfc0a6866debe844134b45e /meta/classes/sanity.bbclass | |
| parent | ed2c45964e06bb138ca94c1fd7ede3443e9f7d6e (diff) | |
| download | poky-28787fba96d9b60bf491ae032b15d19ae0aeb6da.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: 238993097826461a0f8bc2545c9383d8cfc0beea)
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/classes/sanity.bbclass')
| -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 5c97effb96..f2b2e4dfaf 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
| @@ -498,6 +498,14 @@ def check_tar_version(sanity_data): | |||
| 498 | version = result.split()[3] | 498 | version = result.split()[3] |
| 499 | if bb.utils.vercmp_string_op(version, "1.28", "<"): | 499 | if bb.utils.vercmp_string_op(version, "1.28", "<"): |
| 500 | 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" | 500 | 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" |
| 501 | |||
| 502 | try: | ||
| 503 | result = subprocess.check_output(["tar", "--help"], stderr=subprocess.STDOUT).decode('utf-8') | ||
| 504 | if "--xattrs" not in result: | ||
| 505 | return "Your tar doesn't support --xattrs, please use GNU tar.\n" | ||
| 506 | except subprocess.CalledProcessError as e: | ||
| 507 | return "Unable to execute tar --help, exit code %d\n%s\n" % (e.returncode, e.output) | ||
| 508 | |||
| 501 | return None | 509 | return None |
| 502 | 510 | ||
| 503 | # We use git parameters and functionality only found in 1.7.8 or later | 511 | # We use git parameters and functionality only found in 1.7.8 or later |
