envoyproxy / envoy-openssl

Envoy OpenSSL extensions
Apache License 2.0
46 stars 44 forks source link

bazel: Fix optional dynamic linking of OpenSSL #17

Closed vadorovsky closed 4 years ago

vadorovsky commented 4 years ago

Before this change, README was suggesting to replace Envoy repo_mapping from boringssl to openssl_shared. That solution was working only for the Envoy repository, but bssl_wrapper was still using openssl as a dependency.

Because of that, even after re-mapping Envoy to shared OpenSSL, Bazel was still downloading the OpenSSL tarball and using it for bssl_wrapper.

This change fixes that issue by defining functions in openssl.bzl file. Both of them define openssl repository. The first one (openssl_repository) uses the OpenSSL tarball. The second one (openssl_shared_repository) uses shared OpenSSL library.

WORKSPACE by default calls the openssl_repository function and has a commented call to the openssl_shared_repository function. If someone wants to build Envoy with shared OpenSSL, the first function call should be commented and the second one uncommented.

Signed-off-by: Michal Rostecki mrostecki@opensuse.org

vadorovsky commented 4 years ago

@mythi

vadorovsky commented 4 years ago

I will try to do that according to @mythi's idea. It's better if I do it from scratch in a new PR.