Merge pull request #1528 from der-teufel-programming/fix-compress

Update to new compress.zlib API
This commit is contained in:
Mitchell Hashimoto
2024-02-21 10:20:27 -08:00
committed by GitHub
3 changed files with 8 additions and 13 deletions

View File

@ -24,7 +24,7 @@ const Command = @import("src/Command.zig");
// but we liberally update it. In the future, we'll be more careful about // but we liberally update it. In the future, we'll be more careful about
// using released versions so that package managers can integrate better. // using released versions so that package managers can integrate better.
comptime { comptime {
const required_zig = "0.12.0-dev.2711+f995c1b08"; const required_zig = "0.12.0-dev.2818+97290e0bf";
const current_zig = builtin.zig_version; const current_zig = builtin.zig_version;
const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable; const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable;
if (current_zig.order(min_zig) == .lt) { if (current_zig.order(min_zig) == .lt) {
@ -272,7 +272,6 @@ pub fn build(b: *std.Build) !void {
exe.want_lto = false; exe.want_lto = false;
} }
// If we're installing, we get the install step so we can add // If we're installing, we get the install step so we can add
// additional dependencies to it. // additional dependencies to it.
const install_step = if (config.app_runtime != .none) step: { const install_step = if (config.app_runtime != .none) step: {

12
flake.lock generated
View File

@ -147,11 +147,11 @@
}, },
"nixpkgs-zig-0-12": { "nixpkgs-zig-0-12": {
"locked": { "locked": {
"lastModified": 1707846486, "lastModified": 1708536163,
"narHash": "sha256-ek2NESo8WPqUIuUPVs3L2rliCFofvjhR/i3ptaxfaJ4=", "narHash": "sha256-UdGZLYXoIJRal/J/uYlMqPi27LE92wdsIHtDOWRVXhM=",
"owner": "vancluever", "owner": "vancluever",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "31119ca40f326e3a6552883fa62f2df56c17a7bf", "rev": "aba18e2126357afc8a997c12dcf027517b7432b0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -194,11 +194,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1707783766, "lastModified": 1708474925,
"narHash": "sha256-kD90pK+KAzr3UrohYRqE7fWUaEg4Mv3rk1IhubiHFUM=", "narHash": "sha256-ejcMwYdCnCNxaQ7G1hTo6G33iI+hcfHsCJYskDVssyw=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "06f4507d05f90a54409a5206fcfba5966eea0c03", "rev": "f28aea5eeaeafed3d9be7d7ac920df95d1ebd376",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -346,11 +346,7 @@ pub const LoadingImage = struct {
fn decompressZlib(self: *LoadingImage, alloc: Allocator) !void { fn decompressZlib(self: *LoadingImage, alloc: Allocator) !void {
// Open our zlib stream // Open our zlib stream
var fbs = std.io.fixedBufferStream(self.data.items); var fbs = std.io.fixedBufferStream(self.data.items);
var stream = std.compress.zlib.decompressStream(alloc, fbs.reader()) catch |err| { var stream = std.compress.zlib.decompressor(fbs.reader());
log.warn("zlib decompression failed: {}", .{err});
return error.DecompressionFailed;
};
defer stream.deinit();
// Write it to an array list // Write it to an array list
var list = std.ArrayList(u8).init(alloc); var list = std.ArrayList(u8).init(alloc);