4 ms·
Bazel has a heavy focus on correctness (pretty much to the exclusion of everything else). Where does Moon fall on the correctness gradient? Does it enforce herm
by jpgvm 4y ago
Bazel has a heavy focus on correctness (pretty much to the exclusion of everything else). Where does Moon fall on the correctness gradient? Does it enforce hermecity or deterministic builds or give me tools to accomplish it?
In the same vein as those questions how does caching work? Is it content based like Bazel or mtime like Nx et al? If there is no sandboxing does it do input tracking or is there manual "cache key" shenanigans?
If the configuration language is YAML how am I expected to implement new behavior? Is that in Rust? Is there a plugin architecture? Do I need to rebuild the tool itself and redistribute it to my build machines and developers? The main appeal of Starlark/Python in build systems is ability to create macros or in many cases define entirely new rulesets to support new tools and languages without needing to modify the complex and performance sensitive core.
Sorry for the skeptisicm but build systems are very complex beasts and new entrants like Nx don't measure up to tools like Bazel very well.
- thundergolfer 4y agoTo be clear, Bazel focuses on correctness because it's essential to acheiving performance at scale. If you don't have correct caching of intermediate build artifacts, a system can't handle the compile and test requirements of large codebases.
- malkia 4y agothat +1000
- mileswjohnson 4y ago> Does it enforce hermecity or deterministic builds or give me tools to accomplish it? I wouldn't say moon is hermetic, nor are we trying to be. We don't use the sandbox approach for tasks, and run against the original files. For the languages we support, this works best. As for deterministic, we try to be. We have a "toolchain" where we download languages/tools in the background, and run tasks using these tools. This ensures, at minimum, that the same version/variant of a tool is used across machines. > In the same vein as those questions how does caching work? It's content based. We also hash other kinds of inputs depending on the language that is running. > If the configuration language is YAML how am I expected to implement new behavior? (and other questions) Our focus right now is on non-compiled languages, primarily web languages, where custom behavior (like Starlark) is not necessary. In the future, this may change.
- IshKebab 4y agoHow do you target large codebases then? The whole point of hermeticity is to allow you to reliably not rebuild and test everything on every commit which is the issue most large codebases have. Also a bit disingenuous to describe it as language agnostic if it only really works with non-compiled languages.
- mileswjohnson 4y agomoon will only run on affected projects, so you're not building/testing everything. This is done through a combination of hashing + caching. It's also language agnostic because you can technically run anything through moon, but support may vary. https://moonrepo.dev/docs/faq#can-we-run-other-languages https://moonrepo.dev/docs/faq#can-we-run-other-languages
- IshKebab 4y ago> moon will only run on affected projects, so you're not building/testing everything But you can only reliably know what is affected through hermeticity. > It's also language agnostic because you can technically run anything through moon That's just calling out to another build system though. I don't think it really counts.
- andrew_ 4y agoBazel as a taskrunner/build system is to most monorepos as a Pile Driver [1] is to a floorboard nail. It will do everything but it's massive overkill. We are agreed that Nx doesn't measure up, but I wouldn't compare it to Bazel. [1] https://en.wikipedia.org/wiki/Pile_driver https://en.wikipedia.org/wiki/Pile_driver
- rfoo 4y agoFair point. I treated the product as a build system and it just doesn't look right. However it makes perfect sense if it advertised itself as a "task runner".
- malkia 4y agoWhen you start having 100 applications (a typical game may have that amount), even if only 10 of them are thorouhgly tested, you end up needing that pile driver, or you end up compiling all 100 of these on every presubmit. Just sayin.
- hamandcheese 4y agoI 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.
- eisbaw 4y agoBazel plus nix.
- hamandcheese 4y agoThis 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).
- qazxcvbnm 4y agoI 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/distributed-builds.html https://nixos.org/manual/nix/unstable/advanced-topics/distri...
- IshKebab 4y agoYou 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?
- hamandcheese 4y agoI wouldn't call it a bazel-like, per-se, but Nix seems to have tamed C++. I don't think it was easy, though.