Closed Eh2406 closed 1 year ago
You're right in that I can use the semver metadata field. I wrote that line based on this excerpt from the Cargo book:
SemVer has the concept of "version metadata" with a plus in the version, such as
1.0.0+21AF26D3
. This metadata is usually ignored, and should not be used in a version requirement. You should never publish multiple versions that differ only in the metadata tag (note, this is a known issue with crates.io that currently permits this).
My reasoning was that I want rustc-plugin
users to have to explicitly list their nightly version in the version requirement. However, if Cargo ignores the metadata in version requirements, then aspect is not enforced.
That makes sense. If you publish version "0.1.4+nightly-2023-04-12"
then users of the crate would depend on it with "0.1.4"
which does not remind them that it only works with one version of nightly.
pre-release may be a better fit. "0.1.4-nightly-2023-04-12"
can only to be depended on if an =
requirement is used and prerelease is present. So "=0.1.4-nightly-2023-04-12"
will work but "=0.1.4"
will not.
I just changed the release model to use the prerelease tags as you suggested @Eh2406. Thanks for the help!
In the readme:
With an example of
"nightly-2023-04-12-v0.1.4"
, which is not a valid semver version. But"0.1.4+nightly-2023-04-12"
is a valid semver using the metadata part of semver. Or"0.1.4-nightly-2023-04-12"
using the pre-release part of semver. https://regex101.com/r/DTge1n/1