Questions tagged [bazel]

Bazel is a build tool that builds code quickly and reliably. It is used to build the majority of Google's software, and thus it has been designed to handle build problems present in Google's development.

From the Documentation: Overview:

What is Bazel?

Bazel is an open-source build and test tool similar to Make, Maven, and Gradle. It uses a human-readable, high-level build language. Bazel supports projects in multiple languages and builds outputs for multiple platforms. Bazel supports large codebases across multiple repositories, and large numbers of users.

Why should I use Bazel?

Bazel offers the following advantages:

  • High-level build language. Bazel uses an abstract, human-readable language to describe the build properties of your project at a high semantical level. Unlike other tools, Bazel operates on the concepts of libraries, binaries, scripts, and data sets, shielding you from the complexity of writing individual calls to tools such as compilers and linkers.

  • Bazel is fast and reliable. Bazel caches all previously done work and tracks changes to both file content and build commands. This way, Bazel knows when something needs to be rebuilt, and rebuilds only that. To further speed up your builds, you can set up your project to build in a highly parallel and incremental fashion.

  • Bazel is multi-platform. Bazel runs on Linux, macOS, and Windows. Bazel can build binaries and deployable packages for multiple platforms, including desktop, server, and mobile, from the same project.

  • Bazel scales. Bazel maintains agility while handling builds with 100k+ source files. It works with multiple repositories and user bases in the tens of thousands.

  • Bazel is extensible. Many languages are supported, and you can extend Bazel to support any other language or framework.


Resource


Presentation


Community


Related Plugins

3196 questions
1
vote
1 answer

What is the difference between `importmap` and `importpath` in Bazel **BUILD** file

What different functionalities do these two declarations make in a Golang project Bazel BUILD file. example scenario: go_library( name = "go_default_library", srcs = [ "etcd.go", "strategy.go", ], importmap =…
martinkaburu
  • 487
  • 6
  • 18
1
vote
1 answer

What runtime debugging/introspection techniques exist for bazel macros?

I found that adding a print statement to my bazel macros and rule implementations result in console output added to the build such as DEBUG: /home/$USER/repo/source.bzl:82:5: message XYZ And I can even introspect a bit of objects with standard…
jxramos
  • 7,356
  • 6
  • 57
  • 105
1
vote
1 answer

BUILD file from CMake for customized op tensorflow serving

I am new in C++ and I followed this script to build a custom_ops for sentencepiece. From the description they explained, I will get a BUILD file after I run cmake -DSPM_USE_BUILTIN_PROTOBUF=OFF -DSPM_ENABLE_TENSORFLOW_SHARED=ON .. However, I didn't…
davislf2
  • 79
  • 10
1
vote
1 answer

"Unavaliable io exception" when connecting to remote Bazel master on bazel-buildfarm

I want to setup a small POC remote area with 1x master (192.168.60.99) and 1x worker (192.168.60.98) using bazel-buildfarm. Both are CentOS 7 machines provisioned with Vagrant. When connection from a Ubuntu workstation (third machine) in the…
Lion
  • 16,606
  • 23
  • 86
  • 148
1
vote
1 answer

Execute bazel-buildfarm in a production-ready way without "bazel run"

The readme of Bazel-buildfarm says: In general do not execute server binaries with bazel run, since bazel does not support running multiple targets. This sounds like bazel run is designed for local testing-purpose, not for productive servers where…
Lion
  • 16,606
  • 23
  • 86
  • 148
1
vote
1 answer

What logic Bazel build uses to compute inputs and outputs hashes?

Many sources state that in order to speed up the build Bazel computes hashes of the rule inputs and does cache lookup to find pre-built outputs. Unfortunately, I cannot find much details about its logic. For instance, how exactly it calculates the…
Konstantin Erman
  • 551
  • 6
  • 14
1
vote
1 answer

Tensorflow 2 won't compile using bazel on windows 10 - package name error

I am trying to compile Tensorflow 2 c++ API on windows, using this guide: https://itnext.io/how-to-use-your-c-muscle-using-tensorflow-2-0-and-xcode-without-using-bazel-builds-9dc82d5e7f80 All dependencies where downloaded and installed. When getting…
1
vote
1 answer

Bazel logs for postmortem analysis: what were you doing when you crashed?

Suppose you're using bazel to manage builds for a large and diverse project (what it's designed to do). Then you start getting reports of mid-build crashes. Maybe these are on developer machines you don't have access to, maybe they're in transient…
JMAA
  • 1,730
  • 13
  • 24
1
vote
2 answers

Are the bazel buildtools primarily focused on single starlark files?

I'm taking a glance over at the buildtools repo (https://github.com/bazelbuild/buildtools) and trying to understand the scope of its responsibilities as it relates to the three phases of a bazel build (loading, analysis, execution) The repo's…
jxramos
  • 7,356
  • 6
  • 57
  • 105
1
vote
1 answer

When to prefix a BUILD file (*.BUILD) in Bazel

In its C++ unit testing tutorial, Bazel suggests adding a root level gtest.BUILD file to the workspace root in order to properly integrate Google Test into the test project. https://docs.bazel.build/versions/master/cpp-use-cases.html Why would one…
Luke Gehorsam
  • 340
  • 4
  • 16
1
vote
3 answers

Install library built with Bazel

First time bazel user here. I've compiled a library [1], but I'm missing how to install it to prefix /usr/local. Sure I can always copy it around. But what is the bazel way of doing it? [1] https://github.com/google/jwt_verify_lib
benjist
  • 2,740
  • 3
  • 31
  • 58
1
vote
1 answer

Why my TensorFlow Serving using bazel build copt avx2 doesn't help to speed up the inference?

I'm build my tf-serving service with tensorflow-v1.12.0. I've tried all kinds of copt available for my CPU. But the result failed my expectation. The picture below shows the performances for each copt in my project. I was wondering why the copt…
Roy Huang
  • 579
  • 3
  • 23
1
vote
0 answers

IntelliJ "Cannot find declaration to go to" problem in Java projects with Bazel

Recently we switched to use Bazel to build projects in Java. With Bazel, I can no longer use IntelliJ to explore the class declaration etc.. IntelliJ always prompts "Cannot find declaration to go to". I am wondering if anyone has got solution for…
yuyang
  • 1,511
  • 2
  • 15
  • 40
1
vote
0 answers

Bazel returns a rule linking error when building Tensorflow from source

I'm trying to get the InfoGAN code from GitHub to run, but when I try to build Tensorflow from the recommended source code, an error keeps on appearing. It runs fine for about 30 minutes and then crashes (even when sudo is used). The error is as…
1
vote
1 answer

Bazel no longer working after upgrading Visual Studio

I recently upgraded the Visual Studio on my system and bazel build ... no longer works. For example, C:\Users\marki\plasty>bazel build labeling:semantic_seg INFO: Analyzed target //labeling:semantic_seg (0 packages loaded, 0 targets…
Mark
  • 5,286
  • 5
  • 42
  • 73
1 2 3
99
100