From 94b1a6686154dde3e224cfa66749a2228b82b4bf Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 12 Feb 2023 22:37:00 +0000 Subject: [PATCH 1/3] gh-101857: Allow xattr detection on musl libc Previously, we checked exclusively for __GLIBC__ (AND'd with some other conditions). Checking for __linux__ instead should be fine. This fixes using e.g. os.listxattr() on systems using musl libc. Bug: https://bugs.gentoo.org/894130 --- Modules/posixmodule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index cba6cea48b77e1..4114d840d6b2de 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -274,8 +274,9 @@ corresponding Unix manual entries for more information on calls."); # undef HAVE_SCHED_SETAFFINITY #endif -#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) +#if defined(HAVE_SYS_XATTR_H) && defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) # define USE_XATTRS +# include #endif #ifdef USE_XATTRS From 3befbeca6d20e9b7e4fa182b0e4f00c377daa44c Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sun, 12 Feb 2023 22:40:23 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2023-02-12-22-40-22.gh-issue-101857._bribG.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-02-12-22-40-22.gh-issue-101857._bribG.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-02-12-22-40-22.gh-issue-101857._bribG.rst b/Misc/NEWS.d/next/Core and Builtins/2023-02-12-22-40-22.gh-issue-101857._bribG.rst new file mode 100644 index 00000000000000..832cc300fa9433 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-02-12-22-40-22.gh-issue-101857._bribG.rst @@ -0,0 +1 @@ +Fix xattr support detection on Linux systems by widening the check to linux, not just glibc. This fixes support for musl. From a70af15beef13c5f30bc4eef98c5c640e6383ae4 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Mon, 13 Feb 2023 20:17:33 -0800 Subject: [PATCH 3/3] add a comment to the linux/limits.h include for future reference w/o digging up this PR comment thread. --- Modules/posixmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 4114d840d6b2de..d9e93473aeadaa 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -276,7 +276,7 @@ corresponding Unix manual entries for more information on calls."); #if defined(HAVE_SYS_XATTR_H) && defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) # define USE_XATTRS -# include +# include // Needed for XATTR_SIZE_MAX on musl libc. #endif #ifdef USE_XATTRS