Skip to content

Bazel tips and tricks

Sayantan Sarkar edited this page Aug 24, 2019 · 6 revisions

Checking if bazel exists

  1. Check if machine has bazel by running which bazel
  2. Run bazel version. If it complains "somedir not found" try mkdir somedir

Installing bazel on a brand new machine

  1. Get the recommended bazel using the following command: wget https://github.com/bazelbuild/bazel/releases/download/<VERSION>/bazel-<VERSION>-installer-linux-x86_64.sh. See README.md for exact version
  2. mkdir ~/.cache/bazel/
  3. Make a directory/localdisk/<username>/bazel_cache/_bazel_<username> Then, use it for caching: ln -sf /localdisk/<username>/bazel_cache/_bazel_<username> ~/.cache/bazel/_bazel_<username>
  4. Install bazel bash bazel-0.25.2-installer-linux-x86_64.sh --user
  5. ls /localdisk/<username>/bazel_cache/_bazel_<username>/ should show 2 items, one names install
Clone this wiki locally