-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix Swift SDK bundles not working due to quarantine #6426
Conversation
"Cross-compilation destination" is a very verbose name. "Swift SDK" (note that this is distinct from just plain "SDK" used in other contexts) is a nicer alternative. Not all of the types and functions were renamed yet, especially `Destination`, which has been present in the codebase for long time. Renaming that type will be potentially source-breaking for libSwiftPM clients. This change is focused and updating user-visible strings and renaming types and functions that were only recently added. CLI subcommands were renamed accordingly.
When using `swift experimental-sdk install` subcommand with bundle archives or bundles unpacked from archives downloaded manually in the browser, installed executables are quarantined and trigger an error message when used by `swift build` Steps To Reproduce: 1. Download a destination bundle archive 2. Unpack and install the bundle with `swift experimental-destination install` 3. Confirm that the destination is installed and note its ID with `swift experimental-destination list` 4. Build using the newly installed destination with `swift build --experimental-destination-selector <destination-id>` Actual result: Building with this destination triggers an error: "`swift-driver` cannot be opened because the developer cannot be verified." rdar://107392863
#if os(macOS) | ||
// Remove the quarantine attribute from bundles downloaded manually in the browser. | ||
let result = try Process.popen( | ||
arguments: ["xattr", "-d", "-r", "-s", "com.apple.quarantine", installedBundlePath.pathString] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use removexattr
(or similar) instead of shelling out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 if possible
…xd/fix-quarantine-error
…xd/fix-quarantine-error # Conflicts: # Sources/PackageModel/SwiftSDKBundle.swift
swiftlang/swift-tools-support-core#414 @swift-ci smoke test |
@@ -12,6 +12,7 @@ | |||
|
|||
import Basics | |||
|
|||
import protocol TSCBasic.FileSystem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: sort imports
@swift-ci smoke test |
@swift-ci test windows |
1 similar comment
@swift-ci test windows |
@swift-ci smoke test |
@swift-ci test windows |
1 similar comment
@swift-ci test windows |
When using
swift experimental-sdk install
subcommand with bundle archives or bundles unpacked from archives downloaded manually in the browser, installed executables are quarantined and trigger an error message when used byswift build
Steps To Reproduce:
swift experimental-destination install
swift experimental-destination list
swift build --experimental-destination-selector <destination-id>
Actual result:
Building with this destination triggers an error: "
swift-driver
cannot be opened because the developer cannot be verified."rdar://107392863
Modifications:
We now suggest that users run
xattr -r -d -s com.apple.quarantine
on the bundles they trust to remove the quarantine attribute.Result
The error message is clear and actionable.