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

artifactbundleindex requires strict triple #7362

Open
1 task done
swiftty opened this issue Feb 23, 2024 · 0 comments
Open
1 task done

artifactbundleindex requires strict triple #7362

swiftty opened this issue Feb 23, 2024 · 0 comments
Labels

Comments

@swiftty
Copy link

swiftty commented Feb 23, 2024

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI.

Description

In the artifactbundle, arm64-apple-macosx is a valid supportedTriples.
However, in the artifactbundleindex, the version must be included. e.g.) arm64-apple-macosx14.0

// The host triple might contain a version which we don't want to take into account here.
let versionLessTriple = try triple.withoutVersion()
// We return at most a single variant of each artifact.
let metadata = try ArtifactsArchiveMetadata.parse(fileSystem: fileSystem, rootPath: self.artifactPath)
// Currently we filter out everything except executables.
// TODO: Add support for libraries
let executables = metadata.artifacts.filter { $0.value.type == .executable }
// Construct an ExecutableInfo for each matching variant.
return try executables.flatMap { entry in
// Filter supported triples with versionLessTriple and pass into
// ExecutableInfo; empty if non matching triples found.
try entry.value.variants.map {
let filteredSupportedTriples = try $0.supportedTriples
.filter { try $0.withoutVersion() == versionLessTriple }

guard let supportedArchive = metadata.archives
.first(where: {
$0.fileName.lowercased().hasSuffix(".zip") && $0.supportedTriples
.contains(self.hostToolchain.targetTriple)
})

Expected behavior

expected same behavior as artifactbundle.

Actual behavior

swift build
error: failed retrieving 'https://github.com/swiftty/artifactbundle-example/releases/download/0.0.7/example.artifactbundleindex': No supported archive was found for 'arm64-apple-macosx14.0'

Steps to reproduce

No response

Swift Package Manager version/commit hash

Swift Package Manager - Swift 5.9.0

Swift & OS version (output of swift --version ; uname -a)

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0

@swiftty swiftty added the bug label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant