News for hackers. Stuff that matters.
Re:Launch HN: Moonrepo (YC W23) – Open-source build system by hamandcheese on Wednesday February 22, 2023 @01:27AM (#34892347)
I think it's hilarious to say bazel focuses on correctness when it doesn't ship with any hermetic toolchains by default. Properly setting up hermetic toolchains is poorly documented and left as an exercise to the reader.

I say this as someone who wants to love bazel... I just can't understand why it picks up impure toolchains from the system at all.

Re:Launch HN: Moonrepo (YC W23) – Open-source build system by eisbaw on Wednesday February 22, 2023 @02:15AM (#34892634)
Bazel plus nix.
Re:Launch HN: Moonrepo (YC W23) – Open-source build system by hamandcheese on Wednesday February 22, 2023 @05:47AM (#34893941)
This feels like the way, but comes with the huge caveat that it doesn't work with bazel remote execution (unless you can rig up something to sync your nix store to every remote builder).
Re:Launch HN: Moonrepo (YC W23) – Open-source build system by qazxcvbnm on Wednesday February 22, 2023 @09:54AM (#34896488)
I haven't used it personally, but the Nix manual mentions support for dealing with Nix stores in distributed builds https://nixos.org/manual/nix/unstable/advanced-topics/distri...
Re:Launch HN: Moonrepo (YC W23) – Open-source build system by IshKebab on Wednesday February 22, 2023 @02:34AM (#34892759)
You have to remember that it was the very first system to even attempt hermetic & deterministic builds.

Combine that with the fact that C++ toolchains at least make assumptions all over the place about being spewed over `/usr`... I think they just bowed out to practicality at that point.

You're definitely right it should use hermetic toolchains. I'm curious which other Bazel-like build system does that by default?

Re:Launch HN: Moonrepo (YC W23) – Open-source build system by hamandcheese on Wednesday February 22, 2023 @05:44AM (#34893926)
I wouldn't call it a bazel-like, per-se, but Nix seems to have tamed C++.

I don't think it was easy, though.

Re:Launch HN: Moonrepo (YC W23) – Open-source build system by IshKebab on Wednesday February 22, 2023 @10:29AM (#34897095)
As I understand it Nix can do hermeticity on a project level, but not on a build step level like you would need for actual development. So it's good for building OSes. Not for building software products.
Re:Launch HN: Moonrepo (YC W23) – Open-source build system by hamandcheese on Thursday February 23, 2023 @12:38AM (#34907164)
I agree they target slightly different use cases, but I don't think that's a good excuse for why bazel can't be more hermetic out of the box.
Re:Launch HN: Moonrepo (YC W23) – Open-source build system by mananaysiempre on Wednesday February 22, 2023 @09:10AM (#34895728)
> You have to remember that it was the very first system to even attempt hermetic & deterministic builds.

Given its Google-internal predecessors, it’s not clear how priority should be established (the general guideline in science is that non-public is not science, but that might not be what we care about here). The public Bazel, though, is from 2015, while the first releases of Nix date back all the way to 2004[1] and the thesis is from 2006.

Now Nix is not really at its best if used as a general-purpose build system, but it certainly has and uses hermetic toolchains.

[1] https://releases.nixos.org/nix/nix-0.5/manual/manual.html

Re:Launch HN: Moonrepo (YC W23) – Open-source build system by pharmakom on Wednesday February 22, 2023 @02:37AM (#34892781)
Yeah it can be done but it's painful. In general the Bazel rules are lower quality than Bazel itself - and rules_python is one of the better ones!
Re:Launch HN: Moonrepo (YC W23) – Open-source build system by simfoo on Wednesday February 22, 2023 @05:35AM (#34893880)
I agree this is one of the biggest weak points of Bazel. It lacks a distribution that provides all these goodies out of the box, with maintained and documented workflows. Setting up hermetic builds and remote caches, builds & execution requires a whole team of experts right now.