JPMartha's Pancake

This blog is the way to brush up my poor English.

#swiftlang Reply to The Swift Community 📩


I had replied in the mailing lists section. 💁

I post it as it is. 🤔

メーリングリストに返信したのでそれをそのまま載せます。🤔



Thank you for taking me time to reply!

Kostiantyn’s suggestion should work, though you’ll need to specify it as an inclusive range of the provided Version() twice.

An error has occurred as Kostiantyn’s suggestion is, I arranged it just a little as Example 1.

And then I think Max’s suggestion is Example 2.

But in any case, the swiftPM fetched a package with 2.0.0-beta.2 tag.

Example 1

.Package(url: "https://github.com/ikesyo/Himotoki.git",
    Version(2, 0, 0, prereleaseIdentifiers: ["beta.1"]))

Example 2

.Package(url: "https://github.com/ikesyo/Himotoki.git",
    versions: Version(2, 0, 0, prereleaseIdentifiers: ["beta.1"])...Version(2, 0, 0, prereleaseIdentifiers: ["beta.1"]))


By the way, the version of the package is required to follow Semantic Versioning (SemVer) conventions, therefore we must be determined by comparing each dot separated identifier.

  • http://semver.org/
  • "Precedence for two pre-release versions with the same major, minor, and patch version MUST be determined by comparing each dot separated identifier from left to right until a difference is found"

So, I think the specifying as Example 3 is better.

But the swiftPM fetched a package with 2.0.0-beta.2 tag.

Example 3

Package(url: "https://github.com/ikesyo/Himotoki.git",
    versions: Version(2, 0, 0, prereleaseIdentifiers: ["beta", "1"])...Version(2, 0, 0, prereleaseIdentifiers: ["beta", "1"]))


As it turned out, Example 4 is expected behavior.

The swiftPM fetched a package with 2.0.0-beta.1 tag.

Example 4

.Package(url: "https://github.com/ikesyo/Himotoki.git",
    versions: Version(2, 0, 0, prereleaseIdentifiers: ["beta", "1"])..<Version(2, 0, 0, prereleaseIdentifiers: ["beta", "2"]))

Consideration for Pre-release Versions

I understand what Max means.

However, we need to specify a dependency package with a specific pre-release identifier until the stable version is released in our development environment.

In fact, we had needed Xcode 7.3-beta version before Xcode 7.3 and Swift 2.2 were released.

I think we don't specify single version forever, but it should be possible to specify a dependency package with a specific pre-release identifier in Manifest and the swiftPM should fetch that exact version temporarily.


By the way, it seems the same thing has discussed here.

I hadn't watched it thorouoghly enough, I'm sorry.


Thanks for reading such a long mail.


Best regards,

JPMartha