Never do shallow fetches
They seem to generally not work if the rev we're fetching is not current. That failure mode is particularly problematic because already having the rev cached avoids the failure: fetches work initially, when the pinned commit is the current one, then break after upstream commits. I could disable repository caching in CI, but that would turn it into a game of whack-a-mole: this breaks on upstream repository commits, not flake updates. The downside is increased disk usage. This can be partially mitigated by enabling experimentalFetchTree, which fetches snapshots. Force shallow false to work around https://github.com/NixOS/nix/issues/11012 (Nix 2.23 default to shallow fetches). We should be able to remove that if Nix adds the fallback they're planning to add. Hopefully fixes #14 once and for all.
This commit is contained in:
parent
7f0ff43156
commit
52b9927fff
2 changed files with 4 additions and 16 deletions
10
default.nix
10
default.nix
|
|
@ -59,7 +59,7 @@
|
|||
}:
|
||||
let
|
||||
inherit (lib) optionalAttrs optionalString;
|
||||
inherit (import ./fetch-overrides.nix) extraPins extraUrls forceDeepCloneDomains;
|
||||
inherit (import ./fetch-overrides.nix) extraPins extraUrls;
|
||||
|
||||
# Step 1: determine which Emacs packages to pull in.
|
||||
#
|
||||
|
|
@ -261,12 +261,10 @@ let
|
|||
# Note Doom does have packages with pin + branch (or nonrecursive) set,
|
||||
# expecting to inherit the rest of the recipe from Straight.
|
||||
|
||||
}
|
||||
// optionalAttrs (p ? recipe.branch) { ref = p.recipe.branch; }
|
||||
// optionalAttrs (p ? recipe.depth) { shallow = p.recipe.depth == 1; }
|
||||
// optionalAttrs (lib.any (d: lib.hasPrefix d url) forceDeepCloneDomains) {
|
||||
# TODO: remove if https://github.com/NixOS/nix/issues/11012 is fixed.
|
||||
shallow = false;
|
||||
};
|
||||
}
|
||||
// optionalAttrs (p ? recipe.branch) { ref = p.recipe.branch; };
|
||||
src =
|
||||
if experimentalFetchTree
|
||||
then builtins.fetchTree (
|
||||
|
|
|
|||
|
|
@ -42,14 +42,4 @@
|
|||
# In emacsattic, so shouldn't change underneath us.
|
||||
ammonite-term-repl = "b552fe21977e005c1c460bf6607557e67241a6b6";
|
||||
};
|
||||
|
||||
# Domains for which to force `shallow = false`.
|
||||
forceDeepCloneDomains = [
|
||||
"https://git.notmuchmail.org/"
|
||||
"https://git.savannah.gnu.org/"
|
||||
"https://git.sr.ht/"
|
||||
"https://codeberg.org/"
|
||||
"https://gitlab.com/"
|
||||
"https://repo.or.cz/"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue