Things a program must not do under Bazel
Blog post from Aspect Build
Bazel, a build and test tool, emphasizes the importance of creating portable and hermetic builds, which necessitate explicit declarations of tool dependencies and avoiding assumptions about the environment, such as tools being in the PATH or relying on the working directory's location. It is crucial to use Bazel's toolchain feature for locating tools and to remember that the working directory is set at the root of the workspace, allowing for any necessary changes after Bazel starts a process. Inputs should be treated as read-only, and any writing should be directed to the output directory instead. Additionally, developers should avoid resolving symlinks of inputs, as this can lead to non-hermetic builds or logic errors, and should not depend on stdin/stdout for communication due to Bazel's possible use of these for protocols. Finally, configurations should not rely solely on command-line arguments due to potential length limits, and using a configuration or params file is recommended for managing CLI flags.
No tracked trend matches for this post yet.