Closed acfoltzer closed 5 years ago
Thanks for the PR!
Can you explain more about the problem? Why is the arg is different from revision in Cargo.toml
? (if revision is not sufficient, should we change the metadata too?)
What's the mismatch between debian and semver? Can we automatically sanitize versions?
So, the overall scenario I have is that our CI system generates a version string for all of our packages based on git history and commit hashes. The format is a valid Debian version, but not a valid semver version as Cargo expects.
I think it'd be reasonable to add an optional metadata field as well, it just hadn't occurred to me for this PR because of the generated nature of our versions.
I don't think we can automatically sanitize things, because it's the Cargo version that's more restrictive than the Debian one. If it was the other way around we could, though; I'm actually not sure what the restrictions are on the Debian side.
So is your Cargo.toml
version invalid/incomplete?
Semver is pretty flexible as long as you add a -
or +
before your suffix. For example, git describe --tags
output is a valid semver accepted by Cargo.
Well, the Cargo.toml
version is a normal semver, but our continuous integration generates a version string like 11.19g96633ae4d2ce
, which due to the lack of -
or +
is not valid semver.
Even if it was a valid semver, this model where the string is determined at runtime based on things other than the Cargo.toml
version means that we currently have to sed
it into the Cargo.toml
, which is gross :(
Thanks for the explanation and the PR.
And thank you again for the useful project, and for merging so quickly :heart:
This allows changing the version string used in the Debian package without having to modify the Cargo manifest of a project. Since Cargo versions must be formatted according to semver, this was preventing valid Debian version string conventions from being used.