Browse Source

Move zig download to the cache instead

master
Macoy Madson 9 months ago
parent
commit
d862cf2b84
  1. 10
      src/Config_ZigCompile.cake

10
src/Config_ZigCompile.cake

@ -9,9 +9,9 @@
(var archive-url ([] 1024 char) (array 0))
(PrintfBuffer archive-url "https://ziglang.org/builds/%s.tar.xz" zig-name)
(var zig-archive ([] 1024 char) (array 0))
(PrintfBuffer zig-archive "Dependencies/%s.tar.xz" zig-name)
(PrintfBuffer zig-archive "cakelisp_cache/%s.tar.xz" zig-name)
(var extracted-zig-executable ([] 1024 char) (array 0))
(PrintfBuffer extracted-zig-executable "Dependencies/%s/zig" zig-name)
(PrintfBuffer extracted-zig-executable "cakelisp_cache/%s/zig" zig-name)
(unless (fileExists extracted-zig-executable)
(unless (fileExists zig-archive)
@ -24,10 +24,10 @@
(unless (fileExists extracted-zig-executable)
(var input-archive-arg ([] 1024 char) (array 0))
(PrintfBuffer input-archive-arg "--file=%s" zig-archive)
(Logf "Extracting Zig from %s" zig-archive)
(Logf "Extracting Zig from %s\n" zig-archive)
(run-process-sequential-or
("tar" "--xz" "--extract" input-archive-arg "--one-top-level=Dependencies")
(Logf "error: failed to download Zig from %s via curl\n" archive-url)
("tar" "--xz" "--extract" input-archive-arg "--one-top-level=cakelisp_cache")
(Logf "error: failed to extract Zig from %s\n" zig-archive)
(return false)))
(remove zig-archive))

Loading…
Cancel
Save