3 ms·
Perhaps the most important practical point in this article is relegated to footnote 4: > 4. Funny enough, a change in the build system that doesn’t affect the
by chrismorgan 6y ago
Perhaps the most important practical point in this article is relegated to footnote 4:
> 4. Funny enough, a change in the build system that doesn’t affect the public interface wouldn’t warrant a major bump in SemVer, but let’s leave that aside.
If the Python cryptography package had been using SemVer, the change that some people are complaining about that introduced a Rust build-time dependency would not have bumped major, because SemVer is about the API, which didn’t change. And indeed most users can take a binary wheel distribution and so don’t need to build it from source and so don’t need to worry about the Rust dependency.
Notwithstanding this, I disagree with at least the strength of this article’s conclusion. SemVer won’t solve all your troubles, but in an ecosystem that supports you along the way (e.g. Rust + Cargo, Node.js + npm), it’s extremely close, though you will still probably want to pin versions automatically and update deliberately (so SemVer isn’t a total panacea because of this caveat). In such a proper ecosystem managed correctly, relying on SemVer:
• Can’t prevent breakage, but can make breakage very rare, which is better than nothing. (And if you shift your weight a bit so that you’re not quite relying implicitly, it helps a lot.)
• Does not lead to version conflicts. (Note that it is possible to get version conflicts if you’re not careful about how you expose types and values from your library’s dependencies, but if you design things the correct way, this won’t happen, hence “managed correctly”. However, I would say that Rust gives you the tools to do it the correct way, and that in the future this will be able to be machine-checked, while Node.js doesn’t hold your hand in any way, though you can do it properly.)
• Does not lead to security problems. I’m leaning toward judging this point in the original article specious, because it’s only applicable if other people have made a terrible mess of things (writing very bad version dependencies that everyone would frown upon), and that’s nothing to do with SemVer or otherwise—rather, I’d say that SemVer has helped here, because it makes it so that you have to deliberately go out of your way to deny security updates.
• Should add no meaningful burden on maintainers, though tooling is generally not quite there yet—notably, it’s generally somewhere between difficult and impossible to sanely bump the versions of the language or standard library that you depend on outside a major version bump, but that doesn’t make everyone happy, so this is still definitely something SemVer and periphery are not solving in Rust or Node.js lands.
> There’s also plenty of high profile projects that look like SemVer but aren’t: Linux, Python, Django, glibc…it’s fine!
Another interesting thing to note about these examples: they all maintain multiple branches simultaneously for security and bug fixes. Which I feel might argue against an important part of the article.
- wiredfool 6y agoI don’t think that I’d try to slip an additional build time compiler in in a minor version update. While it’s not a runtime change, it is going to affect a large number of people, and they will all post comments on any issue that matches their particular “can’t install because we can’t find the header foo.h”. (Speaking as someone who maintains a popular c/python package that is difficult to compile. )
- chrismorgan 6y agoIf it were something that required building from source, I’d be more open to considering the build dependencies part of the API (though I’d still assess it on a case-by-case basis), but so long as you provide wheels, people don’t need to build the library, and so build dependencies definitely aren’t a part of the API. In the case of cryptography, I gather that the vast majority of complainants were on Gentoo (which builds things from source) or Alpine (for Docker containers, because many-musl wasn’t a thing, so no wheel could be provided) or an ancient architecture that should be allowed to rot anyway (for reasons that have been discussed in other recent articles). Yeah, it’s a fair number of people affected in the end, but probably a very small fraction of everyone; and once many-musl is defined in pip and cryptography uses it, it’ll be close enough to no one as no matter. Remember also that if you’re using SemVer, a major version bump forms a schism because you can’t expect everyone to upgrade immediately, so major version bumps should not be performed lightly, especially for any sort of security-critical thing if you’re not going to maintain the old. I agree with Alex that, if using SemVer, bumping major would have been wrong here.
- wiredfool 6y agoWhat I'm saying is that despite providing tens of wheels per release, pip still sometimes gets the source version, and it's predominately the unskilled users that descend en-masse to complain that it won't install, there's this error message, and what does it mean. As a maintainer, this sucks. Even if it's a very small fraction, the internet is large, and my time isn't. I disagree with Alex. I understand his point of view, but I disagree. I also disagree with his project's decision to print a non-disableable warning on import in python 2.7, and then justifying the noisy warning based on "we didn't want people to disable it". One legacy project I'm working on is trying to get off 2.7. It's a long process, we know about it, and warnings like this all over the logs simply don't help.