44 points · by kiyanwang · 9y ago · 31 comments
Unfortunately its quite difficult to get a fully reproducible build with Maven as the post points out. Even if you manage to replicate the build environment and settings, Maven produced binaries will be slightly different on each run. File timestamps are saved in jar files so they change on every build.
Several build systems stress this aspect, include Google's Bazel, in beta.
A Vagrantfile or a Dockerfile are not enough. You need the actual images.
You then get to decide to what extent you want to freeze your exact dependencies or leave them abstract to some degree.
This way, I can override things if needed; and in particular I have continuous integration (Hydra) building both a "stable" (all fixed versions) and "unstable" (all latest versions).
This way I always have a known-good build I can use, but I can still spot impending breakages and bit-rot in CI.
In the case of nixpkgs I don't actually track the very latest commit, since it updates so often. Instead I just `git pull` into a fork every now and again.
I tend not to but generally consider myself on the fence about that one.
They were so hard core about immutability: they had an old code base (Z800? I can no longer remember) that they didn't want to migrate away from even though the hardware was no longer available, so they build an emulator and ran the old code on that on their newer, PPC-based hardware. Newer code ran natively on the PPC).
Their concern: they had SLAs with their customers (not SAAS customers, customers who bought the hardware) of no more than two minutes of downtime per decade.
Never heard of DSC? Yes, famously their hardware brought part of AT&T's network down for 10 hours or so in the late 90s or early 00s. That was the end of DSC.
Another example is someone depends on a library, then that library's author deletes it.
This is why it may be worth committing your dependency's sources, despite "best practices" dictating otherwise. When someone needs to add a feature 10yrs from now and they only have an incomplete package.json & a copy of minified code, they're in for a world of hell.
I even had to recover a project which built non deterministically. Sometimes it would build, sometimes it would error. Running the build several times, it would eventually succeed. The project's author had written their build system against an unstable version of Webpack & Typescript, before they were popular (both of which are now perfectly stable).
Maybe I'm not a hip young web developer but I've always considered "best practice" to be keeping the currently-in-use version of all of your product's dependencies in a repo (either your main one or a separate 'dependencies' repo). If you update the dependency, you test against the new version and check it in if successful.
The idea of letting your build process depend on a third-party library that's downloaded ad-hoc (and may or may not be trustworthy) is terrifying.
I think you may have misunderstood the best practice here. That best practice is you shouldn't just copy the dep code into your repo. The maintenance/release best practice however is that you should always have a copy of all your dependencies available locally and permanently store them. They're two completely separate rules.