Conversation
Signed-off-by: Kateryna Nezdolii <kateryna.nezdolii@gmail.com>
d1bb8b5 to
59f848c
Compare
| BAZEL_BUILD_OPTS += --platforms=$(BAZEL_PLATFORM) | ||
|
|
||
| BAZEL_BUILD_OPTS += --config=clang | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)'
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
When building locally
cilium-envoy,cilium-envoy-starterviamake installfor linux amd64/arm64, compilation failed with:this is because overriden clang version is not being propagated to the build: