From b0160e005b17fed3831d51ba8e52b31e5bd9e916 Mon Sep 17 00:00:00 2001 From: "Caleb J. Gardner" Date: Tue, 17 Feb 2026 05:54:32 -0600 Subject: [PATCH] Some fixes --- .github/workflows/release-build.yml | 10 +++++----- build.zig | 2 +- src/inode.zig | 7 +++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 5e91fa3..2007f93 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -17,15 +17,15 @@ jobs: - name: Build normal version run: zig build -Drelease=true -Dversion=${{ github.ref_name }} - name: Move normal build out - run: mv zig-out/bin/unsquashfs ./ + run: mv zig-out/bin/unsquashfs ./unsquashfs-x86_64 - name: Rebuild with C libraries - run: zig build -Drelease=true -Duse_c_libs=true -Dversion="${{ github.ref_name }}" + run: zig build --release=fast -Drelease=true -Duse_c_libs=true -Dversion="${{ github.ref_name }}" - name: Move C build out - run: mv zig-out/bin/unsquashfs ./unsquashfs-c-libs + run: mv zig-out/bin/unsquashfs ./unsquashfs-x86_64-c-libs - name: Release uses: softprops/action-gh-release@v2 with: prerelease: true files: | - unsquashfs - unsquashfs-c-libs + unsquashfs-x86_64 + unsquashfs-x86_64-c-libs diff --git a/build.zig b/build.zig index 1b6900b..720ebbc 100644 --- a/build.zig +++ b/build.zig @@ -10,7 +10,7 @@ pub fn build(b: *std.Build) !void { zig_squashfs_options.addOption(bool, "allow_lzo", allow_lzo orelse false); const target = b.standardTargetOptions(.{}); - const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseFast }); + const optimize = b.standardOptimizeOption(.{}); const mod = b.addModule("zig_squashfs", .{ .root_source_file = b.path("src/root.zig"), .target = target, diff --git a/src/inode.zig b/src/inode.zig index 243b016..412c15e 100644 --- a/src/inode.zig +++ b/src/inode.zig @@ -199,7 +199,7 @@ const Parent = struct { ignore_permissions: bool, ignore_xattr: bool, - wg: WaitGroup, + wg: WaitGroup = .{}, mut: Mutex = .{}, fn create(alloc: std.mem.Allocator, hdr: Header, archive: *Archive, path: []const u8, options: ExtractionOptions, dir_size: usize) !*Parent { @@ -216,9 +216,8 @@ const Parent = struct { .ignore_permissions = options.ignore_permissions, .ignore_xattr = options.ignore_xattr, - - .wg = .{ .state = .init(dir_size) }, }; + out.wg.startMany(dir_size); return out; } @@ -232,7 +231,7 @@ const Parent = struct { defer p.alloc.destroy(p); var fil = try std.fs.cwd().openFile(p.path, .{}); defer fil.close(); - const time = p.mod_time * 1000000000; + const time = @as(i128, p.mod_time) * 1000000000; try fil.updateTimes(time, time); if (p.ignore_permissions) { try fil.chmod(p.perm);