Skip to content

Include of linux/limits.h breaks build on Linux <5.1 #106881

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

Closed
indygreg opened this issue Jul 19, 2023 · 3 comments
Closed

Include of linux/limits.h breaks build on Linux <5.1 #106881

indygreg opened this issue Jul 19, 2023 · 3 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@indygreg
Copy link
Contributor

indygreg commented Jul 19, 2023

Bug report

#101857 / #101858 added an #include <linux/limits.h> on Linux in Modules/posixmodule.c.

If my Linux Git history sleuthing is accurate (git log -- include/linux/limits.h), linux/limits.h only exists in Linux <3.10 and >5.1. (Yes, the file was removed then re-added.) Attempting to compile CPython against Linux headers 3.10-5.0 fails due to the missing file.

cc @thesamesam (commit author) @gpshead (reviewer)

Linked PRs

@indygreg indygreg added the type-bug An unexpected behavior, bug, or error label Jul 19, 2023
@indygreg indygreg changed the title linux/limits.h unconditionally included and breaks build on Linux <5.1 Include of linux/limits.h breaks build on Linux <5.1 Jul 19, 2023
indygreg added a commit to astral-sh/python-build-standalone that referenced this issue Jul 19, 2023
Upstream backported a patch related to musl which breaks the build on
Linux <5.1. So we have to apply a revert to keep the build green. This
has been reported upstream at
python/cpython#106881.
@gpshead gpshead self-assigned this Jul 19, 2023
@gpshead
Copy link
Member

gpshead commented Jul 19, 2023

the joys of headers. I suppose an additional configure.ac check can handle this.

@thesamesam
Copy link
Contributor

Typical! Happy to look if you don't get a chance.

@justdan6
Copy link
Contributor

This looked like an easy first issue for me so I hope you don't mind that I grabbed it.

gpshead pushed a commit that referenced this issue Jul 28, 2023
* Check for linux/limits.h before including it

Co-authored-by: Erlend E. Aasland <[email protected]>
justdan6 added a commit to justdan6/cpython that referenced this issue Jul 28, 2023
…ython#107397)

* Check for linux/limits.h before including it

Co-authored-by: Erlend E. Aasland <[email protected]>
(cherry picked from commit 11c055f)
gpshead pushed a commit that referenced this issue Jul 28, 2023
…) (#107414)

* Check for linux/limits.h before including it

Co-authored-by: Erlend E. Aasland <[email protected]>
(cherry picked from commit 11c055f)
gpshead pushed a commit that referenced this issue Jul 28, 2023
…) (#107415)

* [3.11] gh-106881: Check for linux/limits.h before including it (#107397)

* Check for linux/limits.h before including it

Co-authored-by: Erlend E. Aasland <[email protected]>
(cherry picked from commit 11c055f)

* Fix sphinx-lint error in NEWS entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants