Extracted from #14265.
Depends on #14183.
zig build should support fetching via an URL like this:
.url = "https://example.com/foo.tar.zst",
|
if (mem.endsWith(u8, uri.path, ".tar.gz")) { |
|
// I observed the gzip stream to read 1 byte at a time, so I am using a |
|
// buffered reader on the front of it. |
|
var br = std.io.bufferedReaderSize(std.crypto.tls.max_ciphertext_record_len, req.reader()); |
|
|
|
var gzip_stream = try std.compress.gzip.gzipStream(gpa, br.reader()); |
|
defer gzip_stream.deinit(); |
|
|
|
try std.tar.pipeToFileSystem(tmp_directory.handle, gzip_stream.reader(), .{ |
|
.strip_components = 1, |
|
}); |
|
} else { |
|
return reportError( |
|
ini, |
|
comp_directory, |
|
uri.path.ptr, |
|
"unknown file extension for path '{s}'", |
|
.{uri.path}, |
|
); |
|
} |
Related:
Extracted from #14265.
Depends on #14183.
zig buildshould support fetching via an URL like this:zig/src/Package.zig
Lines 357 to 376 in 7cb2f92
Related:
.tar.xzextension #14300