Repository navigation
build: 钉定宿主 Python 3.12,libsqlite3-sys 翻回上游 build script - #165
Conversation
2a32ef4 to
079060a
Compare
… script - Add python-build-standalone cpython 3.12.14 DotSlash manifest (host-bin/python3) - src/buck2 resolves the pinned interpreter's absolute path and injects hctl2.python; also injects hctl2.cc/cxx/ar absolute compiler paths (os.execl in from_any_dir does not search PATH; /usr/bin xcrun shims keep SDK injection on macOS) - toolchains read the configs to override bare system toolchain names - libsqlite3-sys fixup: buildscript.run=true + cargo_env CARGO_MANIFEST_DIR + OPT_LEVEL=2 + rustc_link_lib/search; drop the hand-copied cxx_library (20 transcribed flags) and bindings genrule - Closes #157
079060a to
78667d6
Compare
任务书三追加「#165 核验」三项(钉定解释器正反例、供应链摘要逐平台核对、buildscript 与 C 编译 action 的缓存代价),#164 不核;状态板加 3.8 待开工,#157/#158 记为 GLM 以 #164/#165 关闭;GLM 留下的两个 buck2-prelude 上游 issue 待报项记入延后与遗留, 报告要点指向 python-build-standalone.md。 Claude-Session: https://claude.ai/code/session_01ECQQojBHRugVZZWstqqGUt Co-authored-by: Haibara AI <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
GLM 在 #165 留下的两项上游报告已以所有者身份提交:meta/buck2#1490(walk_up 需 Python ≥ 3.12 未声明,建议 os.path.relpath)、#1491(os.execl 不搜 PATH 与 path_clang_tools 裸名错配,建议 shutil.which / os.execvp)。研究文件文末追加复核记录, 写明上游合入后再评估撤掉启动器的绝对路径注入;状态板延后与遗留对应条目改为已报。 Claude-Session: https://claude.ai/code/session_01ECQQojBHRugVZZWstqqGUt Co-authored-by: Haibara AI <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
任务书三追加 · 对抗核验(Grok)对象:本 PR(钉定宿主 Python 3.12,翻回上游 build script)。测试在 #168,不另开文档。 结论:修正。 钉定解释器和供应链锁成立。需要改的是「已知代价」的形状,以及启动器在钉失效时的回落。不是把 #165 推倒。
不用另测的两项按任务书跳过:FTS5 / Online Backup 已由 #162 在三平台跑过;#164 只是研究文件复核记录。 |
…#168) * test(build): audit pinned host Python and fail closed on a broken pin 任务书三追加:核 #165 的钉定解释器、供应链锁与缓存代价。启动器在钉 失效时不再回落宿主 Python。结论写在 #165 评论。 * test(build): do not use PATH python3 inside the pin audit CI poisons PATH to prove the pin; the audit helpers must call /usr/bin/python3 so they are not the fake interpreter. --------- Co-authored-by: Haibara AI <[email protected]>
定位与重述
Issue #157:Buck2 2026-08-22 prelude 的 Cargo build-script C/C++ shim(from_any_dir.py)要求 Python ≥3.12(walk_up 参数),macOS 系统 Python 3.9.6 阻塞了 libsqlite3-sys 的上游 build script,仓库被迫手工复刻 20 个编译宏的 cxx_library 与 bindings 拷贝 genrule。本 PR 按所有者拍板(python-build-standalone 进供应链、钉死版本号)拆除该复刻:① 新增 cpython 3.12.14(20260901,install_only_stripped)三平台 DotSlash 清单;② src/buck2 启动器解析钉定解释器的绝对路径注入 hctl2.python config——实测证伪了 PATH 前置方案(Buck2 action 环境不含 PATH),也一并注入 hctl2.cc/cxx/ar 绝对编译器路径(from_any_dir 的 os.execl 不搜 PATH,裸名必然 ENOENT;macOS 取自动注 SDK 的 /usr/bin xcrun shim,Xcode.app 裸二进制缺 -isysroot 找不到 stdio.h——同趟证伪记录在研究文件);③ toolchains 读 config 覆盖 system 工具链裸名默认;④ libsqlite3-sys fixup 缩为 run=true + cargo_env(CARGO_MANIFEST_DIR,env! 编译期展开)+ OPT_LEVEL=2(cc-rs 运行期要求)+ rustc_link_lib/search(cargo:rustc-link-lib 翻译),删除全部手工复刻。编译宏回归 upstream build.rs,随版本升级不再漂移。本地 macOS arm64 验证:first-party 全套(139 命令)、foundation/tool 测试、docs 13 项、clippy、ShellCheck --severity=error 全绿;Linux x86_64 由 CI 矩阵验证。Closes #157。
当前生效约束集
业界方案调研
对象文件 docs/research/build-tools/python-build-standalone.md(本 PR 新增):python-build-standalone 为 uv/rye 生态事实标准的预编译 CPython 来源,三平台制品 + 官方 SHA-256;含两个被证伪中间方案(PATH 前置、xcrun 工具链裸二进制)与四个连环阻塞的实证记录(python 版本 / os.execl PATH / env! 展开 / OPT_LEVEL / link-lib 翻译);两项 prelude 上游问题待报告(walk_up 未声明最低版本、execl 与 system 工具链裸名错配,上游 main 2026-09-04 检查仍未修)。fixup 机制引用 reindeer MANUAL 与 proc-macro2 既有先例;#158 关联裁定见 docs/research/libs/sqlite-online-backup.md 复核记录(PR #164)。