python / python/cpython

`test_compileall` failed in 2038 on 3.12 and 3.13

未關閉
#124,851 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

3.12 3.13 tests triaged type-bug
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

Bug report

Bug description:

While working on reproducible builds for openSUSE (sponsored by the NLnet NGI0 fund), I found that
our python312 package fails to build when the build runs in a VM with
qemu-kvm -rtc base=2038-01-20T00:00:00

# Add a code block here, if required
 ======================================================================
 FAIL: test_import (test.test_compileall.HardlinkDedupTestsNoSourceEpoch.test_import)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/abuild/rpmbuild/BUILD/Python-3.12.6/Lib/test/test_py_compile.py", line 22, in wrapper 
     return fxn(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^
   File "/home/abuild/rpmbuild/BUILD/Python-3.12.6/Lib/test/test_compileall.py", line 1114, in test_import
     self.assertFalse(is_hardlink(pycs[1], pycs[2]))
 AssertionError: True is not false

3.13 seems to not be affected by the issue in test_compileall.

The full log is at https://rb.zq1.de/other/python312-ftbfs2038.log.txt
(there are also some expiring SSL certs)

CPython versions tested on:

3.12

Operating systems tested on:

Linux

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

從第 1114 行附近的 Lib/test/test_compileall.py 中的 test_import 開始,使用報告中描述的 2038 VM 時鐘重現該失敗。比較 3.12 和 3.13 的行為,並檢查連結的 build log 以確認 hardlink 結果。在報告的環境下受影響的 compileall 測試通過即表示完成。

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

評估

技術堆疊
python
領域
build-system, testing-qa
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
35/100

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

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