diff --git a/WORKSPACE b/WORKSPACE index ef120bc53d4f..a96cba501302 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -12,6 +12,10 @@ load("//bazel:repositories.bzl", "envoy_dependencies") envoy_dependencies() +load("//bazel:repositories_extra.bzl", "envoy_dependencies_extra") + +envoy_dependencies_extra() + load("//bazel:dependency_imports.bzl", "envoy_dependency_imports") envoy_dependency_imports() diff --git a/bazel/EXTERNAL_DEPS.md b/bazel/EXTERNAL_DEPS.md index 7793129376aa..7eebe1c3ec2b 100644 --- a/bazel/EXTERNAL_DEPS.md +++ b/bazel/EXTERNAL_DEPS.md @@ -6,7 +6,9 @@ values can change when Github change their tar/gzip libraries breaking builds. Maintainer provided tarballs are more stable and the maintainer can provide the SHA256. -# Adding external dependencies to Envoy (native Bazel) +# Adding external dependencies to Envoy (C++) + +## Native Bazel This is the preferred style of adding dependencies that use Bazel for their build process. @@ -17,7 +19,7 @@ build process. `external_deps` attribute. 3. `bazel test //test/...` -# Adding external dependencies to Envoy (external CMake) +## External CMake (preferred) This is the preferred style of adding dependencies that use CMake for their build system. @@ -29,7 +31,8 @@ This is the preferred style of adding dependencies that use CMake for their buil `external_deps` attribute. 4. `bazel test //test/...` -# Adding external dependencies to Envoy (genrule repository) + +## genrule repository This is the newer style of adding dependencies with no upstream Bazel configs. It wraps the dependency's native build tooling in a Bazel-aware shell script, @@ -54,6 +57,24 @@ Dependencies between external libraries can use the standard Bazel dependency resolution logic, using the `$(location)` shell extension to resolve paths to binaries, libraries, headers, etc. +# Adding external dependencies to Envoy (Python) + +Python dependencies should be added via `pip3` and `rules_python`. The process +is: + +1. Define a `pip3_import()` pointing at your target `requirements.txt` in + [`bazel/repositories_extra.bzl`](repositories_extra.bzl) + +2. Add a `pip_install()` invocation in + [`bazel/dependency_imports.bzl`](dependency_imports.bzl). + +3. Add a `requirements("