public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Philippe Cerfon <philcerf@gmail.com>
To: cygwin@cygwin.com
Subject: Re: set XATTR_SIZE_MAX and XATTR_LIST_MAX in cygwin/limits.h (was: python + XATTRs under cygwin?)
Date: Tue, 30 May 2023 03:37:36 +0200	[thread overview]
Message-ID: <CAN+za=Nr==L6trRMF0nvfigU238o0JJ_C2C5YbXbA_4gxA35zA@mail.gmail.com> (raw)
In-Reply-To: <CAN+za=Oxko-2a2BMDYtt7ETATPS35Aez5+5zJsN8D6XJTPvXPw@mail.gmail.com>

Hey.

I did some further tests as described in detail at
https://github.com/python/cpython/issues/90026#issuecomment-1567631574
and it turns out that Python's code would already support XATTRs on
Cygwin if the necessary defines were in place.

Currently, the most recent version of Python in cygwin is 3.9.9, which
uses the following check in cpython/Modules/posixmodule.c:
   #if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) &&
!defined(__FreeBSD_kernel__) && !defined(__GNU__)

in order to determine whether the XATTR code should be compiled or not.

In CPython’s master this was changed to:
   #if defined(HAVE_SYS_XATTR_H) && defined(__linux__) &&
!defined(__FreeBSD_kernel__) && !defined(__GNU__)

I plan on making a PR against CPython, which would also set the
necessary symbol, if __CYGWIN__ is defined.


There are however two problems:
1) Compilation then fails, as the code needs the symbols
XATTR_SIZE_MAX and XATTR_LIST_MAX, which on Linux are defined in
linux/limits.h as:
   #define XATTR_SIZE_MAX 65536    /* size of an extended attribute
value (64k) */
   #define XATTR_LIST_MAX 65536    /* size of extended attribute
namelist (64k) */

This would need to be added to cygwin/limits.h with whichever values
are proper for Cygwin (not sure how to find out?)


2) I guess the changes in CPython won't be backported (and it's not
even merged)... so Cygwin's Python maintainer will hopefully find the
time to package newer versions.
So there will probably quite some time, until it finally works in Python.


Anyway, whom can I ask or (1)?


Thanks,
Philippe.

  reply	other threads:[~2023-05-30  1:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 21:06 python + XATTRs under cygwin? Philippe Cerfon
2023-05-30  1:37 ` Philippe Cerfon [this message]
2023-05-30 11:28   ` set XATTR_SIZE_MAX and XATTR_LIST_MAX in cygwin/limits.h (was: python + XATTRs under cygwin?) Philippe Cerfon
2023-05-30 11:42     ` marco atzeri
2023-05-30 12:04       ` Philippe Cerfon
2023-12-22  4:45     ` set XATTR_SIZE_MAX and XATTR_LIST_MAX in cygwin/limits.h Marco Atzeri
2023-12-22 20:33       ` Philippe Cerfon
2023-12-23  3:56         ` Marco Atzeri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN+za=Nr==L6trRMF0nvfigU238o0JJ_C2C5YbXbA_4gxA35zA@mail.gmail.com' \
    --to=philcerf@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).