Skip to content

Commit 8e05c5f

Browse files
committed
cleanup
1 parent 2a14841 commit 8e05c5f

File tree

137 files changed

+17465
-6968
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+17465
-6968
lines changed

about/faq.mdx

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: 'FAQ'
33
---
44

5+
6+
57
If you have questions or need support, see [Getting Help](/help).
68

79
## What is Bazel?
@@ -12,19 +14,19 @@ Bazel is a tool that automates software builds and tests. Supported build tasks
1214

1315
Bazel was designed to fit the way software is developed at Google. It has the following features:
1416

15-
- Multi-language support: Bazel supports [many languages](/reference/be/overview), and can be extended to support arbitrary programming languages.
16-
- High-level build language: Projects are described in the `BUILD` language, a concise text format that describes a project as sets of small interconnected libraries, binaries and tests. In contrast, with tools like Make, you have to describe individual files and compiler invocations.
17-
- Multi-platform support: The same tool and the same `BUILD` files can be used to build software for different architectures, and even different platforms. At Google, we use Bazel to build everything from server applications running on systems in our data centers to client apps running on mobile phones.
18-
- Reproducibility: In `BUILD` files, each library, test and binary must specify its direct dependencies completely. Bazel uses this dependency information to know what must be rebuilt when you make changes to a source file, and which tasks can run in parallel. This means that all builds are incremental and will always produce the same result.
19-
- Scalable: Bazel can handle large builds; at Google, it is common for a server binary to have 100k source files, and builds where no files were changed take about \~200ms.
17+
* Multi-language support: Bazel supports [many languages](/reference/be/overview), and can be extended to support arbitrary programming languages.
18+
* High-level build language: Projects are described in the `BUILD` language, a concise text format that describes a project as sets of small interconnected libraries, binaries and tests. In contrast, with tools like Make, you have to describe individual files and compiler invocations.
19+
* Multi-platform support: The same tool and the same `BUILD` files can be used to build software for different architectures, and even different platforms. At Google, we use Bazel to build everything from server applications running on systems in our data centers to client apps running on mobile phones.
20+
* Reproducibility: In `BUILD` files, each library, test and binary must specify its direct dependencies completely. Bazel uses this dependency information to know what must be rebuilt when you make changes to a source file, and which tasks can run in parallel. This means that all builds are incremental and will always produce the same result.
21+
* Scalable: Bazel can handle large builds; at Google, it is common for a server binary to have 100k source files, and builds where no files were changed take about ~200ms.
2022

2123
## Why doesn’t Google use...?
2224

23-
- Make, Ninja: These tools give very exact control over what commands get invoked to build files, but it’s up to the user to write rules that are correct.
24-
- Users interact with Bazel on a higher level. For example, Bazel has built-in rules for “Java test”, “C++ binary”, and notions such as “target platform” and “host platform”. These rules have been battle tested to be foolproof.
25-
- Ant and Maven: Ant and Maven are primarily geared toward Java, while Bazel handles multiple languages. Bazel encourages subdividing codebases in smaller reusable units, and can rebuild only ones that need rebuilding. This speeds up development when working with larger codebases.
26-
- Gradle: Bazel configuration files are much more structured than Gradle’s, letting Bazel understand exactly what each action does. This allows for more parallelism and better reproducibility.
27-
- Pants, Buck: Both tools were created and developed by ex-Googlers at Twitter and Foursquare, and Facebook respectively. They have been modeled after Bazel, but their feature sets are different, so they aren’t viable alternatives for us.
25+
* Make, Ninja: These tools give very exact control over what commands get invoked to build files, but it’s up to the user to write rules that are correct.
26+
* Users interact with Bazel on a higher level. For example, Bazel has built-in rules for “Java test”, “C++ binary”, and notions such as “target platform” and “host platform”. These rules have been battle tested to be foolproof.
27+
* Ant and Maven: Ant and Maven are primarily geared toward Java, while Bazel handles multiple languages. Bazel encourages subdividing codebases in smaller reusable units, and can rebuild only ones that need rebuilding. This speeds up development when working with larger codebases.
28+
* Gradle: Bazel configuration files are much more structured than Gradle’s, letting Bazel understand exactly what each action does. This allows for more parallelism and better reproducibility.
29+
* Pants, Buck: Both tools were created and developed by ex-Googlers at Twitter and Foursquare, and Facebook respectively. They have been modeled after Bazel, but their feature sets are different, so they aren’t viable alternatives for us.
2830

2931
## Where did Bazel come from?
3032

@@ -46,10 +48,10 @@ Bazel runs build operations locally by default. However, Bazel can also connect
4648

4749
For our server code base, we use the following development workflow:
4850

49-
- All our server code is in a single, gigantic version control system.
50-
- Everybody builds their software with Bazel.
51-
- Different teams own different parts of the source tree, and make their components available as `BUILD` targets.
52-
- Branching is primarily used for managing releases, so everybody develops their software at the head revision.
51+
* All our server code is in a single, gigantic version control system.
52+
* Everybody builds their software with Bazel.
53+
* Different teams own different parts of the source tree, and make their components available as `BUILD` targets.
54+
* Branching is primarily used for managing releases, so everybody develops their software at the head revision.
5355

5456
Bazel is a cornerstone of this philosophy: since Bazel requires all dependencies to be fully specified, we can predict which programs and tests are affected by a change, and vet them before submission.
5557

@@ -61,22 +63,24 @@ Building software should be fun and easy. Slow and unpredictable builds take the
6163

6264
## Why would I want to use Bazel?
6365

64-
- Bazel may give you faster build times because it can recompile only the files that need to be recompiled. Similarly, it can skip re-running tests that it knows haven’t changed.
65-
- Bazel produces deterministic results. This eliminates skew between incremental and clean builds, laptop and CI system, etc.
66-
- Bazel can build different client and server apps with the same tool from the same workspace. For example, you can change a client/server protocol in a single commit, and test that the updated mobile app works with the updated server, building both with the same tool, reaping all the aforementioned benefits of Bazel.
66+
* Bazel may give you faster build times because it can recompile only the files that need to be recompiled. Similarly, it can skip re-running tests that it knows haven’t changed.
67+
* Bazel produces deterministic results. This eliminates skew between incremental and clean builds, laptop and CI system, etc.
68+
* Bazel can build different client and server apps with the same tool from the same workspace. For example, you can change a client/server protocol in a single commit, and test that the updated mobile app works with the updated server, building both with the same tool, reaping all the aforementioned benefits of Bazel.
6769

6870
## Can I see examples?
6971

70-
Yes; see a [simple example](https://github.com/bazelbuild/bazel/blob/master/examples/cpp/BUILD) or read the [Bazel source code](https://github.com/bazelbuild/bazel/blob/master/src/BUILD) for a more complex example.
72+
Yes; see a [simple example](https://github.com/bazelbuild/bazel/blob/master/examples/cpp/BUILD)
73+
or read the [Bazel source code](https://github.com/bazelbuild/bazel/blob/master/src/BUILD) for a more complex example.
74+
7175

7276
## What is Bazel best at?
7377

7478
Bazel shines at building and testing projects with the following properties:
7579

76-
- Projects with a large codebase
77-
- Projects written in (multiple) compiled languages
78-
- Projects that deploy on multiple platforms
79-
- Projects that have extensive tests
80+
* Projects with a large codebase
81+
* Projects written in (multiple) compiled languages
82+
* Projects that deploy on multiple platforms
83+
* Projects that have extensive tests
8084

8185
## Where can I run Bazel?
8286

@@ -86,13 +90,11 @@ Porting to other UNIX platforms should be relatively easy, as long as a JDK is a
8690

8791
## What should I not use Bazel for?
8892

89-
- Bazel tries to be smart about caching. This means that it is not good for running build operations whose outputs should not be cached. For example, the following steps should not be run from Bazel:
90-
91-
- A compilation step that fetches data from the internet.
92-
- A test step that connects to the QA instance of your site.
93-
- A deployment step that changes your site’s cloud configuration.
94-
95-
- If your build consists of a few long, sequential steps, Bazel may not be able to help much. You’ll get more speed by breaking long steps into smaller, discrete targets that Bazel can run in parallel.
93+
* Bazel tries to be smart about caching. This means that it is not good for running build operations whose outputs should not be cached. For example, the following steps should not be run from Bazel:
94+
* A compilation step that fetches data from the internet.
95+
* A test step that connects to the QA instance of your site.
96+
* A deployment step that changes your site’s cloud configuration.
97+
* If your build consists of a few long, sequential steps, Bazel may not be able to help much. You’ll get more speed by breaking long steps into smaller, discrete targets that Bazel can run in parallel.
9698

9799
## How stable is Bazel’s feature set?
98100

@@ -130,10 +132,10 @@ Yes, you can use our [Docker rules](https://github.com/bazelbuild/rules_docker)
130132

131133
For Java and C++ binaries, yes, assuming you do not change the toolchain. If you have build steps that involve custom recipes (for example, executing binaries through a shell script inside a rule), you will need to take some extra care:
132134

133-
- Do not use dependencies that were not declared. Sandboxed execution (–spawn\_strategy=sandboxed, only on Linux) can help find undeclared dependencies.
134-
- Avoid storing timestamps and user-IDs in generated files. ZIP files and other archives are especially prone to this.
135-
- Avoid connecting to the network. Sandboxed execution can help here too.
136-
- Avoid processes that use random numbers, in particular, dictionary traversal is randomized in many programming languages.
135+
* Do not use dependencies that were not declared. Sandboxed execution (–spawn\_strategy=sandboxed, only on Linux) can help find undeclared dependencies.
136+
* Avoid storing timestamps and user-IDs in generated files. ZIP files and other archives are especially prone to this.
137+
* Avoid connecting to the network. Sandboxed execution can help here too.
138+
* Avoid processes that use random numbers, in particular, dictionary traversal is randomized in many programming languages.
137139

138140
## Do you have binary releases?
139141

@@ -177,8 +179,8 @@ We still have to refactor the interfaces between the public code in Bazel and ou
177179

178180
Open sourcing Bazel is a work-in-progress. In particular, we’re still working on open sourcing:
179181

180-
- Many of our unit and integration tests (which should make contributing patches easier).
181-
- Full IDE integration.
182+
* Many of our unit and integration tests (which should make contributing patches easier).
183+
* Full IDE integration.
182184

183185
Beyond code, we’d like to eventually have all code reviews, bug tracking, and design decisions happen publicly, with the Bazel community involved. We are not there yet, so some changes will simply appear in the Bazel repository without clear explanation. Despite this lack of transparency, we want to support external developers and collaborate. Thus, we are opening up the code, even though some of the development is still happening internal to Google. Please let us know if anything seems unclear or unjustified as we transition to an open model.
184186

@@ -188,7 +190,7 @@ Yes, some of the code base either integrates with Google-specific technology or
188190

189191
## How do I contact the team?
190192

191-
We are reachable at [bazel-discuss@googlegroups.com](mailto:bazel-discuss@googlegroups.com).
193+
We are reachable at bazel-discuss@googlegroups.com.
192194

193195
## Where do I report bugs?
194196

0 commit comments

Comments
 (0)