diff --git a/Formula/envoy.rb b/Formula/envoy.rb index baf73f1ee7f3..64db9e1ff3d4 100644 --- a/Formula/envoy.rb +++ b/Formula/envoy.rb @@ -20,6 +20,24 @@ class Envoy < Formula depends_on "ninja" => :build depends_on macos: :catalina + on_linux do + # GCC added as a test dependency to work around Homebrew issue. Otherwise `brew test` fails. + # CompilerSelectionError: envoy cannot be built with any available compilers. + depends_on "gcc@9" => [:build, :test] + depends_on "python@3.9" => :build + end + + # https://github.com/envoyproxy/envoy/tree/main/bazel#supported-compiler-versions + fails_with gcc: "5" + fails_with gcc: "6" + # GCC 10 build fails at external/com_google_absl/absl/container/internal/inlined_vector.h:469:5: + # error: '.absl::inlined_vector_internal::Storage >::data_' + # is used uninitialized in this function [-Werror=uninitialized] + fails_with gcc: "10" + # GCC 11 build fails at external/boringssl/src/crypto/curve25519/curve25519.c:503:57: + # error: argument 2 of type 'const uint8_t[32]' with mismatched bound [-Werror=array-parameter=] + fails_with gcc: "11" + # Work around xcode 12 incompatibility until envoyproxy/envoy#17393 patch do url "https://github.com/envoyproxy/envoy/commit/3b49166dc0841b045799e2c37bdf1ca9de98d5b1.patch?full_index=1" @@ -27,14 +45,19 @@ class Envoy < Formula end def install + env_path = "#{HOMEBREW_PREFIX}/bin:/usr/bin:/bin" + on_linux do + env_path = "#{Formula["python@3.9"].opt_libexec}/bin:#{env_path}" + end args = %W[ - -c - opt + --compilation_mode=opt --curses=no --show_task_finish --verbose_failures - --action_env=PATH=#{HOMEBREW_PREFIX}/bin:/usr/bin:/bin + --action_env=PATH=#{env_path} + --host_action_env=PATH=#{env_path} ] + system Formula["bazelisk"].opt_bin/"bazelisk", "build", *args, "//source/exe:envoy-static" bin.install "bazel-bin/source/exe/envoy-static" => "envoy" pkgshare.install "configs", "examples"