X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8269C3856617
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1685410704;
	bh=BtHso8kacmloSSXZlCkCeHyT2LIiJHuOSNYlDNcHfRs=;
	h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=owtitClA+O/cLcD6cW4N7S30vjr/J4ppT+HcR+aaSBVDi3lN+UQJn+ikFiiN7UldY
	 kWsZkyGMF0hXDQm67iaYG9b0Loj2SqihrpvPNIfrqLd7Lfdc1q3ndE8ndOxN6CK2Fc
	 VOsdlhe039Cov3md54g+6UrQx60iJRWIq46M+t7U=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E54143858C27
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1685410667; x=1688002667;
 h=content-transfer-encoding:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=UfGfR7GVbyGB8aPoW+44iY1lrGqIdFTCAG0tihGqfKU=;
 b=es/CcuMZaICdnLZcGAOtkpNMAkLqOwXHutrP4Eg44UyKSKuUqYleE6Bvw3elOXlYa9
 Nf7QxsmJFnj8n/5YXumuikYKEydZGT4yTP6IHqQQhZ+ZOq2TIeygM+sJQrk2BigR2uzr
 sXcwTtN3MG0SeSRrO3zKO9H3S3N3VbhXa/u3z2pDI7OQcow/vQGYmcv3oMWcaSw2SsPG
 NPYa1sEgNPcdANUEZPNQEJQ/5r7F+A318OywleR+w+KPjCNEgkx+bk3rW9MQIu8HzxZo
 wDrVgadY6iwncYhpMhg7l8NA1JPrxi5D+z1UwCpEBGUlE3/joK6YFgvwkIq2bk0q6V9k
 x0yg==
X-Gm-Message-State: AC+VfDxBvQlM3txH/kiuCLWC+iXFxe6xWS/82jwvIbc/Hf0Y3U38IGyZ
 95Gs+7EByNcwzBhsCoYJ7VobytaqS+6aRGC49HhujmhBtTM=
X-Google-Smtp-Source: ACHHUZ6RiSG3clKpoykBzCIaBaPmJqmgEpNn5zQySSYwHZCu/B0PnHxGuvwfkQlyybd0Bwzu6RqehfaY+ApIXHc7GDg=
X-Received: by 2002:a05:6a20:3cab:b0:103:377e:439e with SMTP id
 b43-20020a056a203cab00b00103377e439emr701037pzj.60.1685410666879; Mon, 29 May
 2023 18:37:46 -0700 (PDT)
MIME-Version: 1.0
References: <CAN+za=Oxko-2a2BMDYtt7ETATPS35Aez5+5zJsN8D6XJTPvXPw@mail.gmail.com>
In-Reply-To: <CAN+za=Oxko-2a2BMDYtt7ETATPS35Aez5+5zJsN8D6XJTPvXPw@mail.gmail.com>
Date: Tue, 30 May 2023 03:37:36 +0200
Message-ID: <CAN+za=Nr==L6trRMF0nvfigU238o0JJ_C2C5YbXbA_4gxA35zA@mail.gmail.com>
Subject: Re: set XATTR_SIZE_MAX and XATTR_LIST_MAX in cygwin/limits.h (was:
 python + XATTRs under cygwin?)
To: cygwin@cygwin.com
X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,
 SPF_HELO_NONE, SPF_PASS, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Philippe Cerfon via Cygwin <cygwin@cygwin.com>
Reply-To: Philippe Cerfon <philcerf@gmail.com>
Content-Type: text/plain; charset="utf-8"
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 34U1clEn030879

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.

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

