Skip to content

Fix Doctor launcher ownership for Windows pip installs - #9999

Open
cocolord wants to merge 2 commits into
mainfrom
codex/fix-windows-doctor-launcher-20261203
Open

cocolord wants to merge 2 commits into
mainfrom
codex/fix-windows-doctor-launcher-20261203

Conversation

@cocolord

@cocolord cocolord commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Problem

With the venv Scripts directory off PATH, invoking an installed loopx.exe doctor --installation-only --deep by absolute path fails to identify its launcher. pip’s Windows wrapper strips the executable suffix from sys.argv[0], so bare Core falls through to the generic CLI checks. Windows failure

Change

Recover the Windows launcher from the interpreter’s original arguments only when the path matches the normalized invocation. Doctor continues to verify it against the owning distribution’s RECORD. The regression covers matching and unrelated original paths.

Validation

  • The focused case reproduced the failure before the change. All 79 Doctor and installation tests passed after it.
  • Quick premerge, changed-file Ruff and bilingual RFC checks passed against main at 6248a6d50e.
  • The repaired nine-wheel assembly passed clean install, Deep Doctor, copied-launcher rejection, both CLI entry points and companion removal and restoration on macOS, Linux and native Windows. The first Windows run hit a sharing violation during fixture cleanup after both sets of assertions passed. The Windows-only rerun uses the same hash-verified artifact. First candidate run · Cleanup rerun
  • The full transport lint still reports the existing Feishu CLI violation on this base. Its separate fix is #9997.

The same-artifact Windows rerun passed runtime retirement and fixture cleanup.

Native Windows split-package follow-up

On native Windows x64, the exact #9646 head c045e12a71 still refused the absolute loopx.exe invocation with the venv Scripts directory off PATH. Applying this PR's 1e1c424f93 patch to that head restored both installed entry points, retained copied-launcher rejection, and passed all six individual companion removals and restorations on the same eight-wheel assembly. The two launcher normalization cases passed. Native Windows run

Review follow-up

Revision 44baee03d8 against main@0e784d7cba. The two-file Windows launcher patch is unchanged against current main. The Doctor source suites passed 73 cases, including matching and mismatched launcher records. Its separate composition with the current split-package Doctor also passed 46 freshness cases. Source and packaged-archive install plus the update smoke passed after preparing the checked-out Chat bundle before packaging. The native Windows evidence above applies to the unchanged patch on the earlier revision; the current composition was checked locally on macOS.

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

从 Windows 虚拟环境以绝对路径运行 loopx.exe doctor --installation-only --deep 的用户。 当 Scripts 不在 PATH 上时,缺少后缀的 argv[0] 让 Doctor 无法定位原启动器,包安装检查会误报启动器缺失。 相同 Windows 分支输入下,Doctor 找回已登记的启动器,实际 RECORD 校验由失败转为通过。 范围是找到本次安装诊断的 Windows 启动器,包归属与读取范围沿用原有检查。

改动思路 / Approach

范围是 Windows pip 启动器路径的识别与两项针对性回归。 在既有 launcher 选择器恢复一个经过路径匹配的输入,后续仍由原 RECORD 校验决定归属。 已识别的 launcher 进入既有诊断,实际认证与执行范围仍由当前包记录和 Doctor 所选模式约束。 Windows 复用本次解释器的原始参数并比较去掉后缀后的完整位置。

具体改动 / Changes

依据 docs/architecture/rfcs/monorepo-distribution-split-v0.md,基线 6248a6d50e8caf4089d40dd65907b95f95fbc7f7。已登记的 Windows 启动器 由缺失变为匹配。RECORD 归属隔离 由异路径及未登记副本覆盖。

对主干的风险 / Risks

macOS 上使用仿真的 Windows argv 和真实 RECORD 解析、路径比较。 不匹配的 orig_argv 保持无调用路径。恢复成功但未在 RECORD 登记的副本仍失败,带后缀与 POSIX 的行为成对保持。 6 项 quick premerge 直接检查和 3 项选定检查通过,另有 73 项 Doctor Python 测试通过。 本地选定检查包括真实 POSIX 安装、打包 Codex CLI 和升级 smoke。独立评审未在原生 Windows 上重跑安装器。 当前主干三方比较干净。

我的整体评价 / Verdict

批准。 这次修复拿回了同一次调用的绝对路径,独立对照确认 RECORD 仍拒绝无归属的副本。安装专用入口优先检查本次明确调用的启动器,PATH 搜索仅作后备。改动只涉及 CLI 安装诊断。

英文简短结论

English verdict: APPROVE at 1e1c424. The matching Windows launcher reaches the existing RECORD verification. Mismatched arguments and unrecorded copies remain rejected.

…lidate-9999-windows-doctor-current-main-20261204

Signed-off-by: lusendong.6789 <lusendong.6789@bytedance.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants