linux-perf: If clang is in PATH, pass "CLANG=" + shutil.which("clang")

When clang is installed I get `clang: Permission denied`.
Setting CLANG to the full path of clang fixes this.

Signed-off-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
This commit is contained in:
Bernhard Kaindl 2024-08-07 12:00:00 +02:00
parent 6007a77a33
commit 831b4a3e4a

View File

@ -5,6 +5,7 @@
import os.path
import re
import shutil
from textwrap import dedent
import llnl.util.tty as tty
@ -56,6 +57,7 @@ class LinuxPerf(Package):
)
variant("jvmti", default=False, description="build jvmti agent")
depends_on("c", type="build")
depends_on("gmake", type="build")
depends_on("pkgconfig", type="build")
depends_on("flex", type="build")
@ -121,6 +123,12 @@ def install(self, spec, prefix):
"LIBUNWIND_DIR={}".format(spec["libunwind"].prefix),
"NO_SHELLCHECK=1",
]
# Setup clang if found in the system's or env's PATH:
clang = shutil.which("clang")
if clang:
args.append("CLANG=" + clang)
# Features to check post-install against `perf version --build-options`
checks = {"dwarf", "libunwind", "libbfd", "zlib"}