From 2281b5b618d13330c2aea46d033b25b38c5567d8 Mon Sep 17 00:00:00 2001 From: Bartosz Stebel Date: Sat, 23 Sep 2023 01:42:20 +0200 Subject: [PATCH] env.sh: force CC=clang if present Change-Id: I2369f4ad357b079c2525b7e4cea6d0178aca4c69 Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1630 Reviewed-by: q3k --- env.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/env.sh b/env.sh index 0723030b..578bef1d 100644 --- a/env.sh +++ b/env.sh @@ -16,6 +16,12 @@ hscloud_path="$hscloud_root/bazel-bin/tools:$hscloud_root/bazel-bin/cluster/tool unset -f hscloud_root unset -f hscloud_path +if command -v clang &> /dev/null; then + # if we have clang, use it + # avoids weird PATH issues with linkers, eg https://github.com/bazelbuild/bazel/issues/18834 + export CC=clang +fi + # Leftover junk. This should be removed, as env.sh is now optional. # Do _not_ add more aliases! alias bajzel=bazel