Version "3.3" is incompatible with Semantic Versioning
sepw opened this issue · comments
Issue
We use SPM in our project and have used the following dependency to pull in SFSafeSymbols in the past:
.package(url: "https://github.com/piknotech/SFSafeSymbols.git", from: "2.1.2")
This has always worked fine.
Today I attempted to migrate our project to the newly-released 3.3, which has a version of "3.3". I updated our project's dependency to:
.package(url: "https://github.com/SFSafeSymbols/SFSafeSymbols.git", from: "3.3")
But this results in a parsing error for Package.swift
that is caused by the fact that "3.3" is not a valid Semantic Version as it does not include the patch version, which is mandatory. From Semantic Versioning 2.0.0:
A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes. X is the major version, Y is the minor version, and Z is the patch version. Each element MUST increase numerically. For instance: 1.9.0 -> 1.10.0 -> 1.11.0.
I tried changing the dependency to reference 3.3.0
but the SPM depedency resolution process fails with the following error:
Dependencies could not be resolved because no versions of 'SFSafeSymbols' match the requirement 3.3.0..<4.0.0 and root depends on 'SFSafeSymbols' 3.3.0..<4.0.0.
Suggested Resolution
Rename the version to be semver-compatible, e.g. 3.3.0
.
Related
The SPM portion of the SFSafeSymbols README suggests the following dependency:
.package(url: "https://github.com/SFSafeSymbols/SFSafeSymbols.git", .upToNextMajor(from: "3.3"))
Please update this to refer to the correct semver-compatible version.
@sepw Thank you for the detailed issue description and sorry for the inconveniences!
I have now released 3.3.1
and also adjusted the release instructions, emphasizing the need for a semver-compatible version number (to avoid similar problems with future releases).
Feel free to reopen if there is still anything left to address.
@fredpi I've updated my project to reference 3.3.1
and the SPM dependency works fine. Many thanks for the quick fix!