4 ms·
> Bazel also obviously uses the system compilers and headers. Nix does not. Bazel allows hermetic toolchains, and uses it for most languages: Java, Python, Go,
by paulddraper 2y ago
> Bazel also obviously uses the system compilers and headers. Nix does not.
Bazel allows hermetic toolchains, and uses it for most languages: Java, Python, Go, Rust, Node.js, etc. You can do the same for C++, but Bazel doesn't provide that out-of-the-box. [1]
Bazel sandboxing can restrict system access on Linux with --experimental_use_hermetic_linux_sandbox and --sandbox_add_mount_pair. [2]
Every "reproducible builds" discussion requires an understand of what is permitted to vary. E.g. Neither Nix nor Bazel attempts to make build products the same for x86 host environments vs ARM host environments. Bazel is less aggressive than Nix in that it does not (by default) attempt to make build products the same for different host C++ compilers.
[1] https://github.com/bazelbuild/bazel/discussions/18332 https://github.com/bazelbuild/bazel/discussions/18332
[2] https://bazel.build/reference/command-line-reference#flag--experimental_use_hermetic_linux_sandbox https://bazel.build/reference/command-line-reference#flag--e...