# Accurately determining Alamofire Swift version compatibility for the Swift Package Index

**URL:** <https://forums.swift.org/t/accurately-determining-alamofire-swift-version-compatibility-for-the-swift-package-index/54715>\
**Category:** Alamofire\
**Created:** [January 19, 2022, 1:09pm UTC](https://forums.swift.org/t/accurately-determining-alamofire-swift-version-compatibility-for-the-swift-package-index/54715 "2022-01-19T13:09:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveverwer](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/daveverwer/32/8671_2.png) [@daveverwer](https://forums.swift.org/u/daveverwer)\
**Post date:** [January 19, 2022, 1:09pm UTC](https://forums.swift.org/t/accurately-determining-alamofire-swift-version-compatibility-for-the-swift-package-index/54715/1 "2022-01-19T13:09:27Z")

</div>

Hello!

We’ve been doing a bit of investigation into a discrepancy between the Swift version compatibility results for Alamofire on the Swift Package Index and what the intended compatibility is.

You state in your badges 5.3+ and have `Package@5.4` and `Package@5.3` files, and sure enough, those all work fine, but we also get a successful build on watchOS with Swift 5.2 using `xcodebuild` from Xcode 11.6. See the [full build results here](https://swiftpackageindex.com/Alamofire/Alamofire/builds) and a [specific build for watchOS with Swift 5.2 on the 5.5.0 tag here](https://swiftpackageindex.com/builds/72D89035-83FA-4968-B35C-1115292454A2).

I’ve verified our build results using `xcodebuild` with Xcode 11.6 and the log you see on the build page above is what gets output. Of course, when you try and import the package into a watchOS app project with Xcode 11.6 you get an incompatibility warning:

![Screenshot 2022-01-19 at 12.21.36@2x](https://global.discourse-cdn.com/swift/original/3X/9/1/918ae818647f2c8f295d2c448d8c974d8906284a.jpeg)

We do get failures when `xcodebuild` attempts to resolve dependencies with Swift 5.2 and other platforms ([example](https://swiftpackageindex.com/builds/2F48D655-EA43-4CE8-B893-4962E0339A98)).

We’d love for our package compatibility to be accurate as people are potentially making decisions from it but we’re struggling to figure out what’s letting the watchOS build succeed where the others fail and we wondered if you had any insight on what might be different for this build?

Of course, the easiest way for a package author to “remove” compatibility would be with an `#if` and an `#error`, which may be the best situation here too, but we’re interested if we can make any adjustments on our side before resorting to that.

---

<div class="post-metadata">

**Author:** ![Jon\_Shier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jon_shier/32/921_2.png) [@Jon\_Shier](https://forums.swift.org/u/Jon_Shier)\
**Post date:** [January 19, 2022, 5:31pm UTC](https://forums.swift.org/t/accurately-determining-alamofire-swift-version-compatibility-for-the-swift-package-index/54715/2 "2022-01-19T17:31:53Z")

</div>

There's nothing different about the watchOS build, so I'm not sure why it works. Essentially, our support of Swift 5.3 or greater is more about only supporting Xcode 12 and above rather than any specific Swift version, as you can no longer ship software to the stores using Xcode 11 (AFAIK), and to [simplify our support matrix](https://github.com/Alamofire/Alamofire/actions/runs/1716439519).

I'm not sure what to suggest here other than to somehow parse the supported package versions and use that as your lower bound.

---

<div class="post-metadata">

**Author:** ![daveverwer](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/daveverwer/32/8671_2.png) [@daveverwer](https://forums.swift.org/u/daveverwer)\
**Post date:** [January 20, 2022, 3:19pm UTC](https://forums.swift.org/t/accurately-determining-alamofire-swift-version-compatibility-for-the-swift-package-index/54715/3 "2022-01-20T15:19:05Z")

</div>

Thanks for the quick reply, Jon. It's curious why it succeeds.

The problem will solve itself, of course, as we drop off old versions of Swift from the matrix. We've certainly talked about dropping the Xcode 11 versions, but for now, we're running everything that can run on Big Sur or above.

> [@Jon\_Shier](#):
>
> I'm not sure what to suggest here other than to somehow parse the supported package versions and use that as your lower bound.

Would you be open to a PR that gives an #error on Swift versions \< 5.3?

---

<div class="post-metadata">

**Author:** ![Jon\_Shier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jon_shier/32/921_2.png) [@Jon\_Shier](https://forums.swift.org/u/Jon_Shier)\
**Post date:** [January 20, 2022, 3:57pm UTC](https://forums.swift.org/t/accurately-determining-alamofire-swift-version-compatibility-for-the-swift-package-index/54715/4 "2022-01-20T15:57:56Z")

</div>

> [@daveverwer](#):
>
> Would you be open to a PR that gives an #error on Swift versions \< 5.3?

Sure. In the Package or in code? If in code, the Alamofire.swift file is the logical place.

---

<div class="post-metadata">

**Author:** ![daveverwer](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/daveverwer/32/8671_2.png) [@daveverwer](https://forums.swift.org/u/daveverwer)\
**Post date:** [January 20, 2022, 3:59pm UTC](https://forums.swift.org/t/accurately-determining-alamofire-swift-version-compatibility-for-the-swift-package-index/54715/5 "2022-01-20T15:59:20Z")

</div>

Yes, I was thinking in the code would be the best place. I'll pop a PR in over the next few days.
