libfetchers/git: fix caching head when using shallow clones#12642
Merged
Mic92 merged 1 commit intoNixOS:masterfrom Mar 12, 2025
Merged
libfetchers/git: fix caching head when using shallow clones#12642Mic92 merged 1 commit intoNixOS:masterfrom
Mic92 merged 1 commit intoNixOS:masterfrom
Conversation
Mic92
commented
Mar 12, 2025
edolstra
approved these changes
Mar 12, 2025
the old code was using the wrong cache directory, which lead to a warning on every nix flake update Update src/libfetchers/git.cc
ysndr
added a commit
to flox/flox
that referenced
this pull request
Jul 17, 2025
Flox, or more specifically nix expression builds, currently use nix fetchers to fetch shallow git clones of nixpkgs. The git fetcher in Nix < 2.29, was not consistently using the same cache dir for operations on shallow clones, i.e. when computing cache path was determined inconsistently via `getCachePath(<url>, getShallowAttr(input))`, and `getCachePath(<url>, false)`. The most easily observable effect were "fatal" git messages and Nix warnings, as documented in <#3346>. Whether it has further effect on the nixpkgs used, is unclear but possible. The bug was fixed in Nix >= 2.29 via <NixOS/nix#12642>. Since the nix version used here is still 2.28.3, backport the patch until our nixpkgs ships with a patched distribution of nix. Our nixpkgs _do_ include Nix 2.29, but using a pinned Nix, 1. increases the risk of introducing more behavioral changes than including a single few line patch 2. risks us potentially falling behind if we forget to switch back to "stable" nix
github-merge-queue bot
pushed a commit
to flox/flox
that referenced
this pull request
Jul 18, 2025
Flox, or more specifically nix expression builds, currently use nix fetchers to fetch shallow git clones of nixpkgs. The git fetcher in Nix < 2.29, was not consistently using the same cache dir for operations on shallow clones, i.e. when computing cache path was determined inconsistently via `getCachePath(<url>, getShallowAttr(input))`, and `getCachePath(<url>, false)`. The most easily observable effect were "fatal" git messages and Nix warnings, as documented in <#3346>. Whether it has further effect on the nixpkgs used, is unclear but possible. The bug was fixed in Nix >= 2.29 via <NixOS/nix#12642>. Since the nix version used here is still 2.28.3, backport the patch until our nixpkgs ships with a patched distribution of nix. Our nixpkgs _do_ include Nix 2.29, but using a pinned Nix, 1. increases the risk of introducing more behavioral changes than including a single few line patch 2. risks us potentially falling behind if we forget to switch back to "stable" nix
ysndr
added a commit
to flox/flox
that referenced
this pull request
Nov 6, 2025
Drops the patches for * NixOS/nix#12580 * NixOS/nix#12642 * NixOS/nix#13340 All three have been merged upstream in the current release of nix (v2.31.2).
ysndr
added a commit
to flox/flox
that referenced
this pull request
Nov 6, 2025
Drops the patches for * NixOS/nix#12580 * NixOS/nix#12642 * NixOS/nix#13340 All three have been merged upstream in the current release of nix (v2.31.2).
ysndr
added a commit
to flox/flox
that referenced
this pull request
Nov 6, 2025
Drops the patches for * NixOS/nix#12580 * NixOS/nix#12642 * NixOS/nix#13340 All three have been merged upstream in the current release of nix (v2.31.2).
ysndr
added a commit
to flox/flox
that referenced
this pull request
Nov 7, 2025
Drops the patches for * NixOS/nix#12580 * NixOS/nix#12642 * NixOS/nix#13340 All three have been merged upstream in the current release of nix (v2.31.2).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the old code was using the wrong cache directory, which lead to a warning on every nix flake update
Motivation
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.