From e45ab99143e4a1fd11568b3d2dc85e90742357e9 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Sat, 7 Sep 2024 12:35:41 +0100 Subject: [PATCH] Revert "bazel/ci: Dont break caches with `PATH` (#35978)" This reverts commit c85c065660e76c768aa318906aff622dd3e87761. Signed-off-by: Ryan Northey --- .bazelrc | 4 ++-- bazel/setup_clang.sh | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index efb8e171dc518..90b9b112b1702 100644 --- a/.bazelrc +++ b/.bazelrc @@ -260,14 +260,14 @@ build:rbe-toolchain-clang --platforms=@envoy_build_tools//toolchains:rbe_linux_c build:rbe-toolchain-clang --host_platform=@envoy_build_tools//toolchains:rbe_linux_clang_platform build:rbe-toolchain-clang --crosstool_top=@envoy_build_tools//toolchains/configs/linux/clang/cc:toolchain build:rbe-toolchain-clang --extra_toolchains=@envoy_build_tools//toolchains/configs/linux/clang/config:cc-toolchain -build:rbe-toolchain-clang --action_env=CC=clang --action_env=CXX=clang++ +build:rbe-toolchain-clang --action_env=CC=clang --action_env=CXX=clang++ --action_env=PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin build:rbe-toolchain-clang-libc++ --config=rbe-toolchain build:rbe-toolchain-clang-libc++ --platforms=@envoy_build_tools//toolchains:rbe_linux_clang_libcxx_platform build:rbe-toolchain-clang-libc++ --host_platform=@envoy_build_tools//toolchains:rbe_linux_clang_libcxx_platform build:rbe-toolchain-clang-libc++ --crosstool_top=@envoy_build_tools//toolchains/configs/linux/clang_libcxx/cc:toolchain build:rbe-toolchain-clang-libc++ --extra_toolchains=@envoy_build_tools//toolchains/configs/linux/clang_libcxx/config:cc-toolchain -build:rbe-toolchain-clang-libc++ --action_env=CC=clang --action_env=CXX=clang++ +build:rbe-toolchain-clang-libc++ --action_env=CC=clang --action_env=CXX=clang++ --action_env=PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin build:rbe-toolchain-clang-libc++ --action_env=CXXFLAGS=-stdlib=libc++ build:rbe-toolchain-clang-libc++ --action_env=LDFLAGS=-stdlib=libc++ build:rbe-toolchain-clang-libc++ --define force_libcpp=enabled diff --git a/bazel/setup_clang.sh b/bazel/setup_clang.sh index 19093d071a2bd..46308db868b42 100755 --- a/bazel/setup_clang.sh +++ b/bazel/setup_clang.sh @@ -11,6 +11,9 @@ if [[ ! -e "${LLVM_PREFIX}/bin/llvm-config" ]]; then exit 1 fi +PATH="$("${LLVM_PREFIX}"/bin/llvm-config --bindir):${PATH}" +export PATH + LLVM_VERSION="$(llvm-config --version)" LLVM_LIBDIR="$(llvm-config --libdir)" LLVM_TARGET="$(llvm-config --host-target)" @@ -18,6 +21,7 @@ LLVM_TARGET="$(llvm-config --host-target)" RT_LIBRARY_PATH="${LLVM_LIBDIR}/clang/${LLVM_VERSION}/lib/${LLVM_TARGET}" echo "# Generated file, do not edit. If you want to disable clang, just delete this file. +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)'