When running ./runtests on a system with app-alternatives/tar[libarchive], I get: ``` testSimple (portage.tests.emerge.test_simple.SimpleEmergeTestCase) ... xpak ... tar: Option --xattrs-include=* is not supported Usage: List: tar -tf <archive-filename> Extract: tar -xf <archive-filename> Create: tar -cf <archive-filename> [filenames...] Help: tar --help !!! Error Extracting 'None', pid 563197 crashed or killed, exitcode -13 Calculating dependencies ... done! Dependency resolution took 0.01 s. >>> Running pre-merge checks for dev-libs/B-1 >>> Running pre-merge checks for dev-libs/A-1 * called pkg_pretend for dev-libs/A-1 >>> Emerging binary (1 of 2) dev-libs/B-1::test_repo for /tmp/portage.runtests.urc7bfrf/tmpi38106a4/cross_root/tmp/portage.runtests.urc7bfrf/tmpi38106a4/ >>> Extracting info >>> Extracting dev-libs/B-1 >>> Failed to emerge dev-libs/B-1 for /tmp/portage.runtests.urc7bfrf/tmpi38106a4/cross_root/tmp/portage.runtests.urc7bfrf/tmpi38106a4/, Log file: >>> '/tmp/portage.runtests.urc7bfrf/tmpi38106a4/var/tmp/portage/dev-libs:B-1:20230320-041956.log' FAIL ```
$ grep -rsin -- --xattrs-include lib/_emerge/BinpkgExtractorAsync.py:48: tar_options = ["--xattrs", "--xattrs-include='*'"] grep: lib/_emerge/__pycache__/BinpkgExtractorAsync.cpython-39.pyc: binary file matches lib/portage/dbapi/vartree.py:1094: tar_cmd = ("tar", "-x", "--xattrs", "--xattrs-include=*", "-C", dest_dir)
--xattrs is supported by bsdtar. --xattrs-include isn't, though there is a feature request for it. [0] I couldn't find the definitive reference, but as far as I can tell, bsdtar's --xattrs does mean "all extended attribute". That would make --xattrs-include redundant. I would feel more confident if this were explicitly stated in the man page for example. > lib/_emerge/BinpkgExtractorAsync.py:48: tar_options = ["--xattrs", "--xattrs-include='*'"] This one is preceeded by "if --xattrs in (tar --help).stdout" (pseudocode). bsdtar's help is very brief, so portage misses that bsdtar actually supports xattrs. I guess portage could do without that check and just assume that every version of tar supports xattrs? Alternatively, the same check could be repurposed to distinguish between gtar and bsdtar, but... ew. That's a big too hacky. Using os.path.realpath() and shutil.which() could also help distinguish gtar from bsdtar.