From f36a6aac48e377ef408e00943b669c4b15bba19a Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Tue, 24 Mar 2026 11:40:02 +0900 Subject: [PATCH] Add gitMinimal to all shell environments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cabal needs git on PATH for source-repository-package stanzas in cabal.project files. Without it, builds fail with Cabal-6666. This was observed in IntersectMBO/cardano-db-sync#2085 where 6 out of 9 failing CI jobs reported "The program 'git' is required but it could not be found." Add gitMinimal (146 MiB closure) instead of git (1.5 GiB) to all four shell definitions — the same package nixpkgs uses for fetchgit. The 10x smaller closure matters for container images built from devx shells. - dynamic.nix: add gitMinimal to buildInputs, drop redundant git from withGHCTooling (gitMinimal now covers it) - static.nix: add gitMinimal to nativeBuildInputs - cross-js.nix: add gitMinimal to nativeBuildInputs - cross-windows.nix: add pkgsBuildBuild.gitMinimal to nativeBuildInputs --- cross-js.nix | 1 + cross-windows.nix | 1 + dynamic.nix | 3 ++- static.nix | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cross-js.nix b/cross-js.nix index aca8e83..7307801 100644 --- a/cross-js.nix +++ b/cross-js.nix @@ -104,6 +104,7 @@ pkgs.mkShell ({ perl stdenv.cc.cc.lib which + gitMinimal ]) ++ (with pkgs.buildPackages; [ ]) ++ builtins.attrValues haskell-tools diff --git a/cross-windows.nix b/cross-windows.nix index b359a49..1c216bb 100644 --- a/cross-windows.nix +++ b/cross-windows.nix @@ -211,6 +211,7 @@ pkgs.pkgsBuildBuild.mkShell ({ pkgsBuildBuild.perl stdenv.cc.cc.lib pkgsBuildBuild.which + pkgsBuildBuild.gitMinimal ]) ++ map pkgs.lib.getDev (with pkgs; [ zlib pcre openssl diff --git a/dynamic.nix b/dynamic.nix index 5d2728c..00ff737 100644 --- a/dynamic.nix +++ b/dynamic.nix @@ -125,6 +125,7 @@ pkgs.mkShell { pcre pkg-config which + gitMinimal zlib ]) ++ optional stdenv.hostPlatform.isLinux pkgs.systemd @@ -135,7 +136,7 @@ pkgs.mkShell { ) ++ attrValues haskell-tools ++ optionals withGHCTooling ( - with pkgs; [ python3 automake autoconf alex happy git libffi.dev ] + with pkgs; [ python3 automake autoconf alex happy libffi.dev ] ) ; diff --git a/static.nix b/static.nix index e06927c..c0126d1 100644 --- a/static.nix +++ b/static.nix @@ -161,6 +161,7 @@ pkgs.mkShell (rec { perl stdenv.cc.cc.lib which + gitMinimal ]) ++ (with pkgs.buildPackages; [ ]) ++ builtins.attrValues haskell-tools