From 409f95731e3653c08118c5985b7a29b0da886a46 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 1 Nov 2023 05:48:22 +0800 Subject: [PATCH] shellcheck-minimal: init Expose the minimal and stripped shellcheck package used by writeShellApplication. --- pkgs/build-support/trivial-builders/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 6 ++++++ pkgs/top-level/stage.nix | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index f7adfad455bd..744c7807f463 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, stdenvNoCC, lndir, runtimeShell, shellcheck, haskell }: +{ lib, stdenv, stdenvNoCC, lndir, runtimeShell, shellcheck-minimal }: let inherit (lib) @@ -365,12 +365,12 @@ rec { # GHC (=> shellcheck) isn't supported on some platforms (such as risc-v) # but we still want to use writeShellApplication on those platforms let - shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck.compiler; + shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck-minimal.compiler; excludeOption = lib.optionalString (excludeShellChecks != [ ]) "--exclude '${lib.concatStringsSep "," excludeShellChecks}'"; shellcheckCommand = lib.optionalString shellcheckSupported '' # use shellcheck which does not include docs # pandoc takes long to build and documentation isn't needed for just running the cli - ${lib.getExe (haskell.lib.compose.justStaticExecutables shellcheck.unwrapped)} ${excludeOption} "$target" + ${lib.getExe shellcheck-minimal} ${excludeOption} "$target" ''; in if checkPhase == null then '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 41b2e5493717..9503ef15776f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20088,6 +20088,12 @@ with pkgs; inherit (__splicedPackages.haskellPackages) ShellCheck; }; + + # Minimal shellcheck executable for package checks. + # Use shellcheck which does not include docs, as + # pandoc takes long to build and documentation isn't needed for just running the cli + shellcheck-minimal = haskell.lib.compose.justStaticExecutables shellcheck.unwrapped; + shellharden = callPackage ../development/tools/shellharden { }; schemaspy = callPackage ../development/tools/database/schemaspy { }; diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 1f37bbb70bda..1cc05167cee8 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -110,8 +110,8 @@ let trivialBuilders = self: super: import ../build-support/trivial-builders { inherit lib; - inherit (self) runtimeShell stdenv stdenvNoCC haskell; - inherit (self.pkgsBuildHost) shellcheck; + inherit (self) runtimeShell stdenv stdenvNoCC; + inherit (self.pkgsBuildHost) shellcheck-minimal; inherit (self.pkgsBuildHost.xorg) lndir; };