Bazel

From HPCWIKI
Revision as of 13:13, 29 October 2023 by Admin (talk | contribs) (Created page with "Bazel is a tool that '''automates software builds and tests'''. Supported build tasks include running compilers and linkers to produce executable programs and libraries, and assembling deployable packages for Android, iOS and other target environments<ref>https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwix_f67rJqCAxUErlYBHc29CNkQFnoECAkQAw&url=https%3A%2F%2Fbazel.build%2Fabout%2Ffaq&usg=AOvVaw2LTedC5jnCi-zPHaBwVp9D&opi=89978449</re...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Bazel is a tool that automates software builds and tests. Supported build tasks include running compilers and linkers to produce executable programs and libraries, and assembling deployable packages for Android, iOS and other target environments[1]

Install specific version of bazel

Bazel install page describes multiple way to install bazel, following is our preferred method for automated build scripts that uses various version of bazel depending on the projects.

#example version 6.3.2 
$export _version=6.3.2
$ wget https://github.com/bazelbuild/bazel/releases/download/$_version/bazel-$_version-installer-linux-x86_64.sh
$chmod +x bazel-$_version-installer-linux-x86_64.sh

# to install user only 
$./bazel-$_version-installer-linux-x86_64.sh --user

# to install system-wide  
$./bazel-$_version-installer-linux-x86_64.sh

Tips and tricks

  • How to override the use of output when building with Bazel
    • The default output path is /tmp but depending on the version or default .bazelrc can be different output path, to override output path set --output_base to put all output in a non-default directory
    • bazel --output_base=/dir/path/you/want/to build //foo

References