News for hackers. Stuff that matters.
Re:Bazel 8.0 by jeffbee on Monday December 09, 2024 @06:04PM (#42371566)
It has that "worst, except for all the others" quality. It's getting much easier to use with bzlmod, at least for the C++ stuff and especially if you have no weird requirements. I also strongly prefer its toolchain model over others, having recently needed to convert a large C++ project from host GNU tools to hermetic LLVM tools. From time to time I ponder converting projects to cmake but I no longer perceive any advantages.
Re:Bazel 8.0 by ashishb on Monday December 09, 2024 @06:16PM (#42371672)
Any advantage for using Bazel for newer languages that have a standardized dependency setup like Go or Rust? Or even for JS/TS, where almost everyone uses npm/pnpm/yarn?
Re:Bazel 8.0 by mrdomino_ on Monday December 09, 2024 @07:43PM (#42372359)
Other folks have said “mixed languages” and “monorepos” and I agree; I’ll also add that it incorporates steps like building Docker/OCI images, tarballs, potentially even deb/rpm packages all in one place, and with the same sandboxing and deterministic reproducibility as you get with the base language rules.

Like, “I want an OCI image with these contents” gets you an image with the exact files bit-for-bit from the same source, every time. At least aspirationally.

Re:Bazel 8.0 by liuliu on Monday December 09, 2024 @06:49PM (#42371930)
If you have mixed-language needs, yes. But if not, standardized setup is far better with IDE integration (mostly, VS code LSP etc).
Re:Bazel 8.0 by jeffbee on Monday December 09, 2024 @06:19PM (#42371691)
I personally don't use it for Go or Rust, so maybe the answer is "no"? There's no native builder for C++ so the utility of Bazel for that language is more apparent.
Re:Bazel 8.0 by phinnaeus on Monday December 09, 2024 @06:47PM (#42371919)
Talk about Bazel in the context of a specific language is missing the point. Bazel is for huge monorepos that aren't based on a single language so that you can have a common interface for all your code in the monorepo regardless of what language individual bits are written in.
Re:Bazel 8.0 by kldx on Monday December 09, 2024 @08:31PM (#42372688)
Cargo workspaces do not support compiling two subprojects for two different targets in a single build invocation. The workaround was (still is?) to use each subproject as a standalone project just for builds. The dependency between these targets is now expressed by the Makefile invoking cargo. This also breaks IDE integrations because your IDE does not know how to ask cargo to pick the right target for each workspace member.

Bazel makes this consistent with platforms [0]. I have not used bazel with Rust but it worked fine for my multi-target C++ builds.

[0] https://bazel.build/extending/platforms