GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Modules/termios.c: stop using TC operations that need termio.h by tpetazzoni · Pull Request #142326 · python/cpython

Conversation

@tpetazzoni

@tpetazzoni tpetazzoni commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Modules/termios.c makes use of TCGETA, TCSETA, TCSETAF and TCSETAW if they are defined. They are defined by kernel headers on a limited set of CPU architectures, but require the "struct termio" definition to exist, and this structure definition has been removed from glibc as of version 2.42.

Since these are seldomly used, we take the approach of just dropping support for those, in order to fix the following build issue:

./Modules/termios.c:1119:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'
1119 | {"TCGETA", TCGETA},
| ^~~~~~
./Modules/termios.c:1131:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'
1131 | {"TCSETA", TCSETA},
| ^~~~~~
./Modules/termios.c:1134:17: error: invalid application of 'sizeof' to incomplete type 'struct termio'
1134 | {"TCSETAF", TCSETAF},
| ^~~~~~~
./Modules/termios.c:1137:17: error: invalid application of 'sizeof' to incomplete type 'struct termio'
1137 | {"TCSETAW", TCSETAW},
| ^~~~~~~
make[1]: *** [Makefile:3403: Modules/termios.o] Error 1

This issue is observed at least on sparc64, but not on more "mainstream" CPU architectures, as they do not define TCGETA/TCSETA/TCSETAF/TCSETAW.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tpetazzoni
Modules/termios.c: stop using TC operations that need termio.h
fca8833
Modules/termios.c makes use of TCGETA, TCSETA, TCSETAF and TCSETAW if
they are defined. They are defined by kernel headers on a limited set
of CPU architectures, but require the "struct termio" definition to
exist, and this structure definition has been removed from glibc as of
version 2.42.

Since these are seldomly used, we take the approach of just dropping
support for those, in order to fix the following build issue:

./Modules/termios.c:1119:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'
 1119 |     {"TCGETA", TCGETA},
      |                ^~~~~~
./Modules/termios.c:1131:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'
 1131 |     {"TCSETA", TCSETA},
      |                ^~~~~~
./Modules/termios.c:1134:17: error: invalid application of 'sizeof' to incomplete type 'struct termio'
 1134 |     {"TCSETAF", TCSETAF},
      |                 ^~~~~~~
./Modules/termios.c:1137:17: error: invalid application of 'sizeof' to incomplete type 'struct termio'
 1137 |     {"TCSETAW", TCSETAW},
      |                 ^~~~~~~
make[1]: *** [Makefile:3403: Modules/termios.o] Error 1

This issue is observed at least on sparc64, but not on more
"mainstream" CPU architectures, as they do not define
TCGETA/TCSETA/TCSETAF/TCSETAW.

Signed-off-by: Thomas Petazzoni <[email protected]>
@python-cla-bot

python-cla-bot Bot commented Dec 5, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting review label Dec 5, 2025
@picnixz

picnixz commented Dec 5, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Please:

  • sign the CLA
  • open an issue for this change
  • change the fix: I think we should instead detect during configure whether those macros are correct or not.
StanFromIreland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thesamesam

thesamesam commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

This is actually a bug in linux-headers. We hit it in Gentoo and I sent patches upstream for the affected arches (https://bugs.gentoo.org/962600). The issue is that those types_are_ still declared, just unusable, for certain arches.

hppa is fixed already, alpha has the patch queued, sparc I've not had a reply for yet. But it will take a while for such fixes to propagate, so CPython may still wish to implement a workaround.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tpetazzoni

tpetazzoni commented Dec 7, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the very useful feedback! I've opened a new PR at #142380 to track this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tpetazzoni tpetazzoni closed this Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@tpetazzoni @picnixz @thesamesam
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.