5 ms·
> Bazel is a fully reproducible and hermetic build system. Yes, and it's very important to note that Bazel does nothing to solve the problem about having a rep
by bobsomers 4y ago
> Bazel is a fully reproducible and hermetic build system.
Yes, and it's very important to note that Bazel does nothing to solve the problem about having a reproducible and hermetic runtime. Even if you think you aren't linking against anything dynamically, you are probably linking against several system libraries which must be present in the same versions to get reproducible and hermetic behavior.
This is solvable with Docker or exceptionally arcane Linux hackery, but it's completely missing from the Bazel messaging and it often leaves people thinking it provides more than it really does.
- hxtk 4y agoOthers have mentioned statically linked binaries. I thought I'd mention I actually use Bazel to build most of my docker images, and unlike Docker itself, Bazel rules_docker builds reproducible (i.e., same digest) container images by default.
- ihgann 4y agoIt’s also easily solvable with Nix (which I would hope continues to gain traction).
- Rapzid 4y agoNix, Hurd, and Haskell will walk into a bar.. Soon!
- ihgann 4y agoMy main OS is NixOS… and for exercise I do CrossFit. Maybe I just like cults ^_^
- seabrookmx 4y agoAt minimum you're self aware :)
- amscanne 4y agoBazel is perfectly capable of producing static binaries, if that's what you want. It's not fair to say that does nothing to solve this problem, it simply does not mandate that the artifacts it produces are static.
- bobsomers 4y agoMost static binaries are not completely statically linked. The system libstdc++ and libc as well as a few other things are almost always linked dynamically. In particular, it’s almost impossible to get glibc to link statically. You need to switch to musl or another libc that supports it.
- staticassertion 4y agoOther than libc I'm not sure what else would "almost always" be linked. It's going to depend on the language, but for Go/Rust at least static linking is pretty much the default, and lots of people even link to musl. For other languages I'd say openssl is probably the next most common.
- manwe150 4y agoPlatform ABI typically specifies that libatomic must be dynamically linked, since otherwise libdl will misbehave. Lots of other common libraries including libpthreads, libm, libgfortran, libquadmath also are frequently linked (though commonly now are linked into libc.so for better system performance)
- staticassertion 4y agoNever even heard of libatomic, where is it specified that it's required to dynamically linked? I'm surprised to hear that.
- sph 4y agoThose are all glibc or GCC libraries. There is no platform ABI mandate nor Linux kernel requirement for userspace applications to be dynamically linked to anything. If you can talk to the kernel, you can do anything those libraries can do.
- c0mptonFP 4y agoBeing mindful of system library versions is deployment 101. They're dependencies after all. Also, I do prefer to avoid dynamic linking altogether.
- baby 4y agoAren’t there people who use both nix and bazel?
- kaba0 4y agoFrom what I read, they don’t play too nicely with each other.
- pharmakom 4y agoI think this is out of scope for a build system.