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

Unable to build current source #561

Closed
mortax opened this issue Aug 26, 2024 · 13 comments
Closed

Unable to build current source #561

mortax opened this issue Aug 26, 2024 · 13 comments

Comments

@mortax
Copy link

mortax commented Aug 26, 2024

i'm sorry to admit that i'm not an Xcode expert. that said, i'm getting these errors when i try to build the current source (on Sonoma 14.6.1 (23G93) using Xcode Version 15.4 (15F31d)). annoyingly, these are phrased as if they should be ignorable (i.e. don't encode Swift 6 semantics) but i haven't found a way to ignore them.

Agent
.../secretive/Sources/Packages/Sources/SecretAgentKit/Agent.swift
.../secretive/Sources/Packages/Sources/SecretAgentKit/Agent.swift:38:24 Instance methods of non-Sendable types cannot be marked as '@Sendable'; this is an error in Swift 6

Product
.../secretive/Sources/Packages/Sources/SecretAgentKit/Agent.swift
/Users/jrd/github/secretive/Sources/Packages/Sources/SecretAgentKit/Agent.swift:38:24 Instance methods of non-Sendable types cannot be marked as '@Sendable'; this is an error in Swift 6

SecureEnclaveSecretKit
.../secretive/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift
.../secretive/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift:214:5 Instance methods of non-Sendable types cannot be marked as '@Sendable'; this is an error in Swift 6
.../secretive/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift:307:20 Static property 'keyTag' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6

.../secretive/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift:308:20 Static property 'keyType' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6

SmartCardSecretKit
.../secretive/Sources/Packages/Sources/SmartCardSecretKit/SmartCardStore.swift
.../secretive/Sources/Packages/Sources/SmartCardSecretKit/SmartCardStore.swift:120:5 Instance methods of non-Sendable types cannot be marked as '@Sendable'; this is an error in Swift 6

any advice?

@mortax
Copy link
Author

mortax commented Aug 26, 2024

@maxgoedjen can you delete the attempt to infect my computer? ☝️ (lol. a windows virus wouldn't have even worked.)

@YoungAgile
Copy link

@maxgoedjen can you delete the attempt to infect my computer? ☝️ (lol. a windows virus wouldn't have even worked.)

Sorry, the account has been hacked. Please do not click on this link.

@maxgoedjen
Copy link
Owner

@maxgoedjen can you delete the attempt to infect my computer? ☝️ (lol. a windows virus wouldn't have even worked.)

@mortax did this get deleted by the time I got here? I don't see anything else up there.

@maxgoedjen
Copy link
Owner

@mortax overall on this issue: I'm working on getting it building in Swift 6 mode currently, but in the short term you can remove the "CompleteConcurrency" flags in Package.swift

@mortax
Copy link
Author

mortax commented Aug 26, 2024

thanks @maxgoedjen. indeed, the comment was already deleted (not that anyone else would be taken in).

thanks for the tip. i've removed StrictConcurrency from Package.swift and am having another go. (dang it -- i should have been able to find that but it was a little beyond my Xcode knowledge.)

@maxgoedjen
Copy link
Owner

@mortax I turned that on back when it built, but new concurrency warnings have come on since. I'll disable that in main since it's becoming a semi-common question.

@mortax
Copy link
Author

mortax commented Aug 26, 2024

that change certainly helped. Xcode is annoying in that, after making a build configuration change, i always seem to have to use Product -> Clean Build Folder... (⇧ ⌘ K) to make Xcode rebuild properly/fully with the updated configuration. in my case, i also had to update the Swift Compiler - Language configured in Build Settings for each target.

the code changes used

diff --git Sources/Packages/Package.swift Sources/Packages/Package.swift
index 39d9a99..9fa196a 100644
--- Sources/Packages/Package.swift
+++ Sources/Packages/Package.swift
@@ -34,27 +34,27 @@ let package = Package(
         .target(
             name: "SecretKit",
             dependencies: [],
-            swiftSettings: [.enableExperimentalFeature("StrictConcurrency"), .unsafeFlags(["-warnings-as-errors"])]
+            swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]
         ),
         .testTarget(
             name: "SecretKitTests",
             dependencies: ["SecretKit", "SecureEnclaveSecretKit", "SmartCardSecretKit"],
-            swiftSettings: [.enableExperimentalFeature("StrictConcurrency"), .unsafeFlags(["-warnings-as-errors"])]
+            swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]
         ),
         .target(
             name: "SecureEnclaveSecretKit",
             dependencies: ["SecretKit"],
-            swiftSettings: [.enableExperimentalFeature("StrictConcurrency"), .unsafeFlags(["-warnings-as-errors"])]
+            swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]
         ),
         .target(
             name: "SmartCardSecretKit",
             dependencies: ["SecretKit"],
-            swiftSettings: [.enableExperimentalFeature("StrictConcurrency"), .unsafeFlags(["-warnings-as-errors"])]
+            swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]
         ),
         .target(
             name: "SecretAgentKit",
             dependencies: ["SecretKit", "SecretAgentKitHeaders"],
-            swiftSettings: [.enableExperimentalFeature("StrictConcurrency"), .unsafeFlags(["-warnings-as-errors"])]
+            swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]
         ),
         .systemLibrary(
             name: "SecretAgentKitHeaders"
diff --git Sources/Secretive.xcodeproj/project.pbxproj Sources/Secretive.xcodeproj/project.pbxproj
index 3e94e0e..c50ff59 100644
--- Sources/Secretive.xcodeproj/project.pbxproj
+++ Sources/Secretive.xcodeproj/project.pbxproj
@@ -707,7 +707,7 @@
                 PRODUCT_BUNDLE_IDENTIFIER = com.apple.maxgoedjen.Secretive.Host;
                 PRODUCT_NAME = "$(TARGET_NAME)";
                 PROVISIONING_PROFILE_SPECIFIER = "";
-                SWIFT_STRICT_CONCURRENCY = complete;
+                SWIFT_STRICT_CONCURRENCY = minimal;
                 SWIFT_VERSION = 5.0;
             };
             name = Debug;
@@ -737,7 +737,7 @@
                 PRODUCT_BUNDLE_IDENTIFIER = com.apple.maxgoedjen.Secretive.Host;
                 PRODUCT_NAME = "$(TARGET_NAME)";
                 PROVISIONING_PROFILE_SPECIFIER = "";
-                SWIFT_STRICT_CONCURRENCY = complete;
+                SWIFT_STRICT_CONCURRENCY = minimal;
                 SWIFT_VERSION = 5.0;
             };
             name = Release;
@@ -875,7 +875,7 @@
                 PRODUCT_BUNDLE_IDENTIFIER = com.apple.maxgoedjen.Secretive.Host;
                 PRODUCT_NAME = "$(TARGET_NAME)";
                 PROVISIONING_PROFILE_SPECIFIER = "";
-                SWIFT_STRICT_CONCURRENCY = complete;
+                SWIFT_STRICT_CONCURRENCY = minimal;
                 SWIFT_VERSION = 5.0;
             };
             name = Test;
@@ -924,7 +924,7 @@
                 PRODUCT_BUNDLE_IDENTIFIER = com.apple.maxgoedjen.Secretive.SecretAgent;
                 PRODUCT_NAME = "$(TARGET_NAME)";
                 PROVISIONING_PROFILE_SPECIFIER = "";
-                SWIFT_STRICT_CONCURRENCY = complete;
+                SWIFT_STRICT_CONCURRENCY = minimal;
                 SWIFT_VERSION = 5.0;
             };
             name = Test;
@@ -951,7 +951,7 @@
                 PRODUCT_BUNDLE_IDENTIFIER = com.apple.maxgoedjen.Secretive.SecretAgent;
                 PRODUCT_NAME = "$(TARGET_NAME)";
                 PROVISIONING_PROFILE_SPECIFIER = "";
-                SWIFT_STRICT_CONCURRENCY = complete;
+                SWIFT_STRICT_CONCURRENCY = minimal;
                 SWIFT_VERSION = 5.0;
             };
             name = Debug;
@@ -978,7 +978,7 @@
                 PRODUCT_BUNDLE_IDENTIFIER = com.apple.maxgoedjen.Secretive.SecretAgent;
                 PRODUCT_NAME = "$(TARGET_NAME)";
                 PROVISIONING_PROFILE_SPECIFIER = "";
-                SWIFT_STRICT_CONCURRENCY = complete;
+                SWIFT_STRICT_CONCURRENCY = minimal;
                 SWIFT_VERSION = 5.0;
             };
             name = Release;

i am still getting .../secretive/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift:214:5 Instance methods of non-Sendable types cannot be marked as '@Sendable'; this is an error in Swift 6 for SecureEnclaveStore, which i haven't been able to track down (yet).

@maxgoedjen
Copy link
Owner

That'll be fixed here: #562, should be merged in next few minutes.

@mortax
Copy link
Author

mortax commented Aug 26, 2024

sadly @maxgoedjen, i am still getting the @Sendable error for SmartCardStore -- even after repeatedly cleaning and rebuilding. even stranger, subsequent rebuilds tend to increase or decrease the number of errors (often including Command SwiftCompile failed with a nonzero exit code).

let me know if you have any thoughts. i was able to successfully build a year+ ago.

@mortax
Copy link
Author

mortax commented Aug 26, 2024

i get closest to a build (only one error -- unless i rebuild) if i remove this:

--- Sources/Packages/Package.swift
+++ Sources/Packages/Package.swift
@@ -34,7 +34,7 @@ let package = Package(
         .target(
             name: "SecretKit",
             dependencies: [],
-            swiftSettings: [.enableExperimentalFeature("StrictConcurrency"), .unsafeFlags(["-warnings-as-errors"])]
+            swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]
         ),
         .testTarget(
             name: "SecretKitTests",

then Clear All Issues and Clean Build Folder...:

Agent

.../secretive/Sources/Packages/Sources/SecretAgentKit/Agent.swift:38:24 Instance methods of non-Sendable types cannot be marked as '@Sendable'; this is an error in Swift 6

i can't eliminate that error, however.

@maxgoedjen
Copy link
Owner

@mortax just dump those changes and pull from main – it should build now (locally and CI both pass for me)

@maxgoedjen maxgoedjen reopened this Aug 26, 2024
@maxgoedjen
Copy link
Owner

Ah looks like CI's Xcode is outdated and 15.4 does show that, my bad. Let me get that fixed up.

@maxgoedjen
Copy link
Owner

Give that one more go now that #564 is merged, please.

@mortax
Copy link
Author

mortax commented Aug 26, 2024

brilliant! that did the trick. i was able to build. i just have to fix my signing and i'm all set. thanks Max!

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

No branches or pull requests

3 participants