patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Cc: Yureka Lilian <yureka@cyberchaos.dev>
Subject: [PATCH] tools: use llvmPackages as input
Date: Tue,  4 Nov 2025 19:33:00 +0100	[thread overview]
Message-ID: <20251104183300.3153163-1-hi@alyssa.is> (raw)

This makes sure that clang and clang-tidy will be using the same
version of LLVM.  (It's looking like we might also need LLVM libunwind
at some point, so that's another thing we could take from a single
llvmPackages.)

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
 tools/default.nix | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/default.nix b/tools/default.nix
index 398f570..06b7ed2 100644
--- a/tools/default.nix
+++ b/tools/default.nix
@@ -5,9 +5,9 @@
 import ../lib/call-package.nix (
 { src, lib, stdenv, fetchCrate, fetchurl, runCommand, buildPackages
 , meson, ninja, pkg-config, rustc
-, clang-tools, clippy, jq
+, llvmPackages, clippy, jq
 , dbus, linuxHeaders
-, clang, libbpf
+, libbpf
 , buildSupport ? false
 , appSupport ? true
 , hostSupport ? false
@@ -86,7 +86,7 @@ stdenv.mkDerivation (finalAttrs: {
   nativeBuildInputs = [ meson ninja ]
     ++ lib.optionals (appSupport || driverSupport) [ pkg-config ]
     ++ lib.optionals hostSupport [ rustc ]
-    ++ lib.optionals driverSupport [ clang.cc ];
+    ++ lib.optionals driverSupport [ llvmPackages.clang-unwrapped ];
   buildInputs = lib.optionals appSupport [ dbus ]
     ++ lib.optionals driverSupport [ libbpf linuxHeaders ];
 
@@ -121,7 +121,7 @@ stdenv.mkDerivation (finalAttrs: {
 
         # clang-tools needs to be before clang, otherwise it will not use
         # the Nix include path correctly and fail to find headers
-        nativeBuildInputs = [ clang-tools jq ] ++ nativeBuildInputs;
+        nativeBuildInputs = [ llvmPackages.clang-tools jq ] ++ nativeBuildInputs;
 
         buildPhase = ''
           jq -r '.[].file | select(endswith(".c"))' compile_commands.json |

base-commit: 1d666582892fbdf812662b4490caf7821078eaf9
-- 
2.51.0


             reply	other threads:[~2025-11-04 18:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04 18:33 Alyssa Ross [this message]
2025-11-13 11:25 ` [PATCH] tools: use llvmPackages as input Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251104183300.3153163-1-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=devel@spectrum-os.org \
    --cc=yureka@cyberchaos.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).