Skip to content

Conversation

@fortmarek
Copy link
Contributor

@fortmarek fortmarek commented Nov 24, 2025

The move() method was using exists(sourcePath) which follows symlinks by default. This caused failures when moving a symlink whose target had already been moved, because it would try to follow the symlink to validate the target exists.

Now it uses exists(sourcePath, followSymlink: false) to check if the symlink itself exists, allowing symlinks to be moved even if their targets have been relocated.

This fixes an issue where extracting package archives with symlinks could fail if files were moved in alphabetical order and a target file was moved before its symlink as described in: swiftlang/swift-package-manager#9411

…e existence

The move() method was using exists(sourcePath) which follows symlinks by default.
This caused failures when moving a symlink whose target had already been moved,
because it would try to follow the symlink to validate the target exists.

Now uses exists(sourcePath, followSymlink: false) to check if the symlink itself
exists, allowing symlinks to be moved even if their targets have been relocated.

This fixes an issue where extracting package archives with symlinks could fail
if files were moved in alphabetical order and a target file was moved before
its symlink.

Added test testMoveSymlinkWithMovedTarget() to verify this behavior.
@owenv
Copy link
Contributor

owenv commented Dec 1, 2025

@swift-ci test

@owenv owenv enabled auto-merge (squash) December 1, 2025 19:39
@fortmarek
Copy link
Contributor Author

Thanks for the review @owenv! The only test failing on Windows is:

FAIL: Swift(windows-x86_64) :: Constraints/warn_long_compile.swift (1610 of 12191)
******************** TEST 'Swift(windows-x86_64) :: Constraints/warn_long_compile.swift' FAILED ********************

I don't see this test in the codebase and I don't see how it is related to the changes. Is it possible the failure is a flake?

@compnerd
Copy link
Member

compnerd commented Dec 2, 2025

@swift-ci please test Windows platform

@owenv owenv merged commit 84d81b7 into swiftlang:main Dec 2, 2025
146 of 150 checks passed
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.

4 participants