Repository navigation
test(launcher): 无符号链接特权时回退 junction,修复 Windows 普通权限下测试必挂 - #2389
Open
leiming2333 wants to merge 1 commit into
Open
leiming2333 wants to merge 1 commit into
leiming2333 wants to merge 1 commit into
Conversation
Windows 上创建目录软链需要开发者模式或管理员权限,普通权限的机器上 symlink_dir 返回错误 1314(客户端没有所需的特权),该测试直接失败。 GitHub CI 的 runner 以管理员运行所以未暴露。 junction 与软链同为 reparse point,canonicalize 解析行为一致: symlink_dir 失败时用 mklink /J 建 junction,被测的链接解析逻辑不变, 测试在无特权机器上也能跑出真实结果(dream_skin_library 已用跳过 处理同类问题,此处跳过会失去链接解析的覆盖,故改为回退)。
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
app_paths_resolves_portable_current_link_to_directory_version在无特权的 Windows 机器上必定失败:Windows 创建目录软链需要开发者模式或管理员权限(
SeCreateSymbolicLinkPrivilege)。GitHub CI 的 runner 以管理员运行,所以 CI 未暴露;贡献者在普通权限的本机跑cargo test -p codex-plus-core会直接挂掉这个测试。修复
symlink_dir失败时回退到 junction(cmd /c mklink /J,无需任何特权):std::fs::canonicalize的解析行为一致,被测的「current链接解析出目录版本号」逻辑完全不变;dream_skin_library对同类问题用的是「失败即跳过」,这里跳过会丢掉链接解析的唯一覆盖,故改为回退)。测试
cargo test -p codex-plus-core --test launcher portable_current_link:修复前报 1314 失败,修复后通过(走 junction 路径)。cargo test -p codex-plus-core全套 0 失败。