how to build gnu-tar with support for extended attributes #4394
Unanswered
codeskipper
asked this question in
Writing Formulae/Casks
Replies: 1 comment 4 replies
-
Use BSD tar. Trying to get it to work with GNU tar seems like a pretty deep rabbit hole. BSD tar is packaged with macOS, but also comes with the However, if you're in the mood to go spelunking, reading these might be a start: |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Output of
brew config
Output of
brew doctor
Description of issue
When running the regular bottled gnu-tar with option
--xattrs
(to store/retrieve extended attributes inside an archive) I get a warning/usr/local/bin/gtar: XATTR support is not available
.After extracting from the resulting archive (also with with
--xattrs
argument, and the same warning) the extended attributes from the original file(s) are not present on the extracted file(s).As an example, I just downloaded a Firefox installer, and I can see it has some extended attributes:
When running
/usr/local/bin/gtar
with --xattr I get the warning about the missing feature:The use-case for this feature is to enable caching between Autopkg runs in a CI pipeline (GitHub Action). See actions/cache#777
In the source code for GNU tar, I can see we need a compiler flag
HAVE_XATTRS
. https://git.savannah.gnu.org/cgit/tar.git/tree/src/xattrs.c?h=release_1_34#n473After some research, I tried to edit the formula to include
--with-xattrs
in the build arguments forconfigure
. This runs OK, and I can see in the config.log a compiler flagHAVE_SYS_XATTR_H
is now being set.But
HAVE_XATTRS
is not set, and the resultinggtar
still gives the same results.From https://git.savannah.gnu.org/cgit/tar.git/tree/acinclude.m4#n49 my understanding is
HAVE_XATTRS
will be set only if all the listed functions are found, and I guess I'm missing the header files that declare those functions.Any tips on how to find what dependencies I need to add to the formula to cover the developer kits that seem to be missing?
Also, I tried the gnutar package from MacPorts, and it has the same issue. I guess it could be fixed "upstream" for both, but where might that be?
Beta Was this translation helpful? Give feedback.
All reactions