-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require Semantic Versioning ("Semver") #130
Comments
@dom96, what's your stance on this? |
Why a requirement? I think this can be implemented as an optional feature. |
Yeah, the thing is, it doesn't even have to be implemented really, it's more of a social norm thing of the package eco system. If it's the norm, then you know you can always rely on the major,minor,patch for version-matching. I don't see a good reason to explicitly use another versioning method. And an ad-hoc one is no good. So why not stick to one that is getting more and more widespread? Creating a sort of, dependency harmony ;) |
I don't understand this discussion. A tool cannot check that you actually stick to semantic versioning so all you can do is to document that you should do it. What am I missing? |
Exactly. It's just a matter of official policy: "How to publish your own modules"
So, that's all I'm hoping for. |
It's not just a matter of policy. Nimble needs to be aware of semantic versioning. |
Ah, yes damn it, you're right - for the matching and ranges. For simple version expressions "modname @ 1.2". Any excluded version parts are implicitly * (any) (this example would include "1.2.999999" for instance, and could be written explicitly as "1.2.*"). When it comes to lt/gt comparisons etc. the important thing is also there that omitted version parts are implicitly accounted for. So "modname <= 1" means "<= 1.." (for example "1.9999.99999" is included in that semantic range). |
Perhaps a |
I prefer to change the semantics of >= so that >= means ~>. Good defaults are the way to go. For strict "greater than or equals" we can introduce >=! |
Hrm, I think I changed my mind, and people should just use |
Why should |
Something else we could support: https://twitter.com/rachelcolby11/status/676843156957061121 |
Why isn't there still a policy regarding how people should version their packages in Nimble? Semver couldn't be verified, of course, but at least it should be mentioned in the README that following semver is expected. Right now the README mentions this, which doesn't make much sense:
If you don't specify an upper bound, a breaking change in the dependency will break your package, so it rather should be an exception to NOT specify an upper-bound. Versioning policy is about culture - it doesn't require too much from implementation standpoint, but it lets everyone know what version number really means for packages managed by the package manager. Formally, |
There is a reason for this. Specifying an upper bound limits the number of versions of the dependent package that can be used. Consider two packages, package Foo which depends on "jester >= 1.1.0 & < 2.0.0" and package Bar which depends on "jester >= 2.1.0 & < 3.0.0". Your application depends on Foo and Bar, satisfying these dependencies is impossible because you cannot import two different versions of Jester. |
@dom96 |
I disagree. Failing because a library cannot compile due to a change in API is better than failing because the versions don't match. In the latter case the packages may still work together. I also don't think that resolving the issue I described is easy. How do you resolve it? Tell the maintainer of package Foo to update their package's dependencies? what if they can't? |
The problem is that it fails at undefined point of time, it's uncontrolled by the author of the package. When it gets broken, anyone using the package will be blocked and it's going to be impossible to resolve. Imagine that a package used by hundreds of other packages and applications suddenly gets broken, and there is no way to fix that for anyone (except to stop using that package and perhaps Nimble altogether, because it's going to be common for Nimble if it keeps such policy).
It doesn't matter too much here if it's easy or not to resolve that issue, the important thing is that resolving it is in the hands of the package author and they know the issue prior to publishing the package. In the worst case, depending on the license, they may temporarily copy-paste the conflicting package and make it use the newer/older version. My main point is that when the same version of an already published package stops working, it is the most serious issue that can occur when dealing with package managers, and the versioning/dependency policy should not promote that. I took a quick glance at Rust/Cargo discussions and it seems to allow conflicts in certain cases - when there is no actual type/proc sharing happens outside of packages that create conflicts. Not entirely sure how it does that (seems Rust compiler does some verification, not Cargo), but such approach would resolve many issues with dependency conflicts. Perhaps the package author itself could define whether the dependency is internal or exposed - if it's internal, it should be fine to duplicate it and let different packages use different versions of it. Java's Maven and its derivatives allow to override dependency version of your own dependency, so it also gives some control to the package author for resolving dependency conflicts. In general, dependency conflicts is one of the core issues of any package/dependency manager, and it requires deep thinking, but letting published packages break easily is definitely not a solution. |
By the way, Facebook announced Yarn - a new package manager for JS a couple of days ago, and it got a lot of hype. One of the main selling points of Yarn is this:
(Cargo has this feature, too) So you can imagine how people get annoyed because of unreliable builds, if they are ready to make a switch from an established package manager with the largest community in the world and years of work put in. And that makes sense - you want your application to be exactly the same when built, regardless of when or where you build it. If one thing gets built on dev machine, and another on CI agent, then you get unexpected behaviour. Even worse if CI agent builds one thing today, and another thing tomorrow (or fails to build tomorrow) without any changes in the app's repository. |
On Thursday, 13 October 2016, Ruslan Mustakov notifications@github.com
|
There is a good point made here: https://news.ycombinator.com/item?id=13378637
We need to keep this in mind. Not all Nim packages declare a public API. |
Could you elaborate? I think it's usually applications that don't declare API and semver doesn't make much sense for them, but libraries intended to be used by others by definition do declare public APIs. And packages in a package manager are usually libraries and frameworks. |
Yes, my point is that not all packages should be forced to use semver. |
I'm slightly horrified semversioning isn't enforced. Especially in the context that I came to report
So clearly, this line of reasoning is wrong. A tool is indeed checking the version...
I disagree mostly, although I understand some may want to use release date or similar as a version. Even then though, that can be incorporated into semver. Examples in the wild of requiring SemVer:
Obviously there are others and this is becoming more common 7 years after the OP simply because it works in terms of managing dependencies. If someone wants to call their package Anyway, rant aside. In the spirit of not enforcing any particular versioning scheme, can semver at least be an option? |
Nimble should require packages to follow sem versioning.
This way all dependency version matching is much simpler and more reliable.
(Pseudo:)
The text was updated successfully, but these errors were encountered: