Skip to content

Duplicate downloads when updating lockfile #331

@kylewlacy

Description

@kylewlacy

Occasionally, the same URL reference in a Brioche.download static can be downloaded over and over again when updating the lockfile. Here's a set of steps to reproduce:

  1. Clone https://github.com/brioche-dev/brioche-packages.git locally. I tested against commit this commit: brioche-dev/brioche-packages@3453454
  2. Update all the runtime-utils URLs within the std package to some arbitrary URL (see the patch below). I used this URL: https://gist.githubusercontent.com/kylewlacy/c0f1a43e2641686f377178880fcce6ae/raw/f48155695445aa218e558fba824b61cf718d5e55/lorem-ipsum.txt
  3. Check multiple packages at the same time: brioche check -p packages/nushell -p packages/ripgrep -p packages/rust -p packages/curl

When I tested this, this seems to have repeatedly downloaded the new URL 44 times. Since the same URL is used, this should only download the URL once.

Here's the diff from the files I manually changed in std for (2):

diff --git a/packages/std/runtime_utils.bri b/packages/std/runtime_utils.bri
index f481480..9cd3a2d 100644
--- a/packages/std/runtime_utils.bri
+++ b/packages/std/runtime_utils.bri
@@ -5,10 +5,10 @@ const PLATFORM_RUNTIME_UTILS: Record<
   std.Recipe<std.Directory> | undefined
 > = {
   "x86_64-linux": Brioche.download(
-    "https://development-content.brioche.dev/github.com/brioche-dev/brioche-runtime-utils/commits/669ae3ed4658b463f9e64608d0e99dfa33192e06/x86_64-linux/brioche-runtime-utils.tar.zstd",
+    "https://gist.githubusercontent.com/kylewlacy/c0f1a43e2641686f377178880fcce6ae/raw/f48155695445aa218e558fba824b61cf718d5e55/lorem-ipsum.txt",
   ).unarchive("tar", "zstd"),
   "aarch64-linux": Brioche.download(
-    "https://development-content.brioche.dev/github.com/brioche-dev/brioche-runtime-utils/commits/669ae3ed4658b463f9e64608d0e99dfa33192e06/aarch64-linux/brioche-runtime-utils.tar.zstd",
+    "https://gist.githubusercontent.com/kylewlacy/c0f1a43e2641686f377178880fcce6ae/raw/f48155695445aa218e558fba824b61cf718d5e55/lorem-ipsum.txt",
   ).unarchive("tar", "zstd"),
 };
 
diff --git a/packages/std/toolchain/utils.bri b/packages/std/toolchain/utils.bri
index f01a3ae..b899a67 100644
--- a/packages/std/toolchain/utils.bri
+++ b/packages/std/toolchain/utils.bri
@@ -5,10 +5,10 @@ const PLATFORM_RUNTIME_UTILS: Record<
   std.Recipe<std.Directory> | undefined
 > = {
   "x86_64-linux": Brioche.download(
-    "https://development-content.brioche.dev/github.com/brioche-dev/brioche-runtime-utils/commits/669ae3ed4658b463f9e64608d0e99dfa33192e06/x86_64-linux/brioche-runtime-utils.tar.zstd",
+    "https://gist.githubusercontent.com/kylewlacy/c0f1a43e2641686f377178880fcce6ae/raw/f48155695445aa218e558fba824b61cf718d5e55/lorem-ipsum.txt",
   ).unarchive("tar", "zstd"),
   "aarch64-linux": Brioche.download(
-    "https://development-content.brioche.dev/github.com/brioche-dev/brioche-runtime-utils/commits/669ae3ed4658b463f9e64608d0e99dfa33192e06/aarch64-linux/brioche-runtime-utils.tar.zstd",
+    "https://gist.githubusercontent.com/kylewlacy/c0f1a43e2641686f377178880fcce6ae/raw/f48155695445aa218e558fba824b61cf718d5e55/lorem-ipsum.txt",
   ).unarchive("tar", "zstd"),
 };

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions