python / python/cpython

TCGETA, TCSETA, TCSETAF, TCSETAW termios ioctl no longer usable on all architectures with glibc 2.42

未關閉
#142,379 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

build extension-modules OS-linux OS-unsupported type-bug
主要語言
Python
星號
77.2k
分支
35.9k
PR 合併指標
PR 指標待擷取

描述

Bug report

Bug description:

The build of cpython is broken with glibc 2.42 on at least the alpha, hppa and sparc64 architectures, as reported for example on Gentoo: https://bugs.gentoo.org/962600, but also affecting Buildroot: https://autobuild.buildroot.net/results/e7d/e7d951b06e9338e622fe96b0fb02823b1ef5235c/build-end.log. The build failure looks like this:

./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},
      |                 ^~~~~~~

The problem is that on those architectures, ioctls.h reference "struct termio", which has been removed from glibc 2.42. https://lists.gnu.org/archive/html/info-gnu/2025-07/msg00011.html.

While the issue is being fixed in the upstream Linux kernel, it will take time for those fixes to propagate, and a fix in Python would be relevant. PR coming.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs
  • gh-142380

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 Modules/termios.c 中 TCGETA、TCSETA、TCSETAF 和 TCSETAW 項目附近開始,檢查 glibc 2.42 在 alpha、hppa 和 sparc64 上的失敗。如果可能,重現受影響的建置;當 CPython 能夠在這些架構上成功建置,且沒有不完整 struct termio 錯誤時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
c, linux, python
領域
build-system, operating-systems
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
20/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。