Description
Consider the following case where you have an app with a dependency on a module (modA) that has a dependency on another module (modB).
App --> modA --> modB
modB is released with a bug. For the examples sake, the bug causes goroutines to not be garbage collected and the number to continue to grow. This bug has been experienced in a real world application.
The developer of modA realizes this bug exists and sets the minimum version to the last stable release that does not contain the bug.
The developer of the App decides to update the dependencies to the latest releases (e.g., go get -u ./...
). Alternatively, the apps developer could import a second dependency (modC) that also depends on modB but at the latest release because they did not catch the bug. Some bugs don't show up on tests but rather in long running situations which is why I choose the goroutine example.
There is currently no way for the author of modA to pass along information that modB has a bad releases. We need a way to communicate that information for those periods where that release is in the wild and one to use.
Existing tools like glide and dep let you say not to use a release. This is idea shows up in most other languages dependency management as well (e.g., !=1.2.3
).
An idea was suggested, rather quickly and off the cuff, by @rsc to setup a web service to hold the information on buggy versions that should not be used. There are a few constraints that make this idea difficult:
- Who can post details on what versions of what tools are incompatible? There is an opportunity to troll through manipulation of the data
- How is access handled when packages can be hosted by VCS and you can't always count on GitHub
- There is an information leakage problem where data on the dependencies of a proprietary app could be leaked to this services host. For example, a rival to Google is working on an app but leaking the dependencies they use to Google as a host of the service which gives lots of detail. We shouldn't have a case where data is leaked like that
This is a problem because of two things:
- When not vendoring you lose the ability to easily diff the changes to dependencies
- A mass number of developers never really check the changes to their dependencies when they pull in updates
- A bug like this could be easily missed when updating, even for the trained eye, which I posit few will do
How will the Go toolchain handle this situation?