diff --git a/bazel/README.md b/bazel/README.md index 497412a941705..b1be84925a72b 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -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 @@ -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: ``` @@ -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 @@ -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 diff --git a/ci/README.md b/ci/README.md index d7375cfc10c27..1f3c4301fb304 100644 --- a/ci/README.md +++ b/ci/README.md @@ -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