For Swift SDKs installed from remote URLs an additional --checksum option is required, through which users of a Swift SDK can specify a checksum provided by a publisher of the SDK. The latter can produce a checksum by running swift package compute-checksum command (introduced in SE-0272) with the Swift SDK bundle archive as an argument.
Modifications:
Added isFileSupported method on Archiver to unify archive extensions matching logic between swift package compute-checksum and swift sdk install.
Refactored checksum computation logic into static func checksum on Workspace.BinaryArtifactsManager to also unify it between the two commands.
Added error and output handling for checksums in func SwiftSDKBundleStore.installIfValid, updated corresponding unit tests.
Motivation:
This option was specified in the corresponding proposal for Swift SDKs:
Modifications:
Added
isFileSupported
method onArchiver
to unify archive extensions matching logic betweenswift package compute-checksum
andswift sdk install
.Refactored checksum computation logic into
static func checksum
onWorkspace.BinaryArtifactsManager
to also unify it between the two commands.Added error and output handling for checksums in
func SwiftSDKBundleStore.installIfValid
, updated corresponding unit tests.Result:
Resolves rdar://130590711