Skip to content

SwiftBuild: add scratch path symbolic links#9972

Draft
bkhouri wants to merge 1 commit intoswiftlang:mainfrom
bkhouri:t/main/gh9963_rdar175144467_preserve_symlinks
Draft

SwiftBuild: add scratch path symbolic links#9972
bkhouri wants to merge 1 commit intoswiftlang:mainfrom
bkhouri:t/main/gh9963_rdar175144467_preserve_symlinks

Conversation

@bkhouri
Copy link
Copy Markdown
Contributor

@bkhouri bkhouri commented Apr 21, 2026

The native build system would create the debug and release symbolic link in the scratch path as they were the original output location before triple support was added.

Although this is not an officially support feature, add the debug and release symbolic links when using Swift Build to ease the transition until a better solution is avaiable.

Fixes: #9963
Issue: rdar://175144467

Merge with: swiftlang/sourcekit-lsp#2620 (passed) or with swiftlang/sourcekit-lsp#2621 (testing in progress)

@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 21, 2026

@swift-ci test

@bkhouri bkhouri marked this pull request as ready for review April 21, 2026 18:27
@bkhouri bkhouri force-pushed the t/main/gh9963_rdar175144467_preserve_symlinks branch from dfb458b to 32ad9aa Compare April 21, 2026 18:47
@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 21, 2026

@swift-ci test

@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 21, 2026

@swift-ci test windows

@bkhouri bkhouri marked this pull request as draft April 21, 2026 23:20
@bkhouri bkhouri force-pushed the t/main/gh9963_rdar175144467_preserve_symlinks branch from 32ad9aa to 7439fdd Compare April 21, 2026 23:22
@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 21, 2026

@swift-ci test

Comment thread Sources/SwiftBuildSupport/SwiftBuildSystem.swift Outdated
Comment thread Sources/SwiftBuildSupport/SwiftBuildSystem.swift Outdated
@bkhouri bkhouri force-pushed the t/main/gh9963_rdar175144467_preserve_symlinks branch from 7439fdd to 1914e8d Compare April 22, 2026 13:58
@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 22, 2026

@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 22, 2026

swiftlang/sourcekit-lsp#2616

@swift-ci test windows

@bkhouri bkhouri marked this pull request as ready for review April 22, 2026 14:04
@dschaefer2
Copy link
Copy Markdown
Member

My first thought is that it would be nice to do this outside the build system. Show bin path works right from the command state and you have everything you need there. It's just looks awkward having to pass in the scratch path directory all the way down just to create the link.

But that's more a code cleanliness thing.

@dschaefer2
Copy link
Copy Markdown
Member

That said buildSystem.build is called from all over the place in SwiftPM so that may be hard to do.

Copy link
Copy Markdown
Contributor

@plemarquand plemarquand left a comment

Choose a reason for hiding this comment

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

Can you add some tests to validate this new behaviour?

Comment thread Sources/SwiftBuildSupport/SwiftBuildSystem.swift Outdated
Comment thread Sources/SwiftBuildSupport/SwiftBuildSystem.swift Outdated
@bkhouri bkhouri force-pushed the t/main/gh9963_rdar175144467_preserve_symlinks branch from 1914e8d to 71cc845 Compare April 23, 2026 04:27
@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 23, 2026

@swift-ci test

@bkhouri bkhouri force-pushed the t/main/gh9963_rdar175144467_preserve_symlinks branch from 71cc845 to c4bdb31 Compare April 23, 2026 04:42
@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 23, 2026

@swift-ci test

@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 23, 2026

@swift-ci test windows

@bkhouri bkhouri requested review from owenv and plemarquand April 23, 2026 04:43
The native build system would create the `debug` and `release` symbolic
link in the scratch path as they were the original output location before
triple support was added.

Although this is not an officially support feature, add the `debug` and
`release` symbolic links when using Swift Build to ease the transition
until a better solution is avaiable.

Relates to: swiftlang#9963
Issue: rdar://175144467
@bkhouri bkhouri force-pushed the t/main/gh9963_rdar175144467_preserve_symlinks branch from c4bdb31 to 6b7a3ab Compare April 23, 2026 12:20
@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 23, 2026

@swift-ci test

@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 23, 2026

@swift-ci test windows

@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 24, 2026

@bkhouri
Copy link
Copy Markdown
Contributor Author

bkhouri commented Apr 25, 2026

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.

[Parity] Preserve .build/release and .build/debug symlinks in swiftbuild

4 participants