From 2b5899382f6cb897c8a48409c12a886a7fd66ac4 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Fri, 3 Jan 2025 10:35:39 +0000 Subject: [PATCH 1/3] git: build documentation in build phase For build process clarity, build documentation during the build phase. Without this change, the docs are built during the install phase as that's when `make` realises they're not yet present. This also means that the main Git documentation is built before the contrib/subtree documentation, which is necessary for the subtree documentation to build successfully in Git v2.48.0-rc0 and -rc1 (and presumably therefore in v2.48.0 when it is released). --- pkgs/applications/version-management/git/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index 4dd0f9c7c888..55862f97067a 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -138,8 +138,13 @@ stdenv.mkDerivation (finalAttrs: { ]; - postBuild = '' - make -C contrib/subtree + postBuild = (lib.optionalString withManual '' + # Need to build the main Git documentation before building the + # contrib/subtree documentation, as the latter depends on the + # asciidoc.conf file created by the former. + make -C Documentation + '') + '' + make -C contrib/subtree all ${lib.optionalString withManual "doc"} '' + (lib.optionalString perlSupport '' make -C contrib/diff-highlight '') + (lib.optionalString osxkeychainSupport '' From 5a847c0878cf9cb19e49144a5d126aa35d6ef509 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Fri, 10 Jan 2025 21:13:57 +0000 Subject: [PATCH 2/3] git: 2.47.2 -> 2.48.1 This version change includes a change to the contents of the .git directory, which results in changes to hashes for any fetchgit invocations that set leaveDotGit to true. Per the fetchgit documentation and discussions in #372784, the contents of the .git directory are not stable, so anyone using that should either only be using it for temporary testing purposes, or should be removing the .git directory in fetchgit's postFetch phase, so before the hash is calculated. That means there's no need to do any other handling here to avoid compatibility problems, and can just update the relevant hashes in the fetchgit tests. There's still a chance this will break some other builds because of the change to the contents of the .git directory. If so, whoever's responsible for those other derivations should either stop using leaveDotGit, or should follow the documented advice to remove the .git directory in the postFetch phase. --- pkgs/applications/version-management/git/default.nix | 4 ++-- pkgs/build-support/fetchgit/tests.nix | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index 55862f97067a..a28d370cf85e 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -30,7 +30,7 @@ assert sendEmailSupport -> perlSupport; assert svnSupport -> perlSupport; let - version = "2.47.2"; + version = "2.48.1"; svn = subversionClient.override { perlBindings = perlSupport; }; gitwebPerlLibs = with perlPackages; [ CGI HTMLParser CGIFast FCGI FCGIProcManager HTMLTagCloud ]; in @@ -43,7 +43,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchurl { url = "https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz"; - hash = "sha256-sZJovmtvFVa0ep3YNCcuFn06dXQM3NKDzzgS7f/jkw8="; + hash = "sha256-HF1UX13B61HpXSxQ2Y/fiLGja6H6MOmuXVOFxgJPgq0="; }; outputs = [ "out" ] ++ lib.optional withManual "doc"; diff --git a/pkgs/build-support/fetchgit/tests.nix b/pkgs/build-support/fetchgit/tests.nix index f3fcd9a578de..a9185a72693f 100644 --- a/pkgs/build-support/fetchgit/tests.nix +++ b/pkgs/build-support/fetchgit/tests.nix @@ -33,7 +33,7 @@ name = "leave-git-nix-source"; url = "https://github.com/NixOS/nix"; rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a"; - sha256 = "sha256-zZxDxqaeWvuWuzwPizBLR7d59zP24+zqnWllNICenko="; + sha256 = "sha256-3YYVIeaeu6zO7bBkZxF+1d5VS0K2GHYEZwChB3tPJ4s="; leaveDotGit = true; }; @@ -49,7 +49,7 @@ name = "submodule-leave-git-source"; url = "https://github.com/pineapplehunter/nix-test-repo-with-submodule"; rev = "26473335b84ead88ee0a3b649b1c7fa4a91cfd4a"; - sha256 = "sha256-+uXIClcRJ4S1rdgx2Oyww+Jv4h1VXp8tfeh9lb07Fhk="; + sha256 = "sha256-0pwleO/m4Iws3BF9ewyWbYMcGfEJLS3BYzWfDSYtXs8="; leaveDotGit = true; fetchSubmodules = true; }; @@ -58,7 +58,7 @@ name = "submodule-deep-source"; url = "https://github.com/pineapplehunter/nix-test-repo-with-submodule"; rev = "26473335b84ead88ee0a3b649b1c7fa4a91cfd4a"; - sha256 = "sha256-LL7uhXQk3N3DcvBBxwjmfVx55tTXCGQ19T91tknopzw="; + sha256 = "sha256-eRHOwolRZDJS/5zk88e7SdoO7nKKtjDXMLVsyFPFgk8="; deepClone = true; fetchSubmodules = true; }; @@ -67,7 +67,7 @@ name = "submodule-leave-git-deep-source"; url = "https://github.com/pineapplehunter/nix-test-repo-with-submodule"; rev = "26473335b84ead88ee0a3b649b1c7fa4a91cfd4a"; - sha256 = "sha256-LL7uhXQk3N3DcvBBxwjmfVx55tTXCGQ19T91tknopzw="; + sha256 = "sha256-eRHOwolRZDJS/5zk88e7SdoO7nKKtjDXMLVsyFPFgk8="; deepClone = true; leaveDotGit = true; fetchSubmodules = true; From 49b67490f840e04446ecc967391688b74deafb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 20 Jan 2025 14:08:52 +0100 Subject: [PATCH 3/3] git: drop optional brackets --- .../version-management/git/default.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index a28d370cf85e..ded7316167c7 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -138,20 +138,20 @@ stdenv.mkDerivation (finalAttrs: { ]; - postBuild = (lib.optionalString withManual '' + postBuild = lib.optionalString withManual '' # Need to build the main Git documentation before building the # contrib/subtree documentation, as the latter depends on the # asciidoc.conf file created by the former. make -C Documentation - '') + '' + '' + '' make -C contrib/subtree all ${lib.optionalString withManual "doc"} - '' + (lib.optionalString perlSupport '' + '' + lib.optionalString perlSupport '' make -C contrib/diff-highlight - '') + (lib.optionalString osxkeychainSupport '' + '' + lib.optionalString osxkeychainSupport '' make -C contrib/credential/osxkeychain - '') + (lib.optionalString withLibsecret '' + '' + lib.optionalString withLibsecret '' make -C contrib/credential/libsecret - ''); + ''; ## Install @@ -161,15 +161,15 @@ stdenv.mkDerivation (finalAttrs: { installFlags = [ "NO_INSTALL_HARDLINKS=1" ]; - preInstall = (lib.optionalString osxkeychainSupport '' + preInstall = lib.optionalString osxkeychainSupport '' mkdir -p $out/bin ln -s $out/share/git/contrib/credential/osxkeychain/git-credential-osxkeychain $out/bin/ rm -f $PWD/contrib/credential/osxkeychain/git-credential-osxkeychain.o - '') + (lib.optionalString withLibsecret '' + '' + lib.optionalString withLibsecret '' mkdir -p $out/bin ln -s $out/share/git/contrib/credential/libsecret/git-credential-libsecret $out/bin/ rm -f $PWD/contrib/credential/libsecret/git-credential-libsecret.o - ''); + ''; postInstall = ''