File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -233,12 +233,29 @@ trait CliLaunchers extends SbtModule { self =>
233
233
os.copy.over(libPath, destDir / s " ${prefix}sodiumjni. $ext" )
234
234
}
235
235
private def copyLibsodiumStaticTo (cs : String , destDir : os.Path , workspace : os.Path ): Unit = {
236
- val dirRes = os.proc(
237
- cs,
238
- " get" ,
239
- " --archive" ,
240
- s " https://download.libsodium.org/libsodium/releases/libsodium- $libsodiumVersion-stable-msvc.zip "
241
- ).call()
236
+ val dirRes = {
237
+ val stable = os.proc(
238
+ cs,
239
+ " get" ,
240
+ " --archive" ,
241
+ s " https://download.libsodium.org/libsodium/releases/libsodium- $libsodiumVersion-stable-msvc.zip "
242
+ ).call(check = false )
243
+ if (stable.exitCode == 0 ) stable
244
+ else {
245
+ System .err.println(
246
+ s " Failed to download stable libsodium $libsodiumVersion from https://download.libsodium.org/libsodium/releases "
247
+ )
248
+ System .err.println(
249
+ " falling back to https://github.com/jedisct1/libsodium/releases *-RELEASE"
250
+ )
251
+ os.proc( // fallback to GitHuB *-RELEASE version
252
+ cs,
253
+ " get" ,
254
+ " --archive" ,
255
+ s " https://github.com/jedisct1/libsodium/releases/download/ $libsodiumVersion-RELEASE/libsodium- $libsodiumVersion-msvc.zip "
256
+ ).call()
257
+ }
258
+ }
242
259
val dir = os.Path (dirRes.out.trim(), workspace)
243
260
os.copy.over(
244
261
dir / " libsodium" / " x64" / " Release" / " v143" / " static" / " libsodium.lib" ,
You can’t perform that action at this time.
0 commit comments