8 ms·
Modern software controls dependencies because it helps software authors
- cjfd 6y agoYes, nowadays it is very common for software to pin its version. This practice strikes me as questionable. One danger is that dependencies are not getting updated regularly and one day one find oneself depending on a very old version of a dependency. The other is that it may not always be possible/practical for other people to be at the that exact version. Some libraries can depend on system libraries that cannot be easily upgraded. E.g., numpy depends on underlying system libraries and it is not always possible to choose whatever version. GUI-libraries ultimateley depend on system GUI-libraries which also, practically speaking, cannot be updated to any random version. It sure is a pain that occasionally a dependency breaks. One question that one can ask, though, is whether one wants to experience that pain sooner or later. I am thinking of https://martinfowler.com/bliki/FrequencyReducesDifficulty.html https://martinfowler.com/bliki/FrequencyReducesDifficulty.ht... here.
- Silhouette 6y agoOne danger is that dependencies are not getting updated regularly and one day one find oneself depending on a very old version of a dependency. That is only a problem if the old dependency no longer provides the required functionality, though. In many cases, that will never happen. The other is that it may not always be possible/practical for other people to be at the that exact version. Some libraries can depend on system libraries that cannot be easily upgraded. E.g., numpy depends on underlying system libraries and it is not always possible to choose whatever version. GUI-libraries ultimateley depend on system GUI-libraries which also, practically speaking, cannot be updated to any random version. Ironically, the problem you've described here originates with dependencies not having stable dependencies themselves. This is why it's so important for foundations like operating system or other platform APIs to offer excellent stability and longevity, and more generally for libraries that want to be relied upon to offer clear version information and backward-compatible updates. One question that one can ask, though, is whether one wants to experience that pain sooner or later. I am thinking of https://martinfowler.com/bliki/FrequencyReducesDifficulty.html https://martinfowler.com/bliki/FrequencyReducesDifficulty.ht... here. But what if you never have to experience that pain at all? Or if you can experience it only once, much later, when it really does become unavoidable, instead of experiencing a similar amount of pain multiple times along the way? Look at the sketch graph in that article, the one with time between actions and pain as the axes. Tell me what it means. Nothing. It means nothing. It conveys literally no evidence or data of any kind. And the entire argument rests on that non-existent foundation.
- rwj 6y agoJust one data point, but doesn't Google advocate for living at head? Long-lived software can't be static.
- skybrian 6y agoYes, and keeping up with these changes is a treadmill, for developers. They also statically link binaries, though, and an old binary could be in production for a while if the product isn’t being worked on. The popularity of Docker files shows another way of freezing dependencies. The general principle here is that changes get tested during the release process. You’re not creating new combinations of dependencies and running them in production without testing. (Well, within the same binary, at least. Servers talking to each other over the network may be unexpected combinations.)
- Silhouette 6y agoBut why should we take Google seriously as an example of good software development practice? For an organisation with effectively unlimited dev resources, it breaks things pretty often and kills off a lot of products outside of the star performers that support everything else. And thanks to the dominance of Chrome and Android, when Google does break things, the pain is shared by countless other developers as well. No-one can deny that Google has been a wildly successful business, but whether its current software development practices have anything to do with that or make it a worthy role model to emulate is a different matter.
- rwj 6y agoYes, take their lessons with a grain of salt, but they have a ton of experience, and shouldn't be dismissed out of hand either.
- majkinetor 6y ago> Nothing. It means nothing. It means that as time passes by, the things that need to be done accumulate and hence the pain of doing them. You don't need evidence for that. Its a common sense. Otherwise, give one example when waiting for action (and in absence of divine/external intervention) makes it easier. Via this logic we can deduce that there must exist 100% self-fixing entities. I am not aware of any such thing. Many entities have some autocorrection (including us) but up to a certain point and usually (only?) when life is involved.
- MaulingMonkey 6y agoDistro package managers implicitly pin versions too - at distribution granularity - updated randomly by a bunch of strangers downstream with limited testing. The result is incredibly poor. I deploy to consoles. I deploy to mobile. I deploy to the web via WASM. I deploy to windows as EXEs, MSIs, and APPXes. Your distro's linux package manager won't help me keep my dependencies up to date in any of these places. They won't even help me keep my dependencies up to date on linux, when the packages lag behind upstream - or in disconnected applications with no web access to update the linux distro with. How do I get security updates onto my OpenDingux RG350M? Through new images and newly built and pushed OPKs, not through fetched APT packages. With versions pinned upstream at the app source code level, I can actually see what versions I've shipped had a vulnerable version, and push updates / advise my users appropriately. Stale dependencies are admittedly a concern, but they're not a concern that's even remotely fixed by having an unpinned, floating version. There's a reason software started bundling auto-updaters, and it's not because linux distros were handling everything perfectly fine already. The article defends, among others, the Rust approach. Apps are pinned to exact versions via lockfiles. Libs are pinned to approximate verisons by semver, with CI typically catching when that breaks. This is a nice balance, and applies social pressure that encourages Rust projects to properly adhere to semver. Dependabot can flag dependencies with security issues, dependencies without security issues that are just old, auto-PR version updates to see if they pass CI or need manual action, and even auto-merge changes if you let it when the builds go green. I've used this article as an excuse to double check my settings. I didn't have dependabot enabled for a couple of private repositories. I have a few flagged issues in an offline, user-inputless, electron clock widget I keep on my windows desktop. Harmless... but if they hadn't been? This would let me know I need to rebuild, retest, and redeploy. Via push notifcation. Despite the bundling approximating static linking. Despite the lack of linux. Despite the complete lack of an OS package manager, or even proper CI scripts. It's a much more versatile and portable approach.
- rwj 6y agoI doubt that everyone is being as deligent as you. I suspect leaving security updates to upstream is not a recipe for secure distributions. For the record, I see both sides as having legitimate concerns.
- pjmlp 6y agoNowadays? As long as I can remember all the work I delivered into production used some form of vendoring and I started during the ZX Spectrum heyday.
- outsomnia 6y agoDownstream projects that only consume old versions of upstreams projects are deadweights to the upstream. They don't encourage, support, find bugs in, or send patches to the upstreams. And they live is some delusion that this creaking garbage pile of mummified, unmaintained, full-of-known-vulns old versions they are building on are "stable".
- jimbob45 6y agoWe use a decade+ old version of log4net. It suits us just fine and I’m not even sure “vulns” are something we would need to care about in debug logging software.
- cmckn 6y agoI think “vulnerabilities” are always worth thinking through like this. If a YAML library you only use to read in a config file at startup has some buffer overflow bug...who cares? It’s usually painless to just bump the version, but just because a bug was fixed doesn’t mean you’re now insecure.
- bryanrasmussen 6y agoIt certainly doesn't look like there are a lot of problems https://www.cvedetails.com/product/7281/Apache-Log4net.html?vendor_id=45 https://www.cvedetails.com/product/7281/Apache-Log4net.html?...
- steelbrain 6y ago1 - Never versions are not always more secure or more stable 2 - Not everyone who has the bandwidth to write something also has the bandwidth to rewrite very often just to keep using the latest and greatest APIs
- Quarrelsome 6y agoso says the library publisher. The product publisher says in counter: > I don't care about your issues in the way you care about them, this lib does what my customers need it to and I'm happy about that. When it stops doing what my customers need, then I'll up it (read: probably never). Its a discord. I don't think either party is wrong or either party is entirely right. They just have competing interests.
- bottled_poe 6y agoTake any engineering analogy you like. At some point you need to restrict changes in foundational components in order to create a robust product. It’s not practical to continually change the foundational components, especially when the builder is left with the responsibility for continuously integrating and testing the compatibility between those components.
- skybrian 6y agoEvery website has the ground changing under it whenever browsers update to a new version. This usually doesn’t break much because browser vendors are pretty conservative about changing features that are in wide use. I guess that’s one way of restricting changes to foundational components, but maybe not what you meant?
- PurpleFoxy 6y agoAnd as a result, the browser may never break existing APIs so JS is left with multiple ways to do the same things where certain ways are strictly worse than others. Also the web browser apis go under orders of magnitude more scrutiny than your average library.
- konjin 6y ago> Every website has the ground changing under it whenever browsers update to a new version. Every app has the ground changing under it whenever the kernel updates to a new version. Yet somehow we can still run binaries from the 90s. The browsers are broken and need to be frozen. Not something that will happen because google, like microsoft before it, benefits from constantly breaking, changing and extending everything to not let anyone catch up to them.
- majkinetor 6y agoIts not only about practicality or work involved either. You are replacing something that works and is battle tested, with something that is unknown (even if its just minor upgrade). That can lead to bugs that affect end users. Even if you have automatic tests, it still applies, as you can never test everything.
- taeric 6y agoThis feels like a huge dodge. Why do folks control dependencies? Why do so many foundation layers insist on breaking changes? It is almost ironic, as linux is known for not breaking up the abstraction ladder.
- viraptor 6y agoBecause dependencies are not perfectly managed / versioned. When you release the end product app, you have 3 options: - assume that your published version compatibility is correct and let the app fail for some library upgrade in the future - publish a strict list of dependency versions and keep updating it - publish a strict list of dependency versions and rely on old versions as long as possible The first one results in unhappy users, second one in lack of distro packages because you rely on too recent deps, third one either in lack of distro packages because of too old deps or in unhappy users because deps don't work on their new system anymore. There's no way to satisfy everyone unless distributions themselves become aware of multiple levels of package management.
- taeric 6y agoI feel this is just violent agreement. The problem is people depend on you because you provide X. You thought you provided Y. X was just a small side benefit. As a provider, how do you advanced Y without breaking X?
- Silhouette 6y agoYou have at least two more options than that: - don't have the dependency in the first place - supply your own dependencies instead of relying on the environment to provide them for you in ways you can't control The ideal format for distributing software is a single, self-contained executable program far more often than parts of the developer community would like to admit. So many of these potentially serious problems just don't exist if you use a compiled language and you statically link a controlled set of dependencies at build time. Obviously you still need to monitor your dependencies for essential updates and then issue updates of your own software to incorporate them when necessary, for example in the event of a security vulnerability being identified and fixed. And obviously you may still depend on services provided by your host environment that you're communicating with but not incorporating directly. But at least you always know exactly what your user will be running within your own program, you can test it properly before you ship it, and it won't then mysteriously change because of something they or some other software on their system did that you have no knowledge about or control over.
- larusso 6y agoI maintain a batterie of libraries for my company. Managing dependencies is one of the hardest part even with internal only libraries. Our major pain-point is the dependency towards 3rd party software and dealing with semver. Semver is not really hard to understand it’s just hard to execute as the developer is executing the rules. So for instance if I create a library/plugin etc which wraps around a tool, would it be a breaking change when the software stops supporting a specific version of the wrapped tool even though the internal API stayed the same (this happens a lot for me with gradle plugins which suddenly decide to not being compatible with the version of gradle I use). I would say yes but for larger dependency trees this becomes a nightmare. For our internal unity3d libraries we decided to not count the supported Unity versions as part of the semver version. The other option would be to have special library packages for each version of unity similar to how the Spock testing framework[1] deals with groovy. For this option we don’t have enough engineers at my company. [1] https://github.com/spockframework/spock https://github.com/spockframework/spock [edit] spelling
- PurpleFoxy 6y agoThere is also no way to really know what a breaking version is. Every single update must be tested to make sure it really isn’t breaking. I have had cases where a library fixed a bug and it turns out we rely on the existing behaviour so the bug being removed is a breaking change.
- larusso 6y agoYes behavior is the other huge problem. I cover this mainly with integration tests. And whatever wasn’t covered by these specs is not part of the API. But there lies the issue. What if the developer forgot to add a spec or worth the tests returned false positives because of test setup issues. Or also one of my favorite issues are when dealing with rest APIs. They get flagged deprecated removed etc without remorse that it means that large parts of old software libraries are practically broken without actually being broken. Catching these means running active nightly builds etc if you don’t actively maintain the library on a regular basis. The switch from GitHub to use main as the default branch name for repositories brought a lot of issues with one gradle plugin I wrote because I hardcoded (yes it was my fault here) the value to be “master” which for years was the norm that every repo had one. In hindsight it was a clear oversight from my side because one could have removed the master branch before obviously.
- majkinetor 6y agoOK, let me be the one to say it: majority of tools don't need any updates if they already work as designed. You will say "what about security" but majority of apps don't need world level security, or any security at all. In large coorps for which I work exclusively big number of systems are older then decade without any source code change during that time and it is obviously good enough. I am just replacing the government e-banking system that worked 5 years without ANY change (source code seems to be lost). They are replacing it because it has bugs, not because it uses outdated dependencies (and we are talking here about state level service). I implemented babysitting side service that fixes the problems the original one makes as it detects them while we redo the entire stuff and we didn't hear any complaint after that. People obsessing over security and purity should learn to let it go and get down to Earth - if you don't have a problem, there is no need for fix. We have tones of old inventions people still use unchanged today. Door locks come first to my mind. Boosting up internal security often reminds me of keeping all house rooms locked with the best lock ever, and nobody does that (if you do, your house is exception and has some special use). Outdated deps are usually a problem in my experience when you need to redeploy some old work manually. That is one reason fat binaries are great. And this is also the major reason that using cloud services is a bad thing - you can't just let it be for as much time as you want. Vendor will change API and you must adapt or GTFO. I have currently at least 5 services that work in government unattended around decade and are critical.
- gypsyharlot 6y ago"If you don't have a problem, there is no need to fix it" You really need to think a bit deeper about this. You obviously don't have much experience with security and you make a lot of assumptions here. First of all, you seem to make the assumption that when an organization gets compromised, they will know about it. No one is going to change your desktop wallpaper to say "You have been hacked", like in the movies... Which leads me to the second point. What valuables does your organization have? Do you have recipes for a special kind of glue that your researchers spent a few million dollars inventing? Would you want a bunch of foreign companies sitting in your network, siphoning all your hard work out for free? And what about the customers that buy your product? Do they care if all your communication with them, and any issues concerning this product that should only be known internally is widespread?
- the__alchemist 6y agoThe subtle nature of this topic drives this rule of thumb for me: Carefully consider each dependency you use, and if you need it. In Python, JS, and to a lesser extent Rust, it's common for articles to recommend dependencies to do things that can be done in a similar fashion without. This seems harmless at first, but leads to the problems described in the article, especially as the number of dependencies increases. Another guideline: Avoid dependencies that have many dependencies of their own.
- majkinetor 6y ago> Carefully consider each dependency you use, and if you need it.... Avoid dependencies that have many dependencies of their own. Good luck with nodejs apps :-) "Carefully considered EACH dependency recursively" is not actionable advice (and nothing worst then tautology). I rely on automatic tests and penetration tests. The actionable advice is more like: Carefully consider if you need dependency. When you choose to use them, don't spend more then a dozen of minutes analyzing them internally but rely on automatic tests.
- grey-area 6y agoOr don’t use nodejs because of the culture of extensive dependencies it encourages.
- cjaybo 6y agoThis sounds awfully hand-wavy to me. What sort of tests do you write that take allow you to forego vetting dependencies yourself? You mention penetration tests here (?), are those really less time consuming and more effective than taking 30 minutes to review a library?
- majkinetor 6y agoYeah, they are. Recursive checking of libs as suggested doesn't take 30 minutes, or otherwise nobody would complain. And what if you missed something because nobody checks thoroughly the library code in 30 minutes - one will certainly obfuscate any malicious procedure. Also you can outsource the tests and its easy to do. Depending on the contract, they can even be held liable if you come to get owned via the method that should have been tested.
- sgt101 6y agoIt's interesting that managed services in cloud environments are always latest version. Either these services will become outmoded or software that depends on them will have to be maintained in prod.
- captainmuon 6y agoI don't know, as a software author myself I don't like the "modern" way of thinking. I like to write an application once, and then be able to update the dependencies and it will still work later, because the dependencies use a stable and sensible interface. I remember writing a couple of apps in the early GTK 2 days, in PyGtk, and they would still run with the very latest GTK 2 version. Due to pythons dynamic nature, I could even get them to run on older GTK versions (when I needed to run on CentOS) by providing polyfills for the one or two missing methods. I get that compatibility shifts the maintenance burden to the library developers but that complexity has to go somewhere, and I'd prefer it centralized.
- jcelerier 6y ago> I like to write an application once, and then be able to update the dependencies and it will still work later, because the dependencies use a stable and sensible interface. as a software user I really hate using an app and having its GUI randomly change even if the app wasn't updated, just because the linux distro changed some lib underneath
- AshamedCaptain 6y agoWhy do you want updates if not for that. The reason one updates the distribution is to get new features or fixes. It would be a friggin disaster if only this program got the fixes, but not that program, so now they can't agree on the clipboard format, for example.
- Silhouette 6y agoA lot of users don't want updates. They just want their software to work and do whatever they're using it for. As a practical matter, software that is network-accessible or deals with data from outside sources may well need a security patch from time to time. Those updates are good for almost everyone, but by their nature, they should also be transparent to users. It's a different story when you're talking about changing functionality that is visible to the user. Almost everyone hates it when UI elements like menus or toolbars or dialog layouts or shortcut keys get changed from what they're used to, particularly if there is no apparent reason for the change.
- furstenheim 6y agoComing from node world, global dependencies like in java and python are a total deal breaker. In node same library in two different versions can coexist in different parts of the dependency tree and that's totally fine (there are some small exceptions). You give up some space but the gains are incredible. In contrast, in Java I've got runtime errors because a library down the tree was importing some other library with the same package name.
- raverbashing 6y agoYeah it's not a "deal breaker" but I agree it's pretty annoying. Venvs in python kinda soften the blow on a global dependency level, but it could happen your project needs two conflicting dependencies
- furstenheim 6y agoYeah, maybe "deal breaker" is to strong. But I've had consumers of a library not being able to use it because a critical dependency (html parser) was not the same version as they had
- usui 6y agoThis is one thing that I have always wondered about. Lots of app-development frameworks insist and die by the practice that is trying to be smart about common dependencies or global dependencies like Ruby gems/Bundler. In all of my experience, running "npm install" has always been a much easier affair than bundle install. The amount of time saved by npm's dumber approach has added much greater value than the hard disk space saved. I'm trying to see what I'm missing about the two dependency packaging philosophies, but in practice npm is by far the best experience for a dev on the frontlines. Is it just hard drive space that is the problem?
- furstenheim 6y agoTotally, and if you mix it with yarns plug and play you should get best of both worlds
- 6y ago
- rwmj 6y agoOr library and programming language authors could not break things. I've co-authored a few C libraries that have never broken their callers, over 15+ years of development. In C you can use symbol versioning for API changes you really must make, and the rest is about choosing a sensible API to start with and sticking with it.
- exporectomy 6y agoBut how can you really be sure you're not going to break something? There might be software that accidentally depends on timing, say, or the order of items in a list or some other undefined behavior that you assume you're free to change but software authors didn't realize was unstable. A lot of programming is done by trial and error rather than reading the manual.
- rwmj 6y agoWe're careful to specify what is defined behaviour (basically what we document) and the rest is not. Of course bugs exist both in our libraries and our callers, and we fix those, and work with callers if they had depended on the buggy behaviour, but that's a genuine case where the caller must fix their code. Fixing a bug is miles different from unnecessary breaks in APIs.
- exporectomy 6y agoNothing wrong with having good intentions but if you fixing a bug breaks someone else's software then they still have to fix their software no matter who's fault it is. Repeat for all their other dependencies and they have an endless stream of annoying little new bugs to fix. I work on software that has dependencies probably over a decade old. They have that long history of proving themselves to be perfectly good so there's no upside to updating them and only a tedious bug-hunting downside. One of them was already abandoned when I started using it but it still had an active community of users who agreed that it was perfectly usable without any more updates despite having the odd minor bug or limitation. That's where I hope software can end up - "finished" then sit around being stable and useful until it becomes obsolete. Other than security, I think people have a psychological problem with knowing there won't be any more updates. They always hope the next update might fix the bug that bothers them or add the feature they want. But often that never happens and they're just being strung along on hope and dripfed a few treats every now and then.
- spion 6y agoThe sad thing is that this isn't an either-or choice. Applications could provide a precise list of dependencies and ranges that they need. Distribution package managers could try to respect those as much as possible, but still have the authority to override a library or two due to security issues, in a centralized manner. Everyone could be reasonably happy if both sides did some work to understand each other and support each other.
- laykg 6y agoWell, the modern package managers are really a monorepo with an exponential numbers of versions in production. No wonder it works for developers.
- 0xbadcafebee 6y agoActually, all software packaging problems today stem from software development practices. Software developers don't make languages, build tools, or dynamic libraries, that support compatibility with different versions of dependencies in a way that is widely compatible. Right now, as a dev, you have to make your code work with one version of a dependency, and hope that the way you did it is widely compatible. But why is this the only way to do it? Because nobody has improved on this model yet. It's actually very simple to fix. Glibc actually already supports loading a specific version of a specific dependency from a specific shared library version for each and every function. So you can build a single app that works with conflicting library versions. Just write your function against one version, and if there's a breaking change, write another version of the function. Then load the right one at run time. Now you support multiple versions of dependencies. Once that becomes a common convention, package managers no longer need to restrict systems to only one version of a dependency, and we no longer have to deal with "bundling". Is this more work for the developer? Yes. But it also solves all the problems that affect developers, packagers, and end users, by allowing for a maximum amount of compatibility. The alternative of course is for devs to just stop writing breaking interfaces, and to handle versions in those interfaces so breaking changes can be handled gracefully.
- pacifika 6y agoHow is keeping compatibility with a historic set of libraries simple?
- 0xbadcafebee 6y agoI guess it's not... I was thinking "simple" in the sense that we have a solution, and we just need to implement it.