News for hackers. Stuff that matters.
Re:Exodus: Easily migrate your JVM code from Maven to Bazel by georgewfraser on Tuesday April 06, 2021 @08:58PM (#26719339)
Bazel guarantees that each build step depends only on its declared inputs, and that each step is deterministic. So if the inputs to a step have not changed, Bazel can skip that step and use a cached copy of the result of that step. If you break up a large multi module build into a tree of small steps, Bazel can perform an incremental build after a small change in a few minutes, even though running the entire build from scratch would take hours.
Re:Exodus: Easily migrate your JVM code from Maven to Bazel by chrisseaton on Tuesday April 06, 2021 @09:08PM (#26719408)
> Bazel guarantees that each build step depends only on its declared inputs

How does it enforce that? Does it sandbox the compiler or something? Java compiler annotation processors can perform arbitrary IO.

Re:Exodus: Easily migrate your JVM code from Maven to Bazel by colatkinson on Tuesday April 06, 2021 @09:32PM (#26719564)
Exactly that: https://docs.bazel.build/versions/master/sandboxing.html

There's also (I believe experimental) support for using Docker as a sandbox backend. That ends up being useful if you're using the remote build execution support: you can run a build locally in exactly the same environment it will run on a build farm.

Re:Exodus: Easily migrate your JVM code from Maven to Bazel by chrisseaton on Tuesday April 06, 2021 @09:55PM (#26719712)
I wonder if this stops you reading the clock and random number sources during build?

(I once accidentally baked a time and random number into a binary myself - and the random number thing would have been a serious security bug if we had not found it with test coverage. Would have been better if the build system disallowed it.)

Re:Exodus: Easily migrate your JVM code from Maven to Bazel by rockwotj on Tuesday April 06, 2021 @10:38PM (#26719994)
You can actually input system stuff like this via: https://docs.bazel.build/versions/master/user-manual.html#fl...

They already have support for build times and labels, but you can add arbitrary stuff like got hashes too

Re:Exodus: Easily migrate your JVM code from Maven to Bazel by izacus on Wednesday April 07, 2021 @05:38AM (#26722402)
It can't stop you doing dumb things in code (e.g. use #pragmas or variables in C++ code) which will probably make your build behave funny, because it'll cache outputs not knowing that they're supposed to change.

You can of course define these as variables, but that'll just drop all your caches on each build which eliminates the main selling point of Bazel.

Re:Exodus: Easily migrate your JVM code from Maven to Bazel by vbezhenar on Wednesday April 07, 2021 @07:07AM (#26723156)
I don’t see Windows in supported systems for sandboxfs. I guess that would make bazel not suitable for most developers.
Re:Exodus: Easily migrate your JVM code from Maven to Bazel by dikei on Tuesday April 06, 2021 @10:20PM (#26719887)
You have to declare all input explicitly, including your compiler and Bazel will monitor them: Any changes in input files, compilers or even some environmental variables like $PATH will trigger a rebuild.

Bazel can use sandbox as an additional layer to prevent you from accessing undeclared inputs, but the sandbox is optional and can be turned off.

Re:Exodus: Easily migrate your JVM code from Maven to Bazel by deepsun on Tuesday April 06, 2021 @09:26PM (#26719512)
Maven does exactly that as well. The term is "artifacts" in Maven.
Re:Exodus: Easily migrate your JVM code from Maven to Bazel by brown9-2 on Tuesday April 06, 2021 @10:02PM (#26719757)
Most plugins do not though, and will happily do stuff like run static analysis or lint rules over code that hasn’t changed from the last build 30 seconds ago.