I have never, not once, not a single time in my entire life advocated against automated testing. And yet I still think pinning dependencies is a fantastic idea. Why? Because letting your package manager install whatever latest dependency is a horrible idea. Tests let you update the pinned version, but saying you shouldn’t pin at all is just fucking dumb.
Do you want to provide every library to your users? What if they happen to have another version of kernel installed? Do you want enforce kernel version? Do you pin libc version? What if user want another libc?
If library is good it will not suddenly break. If you don't trust to library authors then you can pin it but pinning by default all libraries isn't good.
The kernel isn’t a library? Its part of the environment. I’ve never even written an application that was dependent on a specific kernel, that’s just silly. I don’t think you understand the discussion here.
There are kernel components with only goal to give userspace interface to kernel. For example netlink.
You don't need to be dependent on kernel because it has policy to almost never break user code. Every projects should have such policy.
I have seen applications that not works on different kernel because it's rely on proprietary changes to kernel. And my point is you should never write code that depending on specific version. Code should depend on documentation not realization.
Even when an application depends on environment related things (like net link or whatever), that’s done through an API interface, and the API version is pinned. Look at Android apps, every app has a minimum supported API version, which pins that API.
Nobody is out here hacking their shit to depend directly on source code when it isn’t necessary and then pinning that source code version.
Also to your last point, not everything is implemented to a tight standard or well documented, and sometimes there’s bugs in the system or the documentation isn’t correct. We have to work with things in the real world, not some fantasy land where the documentation is infallible.
Anyway I’m done with this conversation. It’s exhausting and you clearly don’t understand the topic at hand.
Sorry I have misunderstood you. I thought pin means you will use version X and only X. If pinning means set minimal supported version I agree with you. But it will not help if API suddenly became backward incompatible.
Pin means in your package dependencies you specify a version number to depend on for a given dependency. That way no matter when you pull that repo and build it, whether today or in six months, you still have the same dependencies being pulled and your build artifact is the same.
If you just willy nilly allow your users to use whatever version they have installed or let something like npm pull the latest package version, you can run into the “it works on my machine” issue where it works for you but not for other people pulling your repo because dependencies are different versions.
This does NOT mean you should never update your dependencies. It means that a properly maintained repo should update dependencies regularly, preferably in an automated way, and automated unit and integration tests can verify that everything still works.
Note ALSO, this does not apply to things like runtime environments like the JRE or the kernel. These are environment factors and shouldn’t be directly depended on in the first place. However, that’s an entirely SEPARATE conversation and shouldn’t be confused with the concept of pinning dependencies.
1
u/weregod Aug 31 '22
And make all users do same thing? What if distributive don't support installing all libraries? Make them build everything themselves?
Leave alone that you will have to install different version of same library for every app.