diff --git a/pkgs/development/compilers/llvm/common/clang-tools/default.nix b/pkgs/development/compilers/llvm/common/clang-tools/default.nix index 91daa95d07cf..4fab7f98164d 100644 --- a/pkgs/development/compilers/llvm/common/clang-tools/default.nix +++ b/pkgs/development/compilers/llvm/common/clang-tools/default.nix @@ -3,6 +3,7 @@ stdenv, runCommand, writeText, + bashNonInteractive, clang-unwrapped, clang, libcxxClang, @@ -20,6 +21,8 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; __structuredAttrs = true; + buildInputs = [ bashNonInteractive ]; + installPhase = '' runHook preInstall @@ -63,9 +66,11 @@ stdenv.mkDerivation (finalAttrs: { passthru.tests = let src = writeText "main.cpp" '' + #include #include int main() { + assert(true); std::cout << "Hi!"; } ''; @@ -76,6 +81,10 @@ stdenv.mkDerivation (finalAttrs: { ${finalAttrs.finalPackage}/bin/clangd --check=${src} touch $out ''; + smokeOkClangTidy = runCommand "clang-tidy-test-smoke-ok" { } '' + ${finalAttrs.finalPackage}/bin/clang-tidy ${src} + touch $out + ''; smokeErr = runCommand "clang-tools-test-smoke-err" { } '' (${finalAttrs.finalPackage}/bin/clangd --query-driver='**' --check=${src} 2>&1 || true) \ | grep 'use of undeclared identifier' diff --git a/pkgs/development/compilers/llvm/common/clang-tools/wrapper b/pkgs/development/compilers/llvm/common/clang-tools/wrapper index 6601d6875f8e..247d858b9488 100755 --- a/pkgs/development/compilers/llvm/common/clang-tools/wrapper +++ b/pkgs/development/compilers/llvm/common/clang-tools/wrapper @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash buildcpath() { local path after