macOS: Test availability for dup3() and pipe2() to prevent crashes when building against Xcode 27
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
Crash report
What happened?
This year's Apple OS releases (macOS/iOS/tvOS/watchOS/visionOS 27) add support for dup3() and pipe2(). When building for macOS using Xcode 27 beta but running on macOS 26, configure detects these functions, but Python crashes when it tries to use them. As a temporary fix, I'm passing ac_cv_func_dup3=no ac_cv_func_pipe2=no to configure. The real fix will be to use availability checks in Modules/posixmodule.c for dup3() and pipe2(), like gh-97897 does
Prototypes added to sys/unistd.h in the *27 SDK:
__API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), watchos(27.0), visionos(27.0))
int dup3(int, int, int);
__API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), watchos(27.0), visionos(27.0))
int pipe2(int [2], int);
@ned-deily @ronaldoussoren
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Output from running 'python -VV' on the command line:
No response
Linked PRs
- gh-154718
- gh-155174
- gh-155202
- gh-155206
- gh-155211
- gh-155222
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
阅读 Modules/posixmodule.c 和 gh-97897 中的可用性检查先例,然后复现报告中描述的 Xcode 27/macOS 26 configure 和 build 场景。当针对较新的 SDK 进行构建、但在较旧的 macOS 版本上运行时,dup3() 和 pipe2() 能够得到安全处理,并且相关的 build 或 runtime 检查通过,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- c, macos, python
- 领域
- build-system, operating-systems
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 25/100