diff --git a/Dependencies.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Dependencies.xcworkspace/xcshareddata/swiftpm/Package.resolved index 99565fde..aff2bb62 100644 --- a/Dependencies.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Dependencies.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -9,24 +9,6 @@ "version" : "1.0.0" } }, - { - "identity" : "swift-argument-parser", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser", - "state" : { - "revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b", - "version" : "1.4.0" - } - }, - { - "identity" : "swift-benchmark", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/swift-benchmark", - "state" : { - "revision" : "8163295f6fe82356b0bcf8e1ab991645de17d096", - "version" : "0.1.2" - } - }, { "identity" : "swift-clocks", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index bb136607..0a775eb3 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,6 @@ -// swift-tools-version: 5.7.1 +// swift-tools-version: 5.9 +import CompilerPluginSupport import PackageDescription let package = Package( @@ -14,16 +15,26 @@ let package = Package( .library( name: "Dependencies", targets: ["Dependencies"] - ) + ), + .library( + name: "DependenciesMacros", + targets: ["DependenciesMacros"] + ), ], dependencies: [ - .package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"), + .package(url: "https://github.com/apple/swift-syntax", "509.0.0"..<"601.0.0"), .package(url: "https://github.com/pointfreeco/combine-schedulers", from: "1.0.0"), .package(url: "https://github.com/pointfreeco/swift-clocks", from: "1.0.0"), .package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.0.0"), .package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.1.0"), ], targets: [ + .target( + name: "DependenciesTestObserver", + dependencies: [ + .product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"), + ] + ), .target( name: "Dependencies", dependencies: [ @@ -36,22 +47,63 @@ let package = Package( .testTarget( name: "DependenciesTests", dependencies: [ - "Dependencies" + "Dependencies", + "DependenciesMacros", ] ), - .executableTarget( - name: "swift-dependencies-benchmark", + .target( + name: "DependenciesMacros", dependencies: [ - "Dependencies", - .product(name: "Benchmark", package: "swift-benchmark"), + "DependenciesMacrosPlugin", + .product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"), + ] + ), + .macro( + name: "DependenciesMacrosPlugin", + dependencies: [ + .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), + .product(name: "SwiftCompilerPlugin", package: "swift-syntax"), ] ), ] ) +#if !os(macOS) && !os(WASI) + package.products.append( + .library( + name: "DependenciesTestObserver", + type: .dynamic, + targets: ["DependenciesTestObserver"] + ) + ) +#endif + +#if !os(WASI) + package.dependencies.append( + .package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0") + ) + package.targets.append(contentsOf: [ + .testTarget( + name: "DependenciesMacrosPluginTests", + dependencies: [ + "DependenciesMacros", + "DependenciesMacrosPlugin", + .product(name: "MacroTesting", package: "swift-macro-testing"), + ] + ), + ]) +#endif + #if !os(Windows) // Add the documentation compiler plugin if possible package.dependencies.append( .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0") ) #endif + +for target in package.targets { + target.swiftSettings = target.swiftSettings ?? [] + target.swiftSettings?.append(contentsOf: [ + .enableExperimentalFeature("StrictConcurrency") + ]) +} diff --git a/Package@swift-5.9.swift b/Package@swift-6.0.swift similarity index 82% rename from Package@swift-5.9.swift rename to Package@swift-6.0.swift index 5a3ff2a6..c5ae32d1 100644 --- a/Package@swift-5.9.swift +++ b/Package@swift-6.0.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import CompilerPluginSupport import PackageDescription @@ -23,7 +23,6 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/apple/swift-syntax", "509.0.0"..<"601.0.0"), - .package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"), .package(url: "https://github.com/pointfreeco/combine-schedulers", from: "1.0.0"), .package(url: "https://github.com/pointfreeco/swift-clocks", from: "1.0.0"), .package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.0.0"), @@ -66,14 +65,8 @@ let package = Package( .product(name: "SwiftCompilerPlugin", package: "swift-syntax"), ] ), - .executableTarget( - name: "swift-dependencies-benchmark", - dependencies: [ - "Dependencies", - .product(name: "Benchmark", package: "swift-benchmark"), - ] - ), - ] + ], + swiftLanguageVersions: [.v6] ) #if !os(macOS) && !os(WASI) @@ -108,15 +101,3 @@ let package = Package( .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0") ) #endif - -for target in package.targets { - target.swiftSettings = target.swiftSettings ?? [] - target.swiftSettings?.append(contentsOf: [ - .enableExperimentalFeature("StrictConcurrency") - ]) -// target.swiftSettings?.append( -// .unsafeFlags([ -// "-enable-library-evolution", -// ]) -// ) -} diff --git a/Sources/Dependencies/Internal/RuntimeWarnings.swift b/Sources/Dependencies/Internal/RuntimeWarnings.swift index 32b6eac1..7f92b969 100644 --- a/Sources/Dependencies/Internal/RuntimeWarnings.swift +++ b/Sources/Dependencies/Internal/RuntimeWarnings.swift @@ -20,7 +20,7 @@ func runtimeWarn( #if canImport(os) os_log( .fault, - dso: dso, + dso: dso.wrappedValue, log: OSLog(subsystem: "com.apple.runtime-issues", category: category), "%@", message @@ -55,15 +55,8 @@ func runtimeWarn( // To work around this, we hook into SwiftUI's runtime issue delivery mechanism, instead. // // Feedback filed: https://gist.github.com/stephencelis/a8d06383ed6ccde3e5ef5d1b3ad52bbc - #if swift(>=5.10) - @usableFromInline - nonisolated(unsafe) let dso = getSwiftUIDSO() - #else - @usableFromInline - let dso = getSwiftUIDSO() - #endif - - private func getSwiftUIDSO() -> UnsafeMutableRawPointer { + @usableFromInline + let dso = UncheckedSendable({ let count = _dyld_image_count() for i in 0..