Skip to content

Conversation

hnrklssn
Copy link
Contributor

Turns out this Package.swift file was borked all along.

Swift packages are normally in Sources/<target-name>, but SwiftifyImportMacro is in Sources/SwiftMacros, and SwiftifyImport is in <root>/stdlib/public/core, which is outside the package root. This sets the correct path for SwiftifyImportMacro, and creates a directory Sources/PublicCorePortal with a symlink to SwiftifyImport.swift. It also enables LifetimeDependence for SwiftifyImport.

These changes are purely to provide information to SourceKit - this file isn't actually used by CMake.

Swift packages are normally in `Sources/<target-name>`, but
SwiftifyImportMacro is in `Sources/SwiftMacros`, and SwiftifyImport is
in `<root>/stdlib/public/core`, which is outside the package root. This
sets the correct path for SwiftifyImportMacro, and creates a directory
`Sources/PublicCorePortal` with a symlink to `SwiftifyImport.swift`.
It also enables LifetimeDependence for SwiftifyImport.

These changes are purely to provide information to SourceKit - this file
isn't actually used by CMake.
@hnrklssn
Copy link
Contributor Author

@swift-ci please smoke test

@@ -0,0 +1 @@
../../../../stdlib/public/core/SwiftifyImport.swift No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this would work on Windows, given that symlinks are somewhat special there. Given that Package.swift isn't used in the actual build, I don't think that's a priority though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do symlinks work on Windows?

@hnrklssn hnrklssn merged commit 41903b5 into swiftlang:main Oct 13, 2025
3 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.

3 participants