fix: remap junction targets across short/long and verbatim paths - #5
Merged
rootkiller6788 merged 1 commit intoSep 12, 2026
Merged
Conversation
…im paths copy_tree copies with robocopy /XJ and then restore_junctions recreates pnpm-style junctions so the runtime is self-contained. remap_target used Path::strip_prefix on the raw read_link() result against the src we walked. On GitHub Actions windows runners those two forms disagree — temp is often an 8.3 short name (C:\Users\RUNNER~1\...) while read_link returns the long name (C:\Users\runneradmin\...), and junctions can also come back with a \\?\ verbatim prefix. strip_prefix then fails, the junction is recreated pointing at the source tree, and the self- containment contract silently breaks. That is what failed Gate 1 on main: copy_tree_recreates_junctions_without_following. Normalize src, dst, and each junction target through canonicalize + verbatim-strip before comparing, and assert on normalized paths in the regression test. Also pin three unit tests for strip_verbatim_prefix and remap_target.
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.
Why
After #4 merged, main CI Gate 1 (
cargo test) failed:restore_junctions/remap_targetcompared the rawread_link()target to thesrcpath withPath::strip_prefix. On GitHub Actions windows runners those forms disagree (8.3RUNNER~1vs longrunneradmin, and sometimes\\?\verbatim prefixes), so remapping silently failed and junctions were recreated pointing at the source tree — breaking the self-containment contract the copy is supposed to provide.What
normalize_path/strip_verbatim_prefix: canonicalize + drop\\?\/ UNC-verbatimrestore_junctions: walk and remap using normalizedsrc/dstremap_target: normalize the junction target beforestrip_prefixstrip_verbatim_prefixandremap_targetHow tested
Refs the failing run: https://github.com/rootkiller6788/dsh-launcher/actions/runs/34673817501