Skip to content
Open
Changes from all 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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ BAZEL_PLATFORM := //bazel:linux_$(subst amd64,x86_64,$(subst arm64,aarch64,$(TAR
$(info BUILDING on $(BUILDARCH) for $(TARGETARCH) using $(BAZEL_PLATFORM))
BAZEL_BUILD_OPTS += --platforms=$(BAZEL_PLATFORM)

BAZEL_BUILD_OPTS += --config=clang

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO this would be better added to .bazelrc, right after importing envoy.bazelrc. Should also figure out if we need anything else from the generated clang.bazelrc file where this was already.

Copy link
Copy Markdown
Author

@nezdolik nezdolik Mar 19, 2026

Choose a reason for hiding this comment

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

not sure i fully understand/agree. We still need to tell bazel to use clang config when building cilium-envoy-proxy (by default it will use gcc). bazelrc file just contains different build configs. Or did you mean to include clang config into release config? E.g.

build:release --config=clang

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

but also may need some of those:

build:clang --action_env='PATH=${PATH}' --host_action_env='PATH=${PATH}'
build:clang --action_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' --host_action_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config'
build:clang --repo_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config'
build:clang --linkopt='-L$(llvm-config --libdir)'
build:clang --linkopt='-Wl,-rpath,$(llvm-config --libdir)'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is OK to make all builds use clang, IMO. We no longer test any builds with GCC.

Either keep the current clang setup script and amend the Makefiles to use it on all targets, or remove it and figure out what of the generated clang.bazelrc has to be moved to .bazelrc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I will proceed with option 1 now (less effort). Envoy has switched to hermetic toolchain in https://github.com/envoyproxy/envoy/pull/39679/changes, this is smth we would benefit from as well.

ifdef DEBUG
BAZEL_BUILD_OPTS += -c dbg
else ifdef RELEASE_DEBUG
Expand Down
Loading