5 ms·
> Pinning is absolutely crucial when building software from some sources out of your control, especially with larger teams or larger software. You cannot rely o
by masklinn 9y ago
> Pinning is absolutely crucial when building software from some sources out of your control, especially with larger teams or larger software. You cannot rely on the responsibility of others, be they 100s of upstream library authors, or 100s of other peer developers on your product.
In fact that's the entire reason why "semantics versioning" doesn't really work:
* you can never be certain that the maintainer actually follows it
* one user's breaking change is one maintainer's bugfix
* while some packaging systems attempt to automate and enforce it (e.g. Elm's) even that only goes so far due to type system limitations (e.g. changing acceptable values from [0, 4] to [0, 4[ as a side-effect of some change deep in the bowels of the library's logic is pretty much guaranteed not to surface if you don't have a dependent type system, and may not do so even then)
- pothix 9y ago> you can never be certain that the maintainer actually follows it The same happens for the proposed model ¯\_(ツ)_/¯
- masklinn 9y agoI think you and many other people misunderstood my criticism, it wasn't a criticism of semantic versioning per-se, but was rather than explanation of the issues with semver, which the proposed "scheme" indeed does not fix in any way, shape or form. The proposed author claims that "You cannot rely on the responsibility of others" but their scheme fails in the exact same way.
- kibwen 9y agoIt only "doesn't really work" because this is ascribing too much responsibility to it. Semver is a social protocol designed to assist in solving--but by no means completely solve--the technical problem of how to resolve dependency versioning. It only gives us the barest protocol to allow us to begin describing the problem, and permits us to attempt to build technical solutions on top of it. Nobody's pretending it's perfect, but if anyone has a better solution, feel free to propose it (and neither the OP's, nor "romantic versioning", are any better at solving this problem than semver).
- loftyal 9y agoPackage registries should implement some sort of required automated integration testing. If a package owner wants to update their package with what they claim is a non-breaking change according to semver, then the new version must pass all integration test cases of the previous. This could also include crowdsourced testing of that package, that allows users of that package to add tests over time to that particular version, so as to mitigate owners who don't test their packages well enough.
- baddox 9y agoThen you’re just defining “breaking change” as “change that breaks the tests.” Anyone with any programming experience knows that “but the tests passed” is never a valid excuse for a bug.
- jitl 9y agoSome verification would be better than no verification. You still need to verify and test package upgrades and pin versions; but it would make the semver contract at least specified to some degree.
- jitl 9y agoI think this is an excellent idea, particularly for typed languages. For a typed language package manager, you can run the following verifications: - for a patch version, all exported (name, type) pairs of A.B.C are identical to those of A.B.(C-1) - for a minor version, enforce first rule, but allow new types for new names. I think the Elm package manager does this, based on other comments here in this thread. Either way, that sort of automatic “exports” verification could be a base layer in a semver verification package manager, with integration tests layered on top.
- vbernat 9y agoFor C ABI, this exists since quite some time: https://abi-laboratory.pro/tracker/timeline/libevent/ https://abi-laboratory.pro/tracker/timeline/libevent/ (though, there is not really a way to enforce).
- ekidd 9y ago> you can never be certain that the maintainer actually follows it I write a bunch of Rust. The Cargo package manager has several layers of "defense": 1. The "Cargo.lock" contains exact versions of all transitive dependencies. (And Cargo doesn't allow overwriting a version once published, and lock files even override normal package "yanks", so these version numbers are very stable identifiers.) 2. The "Cargo.toml" file contains manually-specified semver information. I can run "cargo update" to get the latest, semver-compatible versions of all my dependencies. 3. In the rare case that somebody messes up semver, I can just blacklist certain versions in "Cargo.toml", or add more specific constraints. I think I've done this maybe two or three times in thousands of dependency updates. 4. My own projects have unit tests, and of course, Rust does extensive compile-time checks. So I'm likely to catch any breakage anyway. So the absolute worse-case scenario here is that somebody messes up (which is very rare). At this point, I can just file a bug upstream, lock a specific version down in "Cargo.toml", and wait for things to get sorted out. I have zero need to "be certain". I'm quite happy with "It works nicely 99.9% of time, and it has an easy manual fallback when the inevitable problems occur."
- bauerd 9y ago>* you can never be certain that the maintainer actually follows it Elm enforces semantic versioning with its type system, and one can also print the diff of values/functions between separate package versions. In principle, this is doable.
- JonathonW 9y agoAPI compatibility (showing that a package contains the same functions, which accept the same kinds of inputs and produce the same kinds of outputs) is only part of the problem-- it's harder to show that the functions actually do the same thing, but that's arguably more important than API compatibility. Typically, a compiler will catch a breaking API change; a behavior change will cause problems at runtime if a function suddenly starts doing something completely different.
- bauerd 9y agoYes, true. But still, having the compiler reject breaking changes when there should be none already goes a long way
- baddox 9y ago> it's harder to show that the functions actually do the same thing Effectively impossible, with a Turing complete programming environment. (“Effectively,” because technically our physical computers have a bounded number of states and inputs, thus aren’t technically Turing complete, thus Rice’s theorem technically doesn’t apply.)
- TylerE 9y agoThere are however tools like QuickCheck (https://hackage.haskell.org/package/QuickCheck https://hackage.haskell.org/package/QuickCheck) that can bombard the function with large amounts of random (but legal) input data and makes sure it's behaving.
- mirekrusin 9y agoIt's a wetware protocol, not formal, mathematically certain concept. You also can never be certain that the car is not going to run through pedestrian crossing on red light when you step in - but it doesn't mean that traffic lights are useless. Semver is like traffic lights. For reproducible builds/increased certainty harden it with some kind of pinning or local copy.
- smsm42 9y ago> * you can never be certain that the maintainer actually follows it That's a bad argument. You can also never be certain any third-party code works at all, or did not change without changing versions, or does not have subtle bugs that surface only in your particular use case, etc. If you dismissed the whole concept on basis that somebody could fail to follow it you wouldn't be able to use any third-party dependencies at all. At which point the question of versioning is kinda moot. > one user's breaking change is one maintainer's bugfix This is a "grey zone" fallacy. From the fact that there might be disagreements on the margins, does not follow there is not a huge majority of clear-cut cases where everybody agrees that something is a huge or tiny change, and in this huge majority of cases it is useful. Even if there's no definition that would work in absolute 100% of cases, it works just fine in 99% of them.
- richk449 9y ago> That's a bad argument. You can also never be certain any third-party code works at all Perhaps in the philosophical sense that you can never be certain of anything, this is true. But that only place that thinking leads is to staying under the covers all day. You actually can achieve a high degree of certainty that third-party code works to some reasonable standard by testing it. Which is the whole point - once you have tested a version, and are content that it works, you wouldn't want to blindly switch to another version without again performing a similar set of tests.
- Flenser 9y agoIf you are pulling in 200 dependencies you're going to be in the grey zone fairly frequently.