From 831b4a3e4a9d3f7299a04a16817b0b3fdb4c61d8 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Wed, 7 Aug 2024 12:00:00 +0200 Subject: 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 --- var/spack/repos/builtin/packages/linux-perf/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/linux-perf/package.py b/var/spack/repos/builtin/packages/linux-perf/package.py index afd94f988d..ddbd08224f 100644 --- a/var/spack/repos/builtin/packages/linux-perf/package.py +++ b/var/spack/repos/builtin/packages/linux-perf/package.py @@ -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 @@ class LinuxPerf(Package): "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"} -- cgit v1.2.3-70-g09d2