From 2d00d94189f145c91ad1f1978293316c1ae580c6 Mon Sep 17 00:00:00 2001 From: "Henrik G. Olsson" Date: Fri, 10 Oct 2025 16:52:24 -0700 Subject: [PATCH] [Swiftify] Fix Package.swift Swift packages are normally in `Sources/`, but SwiftifyImportMacro is in `Sources/SwiftMacros`, and SwiftifyImport is in `/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. --- lib/Macros/Package.swift | 9 ++++++--- lib/Macros/Sources/PublicCorePortal/SwiftifyImport.swift | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) create mode 120000 lib/Macros/Sources/PublicCorePortal/SwiftifyImport.swift diff --git a/lib/Macros/Package.swift b/lib/Macros/Package.swift index b673dbdf709c..443cdeaaf007 100644 --- a/lib/Macros/Package.swift +++ b/lib/Macros/Package.swift @@ -35,12 +35,15 @@ let package = Package( .product(name: "SwiftParser", package: "swift-syntax"), .product(name: "SwiftSyntax", package: "swift-syntax"), .product(name: "SwiftSyntaxBuilder", package: "swift-syntax"), - .product(name: "SwiftSyntaxMacro", package: "swift-syntax") - ] + .product(name: "SwiftSyntaxMacros", package: "swift-syntax") + ], + path: "Sources/SwiftMacros", ), .target( name: "SwiftifyImport", - dependencies: ["SwiftifyImportMacro"] + dependencies: ["SwiftifyImportMacro"], + path: "Sources/PublicCorePortal", + swiftSettings: [.enableExperimentalFeature("LifetimeDependence")], ) ] ) diff --git a/lib/Macros/Sources/PublicCorePortal/SwiftifyImport.swift b/lib/Macros/Sources/PublicCorePortal/SwiftifyImport.swift new file mode 120000 index 000000000000..2a812e1b5d6b --- /dev/null +++ b/lib/Macros/Sources/PublicCorePortal/SwiftifyImport.swift @@ -0,0 +1 @@ +../../../../stdlib/public/core/SwiftifyImport.swift \ No newline at end of file