Skip to content

Error on build posixmodule.c in old Cygwin #149125

Description

@TrueCat17

Bug report

Bug description:

Line 253 includes the file cygwin/limits.h with the comment // Needed for XATTR_SIZE_MAX and XATTR_LIST_MAX.
But this only applies to new versions of Cygwin, i.e. after June 16, 2023, as far as I understand: git-for-windows/msys2-runtime@538b29a
In previous versions, such constants are simply missing, and accordingly, errors occur during compilation

I fixed it like this:

#    include <cygwin/limits.h>  // Needed for XATTR_SIZE_MAX and XATTR_LIST_MAX.
#    ifndef XATTR_SIZE_MAX
#      define XATTR_SIZE_MAX 65536
#    endif
#    ifndef XATTR_LIST_MAX
#      define XATTR_LIST_MAX 65536
#    endif

Everything works for me, however, I have not checked the accuracy of these limits
It’s even possible, in my case, that functions that use these constants are not called at all
However, I still fixed the building for myself this way

CPython version: 3.14.4
Cygwin 3.3.6-341 (win7 32-bit)

CPython versions tested on:

3.14

Operating systems tested on:

Windows

Linked PRs

Activity

  1. added
    buildThe build process and cross-build
    on Apr 29, 2026
  2. Shrey-N commented on Apr 30, 2026

    @Shrey-N
    Contributor

    Hi @TrueCat17,

    I have tested your patch and can confirm that it resolves the compilation error,

    Would you like to submit a PR for this? I am happy to assist if needed!

  3. TrueCat17 commented on Apr 30, 2026

    @TrueCat17
    Author

    @Shrey-N
    All that remains is to wait for the skip news label to be added to this PR

  4. TrueCat17 commented on May 6, 2026

    @TrueCat17
    Author

    @vstinner
    Could you take a look at this PR?

  5. vstinner commented on May 6, 2026

    @vstinner
    Member

    I never tried to build CPython on Cygwin. I failed to find Cygwin documentation https://devguide.python.org/ and https://docs.python.org/dev/. To review such change, I would to be able to build CPython myself. Where can I find documentation about how to build CPython on Cygwin?

    But this only applies to new versions of Cygwin, i.e. after June 16, 2023,

    CPython doesn't support Cygwin yet (see PEP 11). Is it really worth it to support old Cygwin versions?

  6. TrueCat17 commented on May 7, 2026

    @TrueCat17
    Author

    I'm building Python for win7 32-bit, this can only be done using the old Cygwin
    I don’t have the question “is it necessary?”, I only have “I need it”
    It doesn't matter to me whether this platform is officially supported, what matters to me is that it is actually supported
    There are a lot of references to Cygwin in the Python code; to support this platform there is a bunch of code that is included by the preprocessor or directly written in Python in the Lib folder

    BTW, you can look at the list of values ​​for sys.platform, for example:
    https://docs.python.org/dev/library/sys.html

    And the ONLY problem is the absence of 2 constants in this one file
    After fixing it, everything works exactly as it should (at least for me)
    I've sent out a PR that fixes this issue
    It does not affect other platforms - only Cygwin
    It does not even touch its new versions - only the old ones, which lack 2 necessary constants, this is directly checked

    So what's the problem with accepting this PR?
    What bad will happen from this?
    Have I done anything wrong?

  7. vstinner commented on May 13, 2026

    @vstinner
    Member

    So what's the problem with accepting this PR?

    I need step by step instructions on how to build Python with Cygwin if you want me to review this PR. I don't want to merge a PR if I cannot test it manually myself.

  8. TrueCat17 commented on May 13, 2026

    @TrueCat17
    Author

    I don't understand why this isn't obvious to you, but ok:

  9. vstinner commented on May 13, 2026

    @vstinner
    Member

    I tested Cygwin on Windows 11. Thanks, I managed to build Python with Cygwin following your instructions:

    • Download https://cygwin.com/setup-x86_64.exe
    • Run setup-x86_64.exe : select "gcc-core" and "make" packages.
    • Start Cygwin shell
    • Type: git config --global core.autocrlf input -- I had issues with newlines in the ./configure script without that.
    • Run git clone https://github.com/python/cpython/ --depth=1
    • Type: cd cpython
    • Type: ./configure --with-pydebug
    • Type: make -j8
  10. vstinner commented on May 15, 2026

    @vstinner
    Member

    Cygwin 3.3.6-341 (win7 32-bit)

    This version was released in September 2022: https://cygwin.com/pipermail/cygwin-announce/2022-September/010707.html

    It's the last version supporting 32-bit x86: https://cygwin.com/pipermail/cygwin-announce/2022-November/010777.html

    Right now, Cygwin is not supported by Python. Adding support for a legacy Cygwin version in Python doesn't sound like a good idea. I would prefer to focus first on 64-bit Windows which is supported by Cygwin. There are many issues which should be fixed first to support Cygwin in Python. I created gh-149879 meta issue for Cygwin.

    If you want to support Cygwin on 32-bit Python/Windows, you can maintain a patch or a CPython fork with your changes.

    For now, I prefer closing this PR. You're welcome to help fixing other issues in gh-149879 :-)

  11. TrueCat17 commented on May 16, 2026

    @TrueCat17
    Author

    To “add” this outdated platform, you need to add 6 lines of code that I have already written, which are guaranteed not to break anything on other platforms, and on this one too, since now the building generally fails
    In general, for the entire CPython project - just these 6 lines
    What's so difficult about this?

    I feel like I'm talking to a bot
    I sent a small fix that fixes everything, but time after time you tell me about an allegedly unsupported platform, which for some reason is mentioned dozens of times in the project

    If you want to support Cygwin on 32-bit Python/Windows, you can maintain a patch or a CPython fork with your changes.

    Thank you, damn it, for the permission

    Good luck with further sabotage, I've had enough of this nonsense
    I just hope that other people encountering these problems can find these cygwin-issues in the future if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-unsupportedbuildThe build process and cross-buildextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions