From 89cdf1a803f1754210b69696181b73d78a47b2c9 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Tue, 30 Jun 2026 17:10:36 +0100 Subject: [PATCH 1/2] git: fix update script The existing update script is clearly broken, since it's trying to update the package definition in a file that hasn't existed for a long time. Replace it with a tested invocation of `nix-update`. --- pkgs/by-name/gi/git/package.nix | 13 ++++++++++++- pkgs/by-name/gi/git/update.sh | 19 ------------------- 2 files changed, 12 insertions(+), 20 deletions(-) delete mode 100755 pkgs/by-name/gi/git/update.sh diff --git a/pkgs/by-name/gi/git/package.nix b/pkgs/by-name/gi/git/package.nix index bda0344badb9..53b6854f57f8 100644 --- a/pkgs/by-name/gi/git/package.nix +++ b/pkgs/by-name/gi/git/package.nix @@ -55,6 +55,7 @@ rustSupport ? lib.meta.availableOn stdenv.hostPlatform rustc, cargo, rustc, + nix-update-script, }: assert osxkeychainSupport -> stdenv.hostPlatform.isDarwin; @@ -616,7 +617,17 @@ stdenv.mkDerivation (finalAttrs: { }; } // tests.fetchgit; - updateScript = ./update.sh; + + # We get the source from the release packages, since that contains a few + # extra files that make the build easier without already having a Git + # installation. We get the version from GitHub, however, as that provides + # a nicer API for checking what the latest version is. + updateScript = nix-update-script { + extraArgs = [ + "--url" + "https://github.com/git/git" + ]; + }; }; meta = { diff --git a/pkgs/by-name/gi/git/update.sh b/pkgs/by-name/gi/git/update.sh deleted file mode 100755 index 7aa1e90d53b3..000000000000 --- a/pkgs/by-name/gi/git/update.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl common-updater-scripts jq git - -set -eu -o pipefail - -oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion git" | tr -d '"')" -latestTag="$(git ls-remote --tags --sort="v:refname" https://github.com/git/git.git | grep -v '{}' | grep -v '\-rc' | tail -1 | sed 's|^.*/v\(.*\)|\1|')" -targetVersion="${1:-$latestTag}" - -if [ ! "${oldVersion}" = "${targetVersion}" ]; then - update-source-version git "${targetVersion}" - nixpkgs="$(git rev-parse --show-toplevel)" - default_nix="$nixpkgs/pkgs/applications/version-management/git/default.nix" - nix-build -A git - git add "${default_nix}" - git commit -m "git: ${oldVersion} -> ${targetVersion}" -else - echo "git is already up-to-date" -fi From 7d44dc49ab50decbbe70519b159818b095afd88c Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Tue, 30 Jun 2026 17:18:21 +0100 Subject: [PATCH 2/2] git: 2.54.0 -> 2.55.0 Changelog: https://github.com/git/git/blob/v2.55.0/Documentation/RelNotes/2.55.0.adoc Packaging changes: - disable the t1517 test, since it's clearly fragile when run against an installed Git package - change Rust argument handling to match the upstream project's switch from Rust being opt-in to opt-out - explicitly set `debug` to an empty string in the installCheck flags, to avoid the test suite printing debug output and triggering new failures in the test harness - remove an osx/rust patch that has been fixed upstream --- .../gi/git/osxkeychain-link-rust_lib.patch | 15 -------- pkgs/by-name/gi/git/package.nix | 36 +++++++++++-------- 2 files changed, 22 insertions(+), 29 deletions(-) delete mode 100644 pkgs/by-name/gi/git/osxkeychain-link-rust_lib.patch diff --git a/pkgs/by-name/gi/git/osxkeychain-link-rust_lib.patch b/pkgs/by-name/gi/git/osxkeychain-link-rust_lib.patch deleted file mode 100644 index a0015f87888d..000000000000 --- a/pkgs/by-name/gi/git/osxkeychain-link-rust_lib.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -ur a/Makefile b/Makefile ---- a/Makefile 2026-02-14 15:58:16.624434564 -0500 -+++ b/Makefile 2026-02-14 15:59:25.701016105 -0500 -@@ -4059,9 +4059,9 @@ - contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT) - $(AR) $(ARFLAGS) $@ $^ - --contrib/credential/osxkeychain/git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain.o $(LIB_FILE) GIT-LDFLAGS -+contrib/credential/osxkeychain/git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain.o $(LIB_FILE) $(RUST_LIB) GIT-LDFLAGS - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ -- $(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation -+ $(filter %.o,$^) $(LIB_FILE) $(RUST_LIB) $(EXTLIBS) -framework Security -framework CoreFoundation - - contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS - $(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $< diff --git a/pkgs/by-name/gi/git/package.nix b/pkgs/by-name/gi/git/package.nix index 53b6854f57f8..a6fe8a13efc3 100644 --- a/pkgs/by-name/gi/git/package.nix +++ b/pkgs/by-name/gi/git/package.nix @@ -63,7 +63,7 @@ assert sendEmailSupport -> perlSupport; assert svnSupport -> perlSupport; let - version = "2.54.0"; + version = "2.55.0"; svn = subversionClient.override { perlBindings = perlSupport; }; gitwebPerlLibs = with perlPackages; [ CGI @@ -105,7 +105,7 @@ stdenv.mkDerivation (finalAttrs: { }.tar.xz" else "https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz"; - hash = "sha256-9okWI2TBDeee+Jqo2/SHMesFfjTtu9IKylEM4BVGgaM="; + hash = "sha256-RX/bBNyHKOAH1GiGleaRLm9oByeSDypAvxHqzBdQU1c="; }; outputs = [ "out" ] ++ lib.optional withManual "doc"; @@ -133,17 +133,6 @@ stdenv.mkDerivation (finalAttrs: { url = "https://lore.kernel.org/git/20260504101429.340123-1-joerg@thalheim.io/raw"; hash = "sha256-44EPfEJ39LjPWjqjFb52EKNaJGzYxZzJaJOis8QnazU="; }) - # Address test failure (new in 2.52.0) caused by `git-gui--askyesno` being - # installed by `make install`. - (fetchurl { - name = "expect-gui--askyesno-failure-in-t1517.patch"; - url = "https://lore.kernel.org/git/20251201031040.1120091-1-brianmlyles@gmail.com/raw"; - hash = "sha256-vvhbvg74OIMzfksHiErSnjOZ+W0M/T9J8GOQ4E4wKbU="; - }) - ] - ++ lib.optionals rustSupport [ - # The above patch doesn’t work with Rust support enabled. - ./osxkeychain-link-rust_lib.patch ] ++ lib.optionals withSsh [ # Hard-code the ssh executable to ${pkgs.openssh}/bin/ssh instead of @@ -272,7 +261,7 @@ stdenv.mkDerivation (finalAttrs: { # See https://github.com/Homebrew/homebrew-core/commit/dfa3ccf1e7d3901e371b5140b935839ba9d8b706 ++ lib.optional stdenv.hostPlatform.isDarwin "TKFRAMEWORK=/nonexistent" # Starting with future Git version 3.0.0, rust will be mandatory. For now, it's optional. - ++ lib.optional rustSupport "WITH_RUST=YesPlease"; + ++ lib.optional (!rustSupport) "NO_RUST=YesPlease"; disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ stdenv.shellPackage @@ -493,6 +482,13 @@ stdenv.mkDerivation (finalAttrs: { installCheckFlags = [ "DEFAULT_TEST_TARGET=prove" "PERL_PATH=${buildPackages.perl}/bin/perl" + + # Without setting debug explicitly, the test suite inherits the value of + # debug from the environment, which -- if separateDebugInfo is true -- will + # be the debug output path. The test suite then prints out extra debug + # info, as if `--debug` were passed on the command line, which causes test + # failures because that info can't be interpreted by the test harness. + "debug=" ]; nativeInstallCheckInputs = lib.optional ( @@ -553,6 +549,18 @@ stdenv.mkDerivation (finalAttrs: { disable_test t7513-interpret-trailers disable_test t2200-add-update + # Fails when run with GIT_TEST_INSTALLED, that is, when we're testing an + # installed package rather than the build output prior to installation. + # This test is fragile when testing an installed package even in Nix's + # otherwise clean build environment, upstream haven't been keen on patching + # individual failures when they crop up, and nobody has yet managed to + # rewrite the test to be less fragile. + # + # See in particular the below messages and discussions around them: + # https://lore.kernel.org/git/xmqqect7fhnp.fsf@gitster.g/ + # https://lore.kernel.org/git/20251201031040.1120091-1-brianmlyles@gmail.com/ + disable_test t1517-outside-repo + # Fails reproducibly on ZFS on Linux with formD normalization disable_test t0021-conversion disable_test t3910-mac-os-precompose