If the Gentoo repository (i.e. /var/db/repos/gentoo) is on a filesystem without xattr support, emerging packages like net-mail/mailbase or app-arch/tar fails on hardened (i.e. default/linux/amd64/17.1/no-multilib/hardened), due to install-xattr failing to retrieve the extended attributes of certain files: install-xattr: listxattr() failed: Operation not supported According to strace: listxattr("/var/tmp/portage/net-mail/mailbase-1.5-r2/files/mailcap.5", NULL, 0) = -1 EOPNOTSUPP (Operation not supported) where /var/tmp/portage/net-mail/mailbase-1.5-r2/files is actually a symlink to /var/db/repos/gentoo/net-mail/mailbase/files during the merge. During debugging this I wasted quite a lot of time trying to figure out what is wrong with the xattr support on my /var/tmp/portage/ filesystem (which does have xattr support) before I found that the FILESDIR was actually a symlink to the other filesystem. Please add support for repositories on filesystems without xattr or provide better diagnostics. Should extended attributes from files residing on different filesystems than ${PORTAGE_BUILDDIR} at all be considered for copying? Thanks!
*** Bug 931675 has been marked as a duplicate of this bug. ***
Created attachment 895998 [details, diff] 0001-install-xattr-do-to-fail-if-source-filesystem-does-n.patch Attached patch should fix this.
Needs something similar xlistattr(), which is causing emerging linux-firmware to fail. This handles both: --- install-xattr/install-xattr.c 2024-08-18 21:52:42.316666599 -0400 +++ install-xattr/install-xattr.c 2024-08-18 22:02:32.773333234 -0400 @@ -24,6 +24,7 @@ #include <stdlib.h> #include <string.h> #include <err.h> +#include <errno.h> #include <fnmatch.h> #include <ctype.h> #include <getopt.h> @@ -80,6 +81,7 @@ xlistxattr(const char *path, char *list, size_t size) { ssize_t ret = listxattr(path, list, size); + if (ret < 0 && errno == ENOTSUP) ret=0; if (ret < 0) err(1, "listxattr() failed"); return ret; @@ -89,6 +91,7 @@ xgetxattr(const char *path, char *list, char *value, size_t size) { ssize_t ret = getxattr(path, list, value, size); + if (ret < 0 && errno == ENOTSUP) ret=0; if (ret < 0) err(1, "getxattr() failed"); return ret;
(In reply to Mark G. Woodruff from comment #3) > Needs something similar xlistattr(), which is causing emerging > linux-firmware to fail. This handles both: > > --- install-xattr/install-xattr.c 2024-08-18 21:52:42.316666599 -0400 > +++ install-xattr/install-xattr.c 2024-08-18 22:02:32.773333234 -0400 > @@ -24,6 +24,7 @@ > #include <stdlib.h> > #include <string.h> > #include <err.h> > +#include <errno.h> > #include <fnmatch.h> > #include <ctype.h> > #include <getopt.h> > @@ -80,6 +81,7 @@ > xlistxattr(const char *path, char *list, size_t size) > { > ssize_t ret = listxattr(path, list, size); > + if (ret < 0 && errno == ENOTSUP) ret=0; > if (ret < 0) > err(1, "listxattr() failed"); > return ret; > @@ -89,6 +91,7 @@ > xgetxattr(const char *path, char *list, char *value, size_t size) > { > ssize_t ret = getxattr(path, list, value, size); > + if (ret < 0 && errno == ENOTSUP) ret=0; > if (ret < 0) > err(1, "getxattr() failed"); > return ret; Confirming this patch was required for me as well, to build sysvinit-3.09
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/elfix.git/commit/?id=9aae65c00064cfd661736998402ec21ede5acfbb commit 9aae65c00064cfd661736998402ec21ede5acfbb Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2025-04-19 18:19:02 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2025-04-19 18:19:02 +0000 install-xattr: do not fail when listxattr returns ENOTSUP Bug: https://bugs.gentoo.org/769359 Signed-off-by: Mike Gilbert <floppym@gentoo.org> misc/install-xattr/install-xattr.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74987fc66ccd1a8e1a598e669daefb1a579b4db2 commit 74987fc66ccd1a8e1a598e669daefb1a579b4db2 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2025-04-19 18:55:13 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2025-04-19 18:57:27 +0000 sys-apps/install-xattr: add 0.9 Closes: https://bugs.gentoo.org/769359 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-apps/install-xattr/Manifest | 1 + sys-apps/install-xattr/install-xattr-0.9.ebuild | 41 ++++++++++++++++++++++++ sys-apps/install-xattr/install-xattr-9999.ebuild | 12 ++----- 3 files changed, 45 insertions(+), 9 deletions(-)