Рет қаралды 274
Nix and Bazel: The Odd Couple of Build Tools - Jesse Schalken, Canva
A talk on why Nix and Bazel does not pair with each other well, recommending to use Bazel and bzlmod instead of Nix. Specifically, Nix is a package manager that is often misintegrated into Bazel. It is incompatible with the Bazel ecosystem in that * Nix artifacts are not relocatable, breaking Bazel remote execution when Nix outputs are in the build graph * Nix binaries are incompatible with FHS and rulesets that expect FHS because binaries are located in Nix store * Users who are familiar with Bazel are (usually) not familiar with Nix. Our engineers are often unable to self-serve patches to Nix packages, and they are also unable to use the testing framework provided by Bazel (which are familiar to most engineers) to validate their patches because of the steep learning curves * At monorepo our size, it is not rare to see Nix expressions that produces several thousand derivations that each reference large sets of build inputs. Expression evaluations are often so slow that nix-builds are in the critical path during analysis phase, even though outputs are already in the Nix cache. Nix flakes can help but it has an awkward git integration which does not work very well in large monorepos