From fe57493687e19174b5f87650b8393512a0d77ee5 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Wed, 12 Feb 2025 13:57:52 +0100 Subject: [PATCH 1/3] Fallback to using GitHub releases of `libsodium` if the download site is unavailable --- project/settings.sc | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/project/settings.sc b/project/settings.sc index ff6a6278a9..a40ad54ccf 100644 --- a/project/settings.sc +++ b/project/settings.sc @@ -231,12 +231,29 @@ trait CliLaunchers extends SbtModule { self => os.copy.over(libPath, destDir / s"${prefix}sodiumjni.$ext") } private def copyLibsodiumStaticTo(cs: String, destDir: os.Path): Unit = { - val dirRes = os.proc( - cs, - "get", - "--archive", - "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip" - ).call() + val dirRes = { + val stable = os.proc( + cs, + "get", + "--archive", + s"https://download.libsodium.org/libsodium/releases/libsodium-$libsodiumVersion-stable-msvc.zip" + ).call(check = false) + if (stable.exitCode == 0) stable + else { + System.err.println( + s"Failed to download stable libsodium $libsodiumVersion from https://download.libsodium.org/libsodium/releases" + ) + System.err.println( + "falling back to https://github.com/jedisct1/libsodium/releases *-RELEASE" + ) + os.proc( // fallback to GitHuB *-RELEASE version + cs, + "get", + "--archive", + s"https://github.com/jedisct1/libsodium/releases/download/$libsodiumVersion-RELEASE/libsodium-$libsodiumVersion-msvc.zip" + ).call() + } + } val dir = os.Path(dirRes.out.trim(), os.pwd) os.copy.over( dir / "libsodium" / "x64" / "Release" / "v143" / "static" / "libsodium.lib", From d5b0f5de07d9a8bd5645c50fafe841a74bce5064 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Wed, 12 Feb 2025 14:44:02 +0100 Subject: [PATCH 2/3] Bump `libsodium` to 1.0.20 --- project/deps.sc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/deps.sc b/project/deps.sc index 7c1db6568b..4d7233759e 100644 --- a/project/deps.sc +++ b/project/deps.sc @@ -278,7 +278,7 @@ def buildCsVersion = Deps.Versions.coursierCli def buildCsM1Version = Deps.Versions.coursierM1Cli // Native library used to encrypt GitHub secrets -def libsodiumVersion = "1.0.18" +def libsodiumVersion = "1.0.20" // Using the libsodium static library from this Alpine version (in the static launcher) def alpineVersion = "3.15" From fd69bc1966189b2679a5f376901d44e8805f8c23 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Wed, 12 Feb 2025 15:02:24 +0100 Subject: [PATCH 3/3] Bump `alpine` to 3.21 --- project/deps.sc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/deps.sc b/project/deps.sc index 4d7233759e..50506c0bc6 100644 --- a/project/deps.sc +++ b/project/deps.sc @@ -280,7 +280,7 @@ def buildCsM1Version = Deps.Versions.coursierM1Cli // Native library used to encrypt GitHub secrets def libsodiumVersion = "1.0.20" // Using the libsodium static library from this Alpine version (in the static launcher) -def alpineVersion = "3.15" +def alpineVersion = "3.21" object Docker { def customMuslBuilderImageName = "scala-cli-base-musl"