Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating symbolic link during swift run on Windows #7965

Open
timsneath opened this issue Sep 4, 2024 · 5 comments
Open

Error creating symbolic link during swift run on Windows #7965

timsneath opened this issue Sep 4, 2024 · 5 comments
Assignees

Comments

@timsneath
Copy link

Description

On a Windows 11 machine, either swift build or swift run work the first time, but on repeated execution they report an error:

Build of product 'win32test' complete! (0.10s)
warning: unable to create symbolic link at C:\src\scratch.build\debug: Error Domain=NSCocoaErrorDomain Code=516 "A file with the same name already exists."

image

Reproduction

Run:

swift package init --type executable --name win32test
swift build
swift run

Expected behavior

Expected that repeated swift run invocations are idempotent.

Environment

Swift version 6.0-dev (LLVM c3efe9282719c35, Swift b163fed2b3101e0)
Target: aarch64-unknown-windows-msvc

Additional information

No response

@timsneath timsneath added the bug label Sep 4, 2024
@HeMet
Copy link

HeMet commented Sep 17, 2024

I have the same problem with release version of Swift 6.0 toolchain. Also it creates symlinks without "list content" permission.

@MaxDesiatov MaxDesiatov transferred this issue from swiftlang/swift Sep 17, 2024
@dschaefer2
Copy link
Member

From what I've seen so far these links aren't really used. You can access the build results using the toolchain triple and then debug/release.

But yes, disconcerting. It's on my list of Windows bugs to look at. Unfortunately there are a few more ahead of it.

I have the same problem with release version of Swift 6.0 toolchain. Also it creates symlinks without "list content" permission.

That's a good clue. Thanks!

@dschaefer2 dschaefer2 self-assigned this Sep 19, 2024
@dschaefer2
Copy link
Member

Digging into this now. This might be a bug in how swift-foundation is creating the symlink on Windows.

@dschaefer2
Copy link
Member

Yup, FileManager is incorrectly creating the link. Details here: apple/swift-foundation#928

I'll keep this open until we have it resolved. I can link it absolute but then it wouldn't allow the directory to be moved which might be OK, but let's see how that issue progresses.

@swat199538
Copy link

me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants