From 2fda08453341bd85a669acb02296a27a6f731bdf Mon Sep 17 00:00:00 2001 From: dramforever Date: Mon, 20 Nov 2023 18:04:21 +0800 Subject: [PATCH 1/2] Workaround for nonexistent paths in store-paths.xz Found around 2023-11, some channels have store-paths.xz with paths that are nonexistent on cache.nixos.org. For example, nixos-unstable has 32 paths with name "texlive-2022-env-man" or "texlive-2022-env-info", of which 31 don't exist on cache.nixos.org. (Checked 2023-11-20.) This is a hard error for "nix path-info". See https://github.com/tuna/issues/issues/1855 --- nix-channels.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nix-channels.py b/nix-channels.py index 02b389a..5efe85b 100755 --- a/nix-channels.py +++ b/nix-channels.py @@ -294,6 +294,14 @@ def update_channels(channels): seen_paths = set() channel_failure = False + # Workaround to temporarily fix https://github.com/tuna/issues/issues/1855 + paths = [ + path + for path in paths + if 'texlive-2022-env-man' not in path + and 'texlive-2022-env-info' not in path + ] + # Batch paths to avoid E2BIG for i in range(0, len(paths), PATH_BATCH): @@ -397,6 +405,14 @@ def garbage_collect(): with lzma.open(str(release / 'store-paths.xz')) as f: paths = [ path.rstrip() for path in f ] + # Workaround to temporarily fix https://github.com/tuna/issues/issues/1855 + paths = [ + path + for path in paths + if 'texlive-2022-env-man' not in path + and 'texlive-2022-env-info' not in path + ] + for i in range(0, len(paths), PATH_BATCH): batch = paths[i : i + PATH_BATCH] From fe4884f2350020f2267dd4e8aff17e9aa482ca4b Mon Sep 17 00:00:00 2001 From: dramforever Date: Mon, 20 Nov 2023 18:34:17 +0800 Subject: [PATCH 2/2] nix-channels: '...' -> b'...' when dealing with paths --- nix-channels.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix-channels.py b/nix-channels.py index 5efe85b..5b82c6c 100755 --- a/nix-channels.py +++ b/nix-channels.py @@ -298,8 +298,8 @@ def update_channels(channels): paths = [ path for path in paths - if 'texlive-2022-env-man' not in path - and 'texlive-2022-env-info' not in path + if b'texlive-2022-env-man' not in path + and b'texlive-2022-env-info' not in path ] # Batch paths to avoid E2BIG @@ -409,8 +409,8 @@ def garbage_collect(): paths = [ path for path in paths - if 'texlive-2022-env-man' not in path - and 'texlive-2022-env-info' not in path + if b'texlive-2022-env-man' not in path + and b'texlive-2022-env-info' not in path ] for i in range(0, len(paths), PATH_BATCH):