Some fixes

This commit is contained in:
Caleb J. Gardner
2026-02-17 05:54:32 -06:00
parent b7b99325da
commit b0160e005b
3 changed files with 9 additions and 10 deletions
+5 -5
View File
@@ -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
+1 -1
View File
@@ -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,
+3 -4
View File
@@ -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);