Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions bazel/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
# Building Envoy with Bazel

## Installing Bazelisk as Bazel

It is recommended to use [Bazelisk](https://github.com/bazelbuild/bazelisk) installed as `bazel`, to avoid Bazel compatibility issues.
On Linux, run the following commands:

```
sudo wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v0.0.8/bazelisk-linux-amd64
sudo chmod +x /usr/local/bin/bazel
```

On macOS, run the follwing command:
```
brew install bazelbuild/tap/bazelisk
```

If you're building from an revision of Envoy prior to August 2019, which doesn't contains a `.bazelversion` file, run `ci/run_envoy_docker.sh "bazel version"`
to find the right version of Bazel and set the version to `USE_BAZEL_VERSION` environment variable to build.

## Production environments

To build Envoy with Bazel in a production environment, where the [Envoy
dependencies](https://www.envoyproxy.io/docs/envoy/latest/install/building.html#requirements) are typically
independently sourced, the following steps should be followed:

1. Install the latest version of [Bazel](https://bazel.build/versions/master/docs/install.html) in your environment.
2. Configure, build and/or install the [Envoy dependencies](https://www.envoyproxy.io/docs/envoy/latest/install/building.html#requirements).
3. `bazel build //source/exe:envoy-static` from the repository root.
1. Configure, build and/or install the [Envoy dependencies](https://www.envoyproxy.io/docs/envoy/latest/install/building.html#requirements).
1. `bazel build -c opt //source/exe:envoy-static` from the repository root.

## Quick start Bazel build for developers

Expand All @@ -21,7 +38,6 @@ up-to-date with the latest security patches. See
[this doc](https://github.com/envoyproxy/envoy/blob/master/bazel/EXTERNAL_DEPS.md#updating-an-external-dependency-version)
for how to update or override dependencies.

1. Install the latest version of [Bazel](https://bazel.build/versions/master/docs/install.html) in your environment.
1. Install external dependencies libtool, cmake, ninja, realpath and curl libraries separately.
On Ubuntu, run the following command:
```
Expand Down Expand Up @@ -109,7 +125,7 @@ accordingly.
## Building Envoy with Docker sandbox

Building Envoy with Docker sandbox uses the same Docker image used in CI with fixed C++ toolchain configuration. It produces more consistent
output which is depending on your local C++ toolchain. It can also help debugging issues with RBE. To build Envoy with Docker sandbox:
output which is not depending on your local C++ toolchain. It can also help debugging issues with RBE. To build Envoy with Docker sandbox:

```
bazel build //source/exe:envoy-static --config=docker-clang
Expand Down Expand Up @@ -490,7 +506,7 @@ have seen some issues with seeing the artifacts tab. If you can't see it, log ou
then log back in and it should start working.

The latest coverage report for master is available
[here](https://s3.amazonaws.com/lyft-envoy/coverage/report-master/coverage.html).
[here](https://s3.amazonaws.com/lyft-envoy/coverage/report-master/index.html).

It's also possible to specialize the coverage build to a specified test or test dir. This is useful
when doing things like exploring the coverage of a fuzzer over its corpus. This can be done by
Expand Down
5 changes: 3 additions & 2 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ master commit at which the binary was compiled, and `latest` corresponds to a bi
Currently there are three build images:

* `envoyproxy/envoy-build` — alias to `envoyproxy/envoy-build-ubuntu`.
* `envoyproxy/envoy-build-ubuntu` — based on Ubuntu 16.04 (Xenial) which uses the GCC 5.4 compiler.
* `envoyproxy/envoy-build-ubuntu` — based on Ubuntu 16.04 (Xenial) with GCC 7 and Clang 8 compiler.
* `envoyproxy/envoy-build-centos` — based on CentOS 7 with GCC 7 and Clang 8 compiler, this image is experimental and not well tested.

We also install and use the clang-8 compiler for some sanitizing runs.
We use the Clang compiler for all CI runs with tests. We have an additional CI run with GCC which builds binary only.

# Building and running tests as a developer

Expand Down