aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-04-23 19:16:57 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-04-24 08:05:31 +0000
commit84ca98f9e1bb10f2e754c5fb8e5cc9c58ac6c276 (patch)
treee1b63dc3e83522ad9a0398e277a7bb6f9d02918a /pkg/vcs
parent115705cda4423243a7453daae9df02e281f7ba41 (diff)
pkg/vcs: use clang-15 for builds up to v6.15
Otherwise we need to backport too many fix commits to address build/boot errors.
Diffstat (limited to 'pkg/vcs')
-rw-r--r--pkg/vcs/linux.go6
-rw-r--r--pkg/vcs/linux_test.go8
2 files changed, 11 insertions, 3 deletions
diff --git a/pkg/vcs/linux.go b/pkg/vcs/linux.go
index c0b96aaa4..e34fe9186 100644
--- a/pkg/vcs/linux.go
+++ b/pkg/vcs/linux.go
@@ -160,10 +160,12 @@ func (ctx *linux) EnvForCommit(
func linuxClangPath(tags map[string]bool, binDir, defaultCompiler string) string {
version := ""
+ // The defaultCompiler and clang-15 are assumed to be available.
switch {
- case tags["v5.9"]:
- // Verified to work with 14.0.6.
+ case tags["v6.15"]:
return defaultCompiler
+ case tags["v5.9"]:
+ return "clang-15"
default:
// everything before v5.3 might not work great
// everything before v5.1 does not work
diff --git a/pkg/vcs/linux_test.go b/pkg/vcs/linux_test.go
index 5e81760a2..eb742c625 100644
--- a/pkg/vcs/linux_test.go
+++ b/pkg/vcs/linux_test.go
@@ -19,9 +19,15 @@ func TestClangVersion(t *testing.T) {
expected := binDir + "llvm-9.0.1/bin/clang"
assert.Equal(t, actual, expected, "unexpected clang path")
- // Recent tag case.
+ // Older tag case.
tags["v5.9"] = true
actual = linuxClangPath(tags, binDir, defaultCompiler)
+ expected = "clang-15"
+ assert.Equal(t, actual, expected, "unexpected clang path")
+
+ // Recent tag case.
+ tags["v6.15"] = true
+ actual = linuxClangPath(tags, binDir, defaultCompiler)
expected = defaultCompiler
assert.Equal(t, actual, expected, "unexpected clang path")
}