Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
7 changes: 2 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ build:remote --remote_timeout=7200
# ========================================

# Enable libc++ and C++20 by default.
build:linux --config=clang-local
build:linux --config=clang

# put /usr/local/bin before /usr/bin to avoid picking up wrong python3.6 when building envoy.tls.key_providers.cryptomb
build:linux --action_env=PATH=/usr/lib/llvm/bin:/usr/local/bin:/bin:/usr/bin
build:linux --action_env=PATH=/usr/local/bin:/bin:/usr/bin

# Need for CI image to pickup docker-credential-gcloud, PATH is fixed in rbe-toolchain-* configs.
build:remote-ci --action_env=PATH=/usr/local/google-cloud-sdk/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin
Expand Down Expand Up @@ -50,9 +50,6 @@ build:debug -c dbg
build --cxxopt -Wformat
build --cxxopt -Wformat-security

build:clang --host_action_env=CC=
build:clang --host_action_env=CXX=

# CI sanitizer configuration
#
build:clang-asan-ci --config=asan
Expand Down
10 changes: 1 addition & 9 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,10 @@ config_setting(
},
)

ISTIO_EXTENSIONS = [
"//source/extensions/common/workload_discovery:api_lib", # Experimental: WIP
"//source/extensions/filters/http/alpn:config_lib",
"//source/extensions/filters/http/istio_stats",
"//source/extensions/filters/http/peer_metadata:filter_lib",
"//source/extensions/filters/network/metadata_exchange:config_lib",
]

envoy_cc_binary(
name = "envoy",
repository = "@envoy",
deps = ISTIO_EXTENSIONS + [
deps = [
"@envoy//source/exe:envoy_main_entry_lib",
],
)
Expand Down
13 changes: 2 additions & 11 deletions Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ SHELL := /bin/bash
BAZEL_STARTUP_ARGS ?=
BAZEL_BUILD_ARGS ?=
BAZEL_TARGETS ?= //...
# Don't build Debian packages and Docker images in tests.
BAZEL_TEST_TARGETS ?= ${BAZEL_TARGETS}
E2E_TEST_TARGETS ?= $$(go list ./...)
E2E_TEST_FLAGS := -p=1 -parallel=1
HUB ?=
Expand Down Expand Up @@ -73,21 +71,14 @@ check_wasm:
clean:
@bazel clean

.PHONY: gen-extensions-doc
gen-extensions-doc:
buf generate --path source/extensions/filters

gen:
@scripts/gen-testdata.sh

gen-check:
@scripts/gen-testdata.sh -c

test:
bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) $(BAZEL_CONFIG_CURRENT) -- $(TEST_ENVOY_TARGET) $(BAZEL_TEST_TARGETS)
if [ -n "$(BAZEL_TEST_TARGETS)" ]; then \
bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_BUILD_ARGS) $(BAZEL_CONFIG_CURRENT) -- $(BAZEL_TEST_TARGETS); \
fi
bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) $(BAZEL_CONFIG_CURRENT) -- $(TEST_ENVOY_TARGET)
if [ -n "$(E2E_TEST_TARGETS)" ]; then \
env ENVOY_DEBUG=$(TEST_ENVOY_DEBUG) ENVOY_PATH=$(shell bazel $(BAZEL_STARTUP_ARGS) info $(BAZEL_BUILD_ARGS) $(BAZEL_CONFIG_CURRENT) bazel-bin)/envoy $(E2E_TEST_ENVS) GO111MODULE=on go test -timeout 30m $(E2E_TEST_FLAGS) $(E2E_TEST_TARGETS); \
fi
Expand All @@ -105,7 +96,7 @@ check:
@echo >&2 "Please use \"make lint\" instead."
@false

lint: lint-copyright-banner format-go lint-go tidy-go lint-scripts gen-extensions-doc
lint: lint-copyright-banner format-go lint-go tidy-go lint-scripts
@scripts/check-repository.sh
@scripts/check-style.sh

Expand Down
40 changes: 34 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# 1. Determine SHA256 `wget https://github.com/envoyproxy/envoy/archive/$COMMIT.tar.gz && sha256sum $COMMIT.tar.gz`
# 2. Update .bazelversion, envoy.bazelrc and .bazelrc if needed.
#
# Commit date: 2025-12-02
ENVOY_SHA = "44b00e0264cfcdbbc593998a407b3f957ec28c77"
# Commit date: 2026-01-04
ENVOY_SHA = "2e0b160c0324a7874b033cd11240a3799f374765"

ENVOY_SHA256 = "1c8bc33cf9b758604042212d69d8bc37f41991facc43ed139d070b6b94aeddb0"
ENVOY_SHA256 = "2b103144a1c195722b5aebb6e6ae9510c12c1249b1fff471c9dd4f670ea34859"

ENVOY_ORG = "envoyproxy"

Expand Down Expand Up @@ -64,7 +64,10 @@ envoy_bazel_dependencies()

load("@envoy//bazel:repositories_extra.bzl", "envoy_dependencies_extra")

envoy_dependencies_extra(ignore_root_user_error = True)
envoy_dependencies_extra(
glibc_version = "2.28",
ignore_root_user_error = True,
)

load("@envoy//bazel:python_dependencies.bzl", "envoy_python_dependencies")

Expand All @@ -82,6 +85,31 @@ load("@envoy//bazel:repo.bzl", "envoy_repo")

envoy_repo()

load("@envoy//bazel:toolchains.bzl", "envoy_toolchains")
load("@envoy_repo//:compiler.bzl", "LLVM_PATH")
load("@envoy_toolshed//repository:utils.bzl", "arch_alias")
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")

register_toolchains("@envoy//bazel/rbe/toolchains/configs/linux/gcc/config:cc-toolchain")

arch_alias(
name = "clang_platform",
aliases = {
"amd64": "@envoy//bazel/platforms/rbe:linux_x64",
"aarch64": "@envoy//bazel/platforms/rbe:linux_arm64",
},
)

llvm_toolchain(
name = "llvm_toolchain",
cxx_standard = {"": "c++20"},
llvm_version = "18.1.8",
sysroot = {
"linux-x86_64": "@sysroot_linux_amd64//:sysroot",
"linux-aarch64": "@sysroot_linux_arm64//:sysroot",
},
toolchain_roots = {"": LLVM_PATH} if LLVM_PATH else {},
)

load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")

envoy_toolchains()
llvm_register_toolchains()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this making some build changes?
CC @krinkinmu

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm probably overlooking something, but calling envoy_toolchains() + llvm_register_toolchains() should be enough here as far as I understand.

FWIW, I did the same in my PR migrating to hermetic toolchain, but I think it was just an artifact from my experiments that I didn't cleanup.

9 changes: 9 additions & 0 deletions bazel/extension_config/extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ ENVOY_CONTRIB_EXTENSIONS = {
"envoy.filters.http.golang": "//contrib/golang/filters/http/source:config",
"envoy.filters.http.squash": "//contrib/squash/filters/http/source:config",
"envoy.filters.http.sxg": "//contrib/sxg/filters/http/source:config",
"envoy.filters.http.peer_metadata": "//contrib/istio/filters/http/peer_metadata/source:config",
"envoy.filters.http.istio_stats": "//contrib/istio/filters/http/istio_stats/source:istio_stats",
"envoy.filters.http.alpn": "//contrib/istio/filters/http/alpn/source:config_lib",

#
# Network filters
Expand All @@ -475,6 +478,7 @@ ENVOY_CONTRIB_EXTENSIONS = {
"envoy.filters.network.mysql_proxy": "//contrib/mysql_proxy/filters/network/source:config",
"envoy.filters.network.postgres_proxy": "//contrib/postgres_proxy/filters/network/source:config",
"envoy.filters.network.rocketmq_proxy": "//contrib/rocketmq_proxy/filters/network/source:config",
"envoy.filters.network.metadata_exchange": "//contrib/istio/filters/network/metadata_exchange/source:config",

#
# Sip proxy
Expand Down Expand Up @@ -519,6 +523,11 @@ ISTIO_ENABLED_CONTRIB_EXTENSIONS = [
"envoy.tls.key_providers.cryptomb",
# "envoy.tls.key_providers.qat",
"envoy.network.connection_balance.dlb",
# Extensions that contributed by Istio.
"envoy.filters.network.metadata_exchange",
"envoy.filters.http.alpn",
"envoy.filters.http.peer_metadata",
"envoy.filters.http.istio_stats",
]

EXTENSIONS = dict([(k,v) for k,v in ENVOY_EXTENSIONS.items() if not k in ISTIO_DISABLED_EXTENSIONS] +
Expand Down
14 changes: 3 additions & 11 deletions envoy.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ build --incompatible_merge_fixed_and_default_shell_env
# A workaround for slow ICU download.
build --http_timeout_scaling=6.0

# Pass CC, CXX and LLVM_CONFIG variables from the environment.
# We assume they have stable values, so this won't cause action cache misses.
build --action_env=CC --host_action_env=CC
build --action_env=CXX --host_action_env=CXX
build --action_env=LLVM_CONFIG --host_action_env=LLVM_CONFIG

# Allow stamped caches to bust when local filesystem changes.
# Requires setting `BAZEL_VOLATILE_DIRTY` in the env.
build --action_env=BAZEL_VOLATILE_DIRTY --host_action_env=BAZEL_VOLATILE_DIRTY
Expand Down Expand Up @@ -99,7 +93,6 @@ build:linux --cxxopt=-fsized-deallocation --host_cxxopt=-fsized-deallocation
build:linux --conlyopt=-fexceptions
build:linux --fission=dbg,opt
build:linux --features=per_object_debug_info
build:linux --action_env=BAZEL_LINKOPTS=-lm:-fuse-ld=gold

# macOS
build:macos --action_env=PATH=/opt/homebrew/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
Expand All @@ -114,15 +107,14 @@ build:macos --cxxopt=-Wno-nullability-completeness

# Common flags for Clang (shared between all clang variants)
common:clang-common --linkopt=-fuse-ld=lld
common:clang-common --action_env=BAZEL_COMPILER=clang
common:clang-common --action_env=LDFLAGS="-fuse-ld=lld"
common:clang-common --action_env=CC=clang --host_action_env=CC=clang
common:clang-common --action_env=CXX=clang++ --host_action_env=CXX=clang++
common:clang-common --@toolchains_llvm//toolchain/config:compiler-rt=false
common:clang-common --@toolchains_llvm//toolchain/config:libunwind=false

# Clang with libc++ (default)
common:clang --config=clang-common
common:clang --config=libc++
common:clang --host_platform=@clang_platform
common:clang --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1

# Clang installed to non-standard location (ie not /opt/llvm/)
common:clang-local --config=clang-common
Expand Down
51 changes: 0 additions & 51 deletions extensions/common/BUILD

This file was deleted.

Loading