swiftlang/swift-package-manager

`.binaryTarget` gives an unhelpful error if a zip file on disk ends in `.artifactbundle`

Open

#10,077 opened on May 19, 2026

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Swift (1,462 forks)batch import
buggood first issue

Repository metrics

Stars
 (10,145 stars)
PR merge metrics
 (Avg merge 9d 4h) (62 merged PRs in 30d)

Description

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

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

When using a .artifactbundle file on disk, that happens to be a ZIP file, SwiftPM will report an error that the file is not valid and the path provided must end in .artifactbundle, .xcframework, or .zip.

This issue persists going back to the introduction of .artifactbundle static library support on Windows.

Expected behavior

An error informing me why .artifactbundle zip files are not permitted, either with more detail OR for the file to be read correctlly.

Actual behavior

SwiftPM either refuses to read the file or errors out early and informs you it isn't valid based on the file extension, and not on the contents of the file.

Steps to reproduce

  1. Take any .artifactbundle.zip file
  2. Remove the .zip extension
  3. Reference it in the Package.swift file
  4. Run swift build
  5. (Optional) Sob uncontrollably because SwiftPM is gaslighting you.

Swift Package Manager version/commit hash

6.3.2

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

Swift version 6.3.2 (swift-6.3.2-RELEASE) Target: x86_64-unknown-windows-msvc Build config: +assertions

Contributor guide