-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-90026: support XATTRs on Cygwin #105075
Conversation
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
For the records: |
64c24cd
to
6a20c9c
Compare
Updated commit also changes the documentation in What I didn't know (Python experts please help ;-) ) was, whether there is a way how you encode that this will be only available with |
Just for the records: The commit that exports the necessary symbols in Cygwin has just been merged. So future versions of Cygwin’s Would be awesome if this could be reviewed and still make it into 3.13 at least (not sure if a backport would be feasible - guess it’s probably not important enough ^^). |
Sorry I don't know anything about Cygwin and I'm working on a Mac. |
Maybe one should also adapt: Lines 3741 to 3742 in 8571b27
OTOH, these functions are still "defined" by Linux (FreeBSD and others use different syscalls)... and Cygwin just mimics them. So it may also be justified to let the section named as is. |
Anything I can do to get that reviewed? :-) |
6a20c9c
to
22e5277
Compare
Rebased on But, TBH, I'm not really sure whether it's worth keeping this MR open, as it seems impossible to get even such an extremely simple change reviewed :-( |
22e5277
to
6ef91aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@philcerf The code looks reasonable to me. I'm not a Cygwin user though.
@encukou Would you be able to give this a look? Thanks. Discourse discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with adding the #ifdef
change -- it's a few lines clearly identified as Cygwin-only.
But I'm less sure about the docs update. It suggests that XATTRs will continue to work on Cygwin, but we have no tests to ensure this.
Would you be OK merging without the docs change?
You could also find wording for the docs that doesn't say this strongly that XATTRs are Linux specific -- but IMO it'd again be better to add that to a dedicated “CPython on Cygwin” page (outside CPython).
I'll post more about process on the Discourse discussion.
I'd be okay with a commit without any docs changes (@JelleZijlstra would that be also okay for you, since you've proposed adding the minimum Cygwin version). May make even sense, cause I guess we don't document all other things that work or don't work with Cygwin - and I think that is reasonable as Cygwin is a compatibility layer, so what they support from the API is purely their business. I had only added it previously, as strictly speaking Cygwin is a POSIX compatibility layer, whereas the API used for the XATTR is Linux specific. |
6ef91aa
to
9ce8c50
Compare
Yes, that's fine with me. If we document it, we should mention the CPython version when the change was made, but Petr's suggestion to omit it from the public docs also makes sense. (Minor feedback: It's generally better to avoid force pushing. We'll squash merge anyway when we merge the PR, and it's easier to follow the review history if there are no force pushes.) |
No idea why that one test failed. Edit: Ah, now the tests ran through. |
Thank you for the contribution! |
Thanks for merging. Is it feasible to get this backported? Though it's really not that important, if too much of an effort. |
I think this counts as a new feature, which we don't backport. However, if you're building from source, you can obviously apply the patch yourself. |
As described in #90026 (comment) and following comments, CPython’s code for XATTRs seems to already support Cygwin… mostly.
Apart from the changes made by this PR (simply compiling the relevant code), there are however also some changes needed on the Cygwin side (I guess):
Namely, they don't export
XATTR_SIZE_MAX
andXATTR_LIST_MAX
and so a build of CPython with this commit would fail right now.I've asked at their mailing list to have them included in their
cygwin/limits.h
(which I think is the proper place - Linux defines them inlinux/limits.h
): https://cygwin.com/pipermail/cygwin/2023-May/253750.htmlRight now, he newest Version of CPython in Cygwin is 3.9.9... so unless I can get this change backported, they won't be affected by this (well and even if, ... it would be some more "motivation" to set the missing defines, I guess ;-) ).
I could of course also check whether the symbols are defined, as in:
I found that to be a bit ugly and overkill,... but if Python developers like it more... I wouldn’t mind to adapt my commit.
Thanks