Search code examples
installationswift-package-manager

Error Compiling Publish (Sundell) from Manifest File


TLDR;

I installed John Sundell's Publish according to the accepted practices and immediately get an error when I try to build my site package. How do I successfully install the product?



After cloning the publish package:

git clone https://github.com/JohnSundell/Publish.git

I cd'd into the Publish folder and ran:

make

which created an executable at /usr/local/bin/publish

I opened a new terminal window, created a directory using mkdir Saturday and then cd'd into that folder. I typed publish new and was successful:

✅ Generated website project for 'Saturday'
Run 'open Package.swift' to open it and start building

When I open the manifest file (Package.swift) and type cmd-S (Save) it imports all the necessary packages, and everything looks good to go.

When I type cmd-B (Build), however this error message comes up:

The package product 'CollectionConcurrencyKit' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0

When I look at the clone/install of Publish I see:

Computing version for https://github.com/johnsundell/collectionConcurrencyKit.git
Computed https://github.com/johnsundell/collectionConcurrencyKit.git at 0.1.0 (0.37s)

Notice it says version 0.1.0. In the generated package for my site, it retrieves version 0.2.0. I don't know if that's an issue.

But not one other Package.swift file in all the fetched dependencies mentions iOS.

I have this line in my Package.swift

   platforms: [.macOS(.v12)],

So I know I haven't added this dependency on iOS inadvertently, so I don't understand the error message.

I'm running macOS Monterey 12.6 on Xcode 14.0 (14A309) - both are the most recent release versions available.

The hardware is: MacBook Pro (16-inch, 2021) using the Apple M1 Pro chip

If I'm leaving anything out, please comment and I'll provide more detail.


Solution

  • This is a slap your forehead 🤦🏽‍♂️ kind of thing here.

    It turns out that when I opened the Package.swift it defaulted to an iOS scheme that I had just been using. I updated the scheme to a macOS based one, the problem went away. Now I understand the source of the iOS error. Apparently the two versions of ConcurrencyKit is a red herring.

    Hope this helps others! Always check your target when compiling.