Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.zig-cache/
zig-out/
.zig-global-cache/
.idea
16 changes: 11 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub fn build(b: *std.Build) !void {
});

const options = b.addOptions();
options.addOption(bool, "enable_debug_extensions", false);
zig_mod.addOptions("build_options", options);

const target = b.standardTargetOptions(.{});
Expand Down Expand Up @@ -96,9 +97,11 @@ pub fn build(b: *std.Build) !void {

const host_zip_exe = b.addExecutable(.{
.name = "zip",
.root_source_file = zip_dep.path("src/zip.zig"),
.target = b.graph.host,
.optimize = .Debug,
.root_module = b.createModule(.{
.root_source_file = zip_dep.path("src/zip.zig"),
.target = b.graph.host,
.optimize = .Debug,
}),
});

const ci_step = b.step("ci", "The build/test step to run on the CI");
Expand Down Expand Up @@ -157,6 +160,7 @@ fn makeCalVersion() ![11]u8 {
fn setBuildOptions(b: *std.Build, exe: *std.Build.Step.Compile, exe_kind: Exe) void {
const o = b.addOptions();
o.addOption(Exe, "exe", exe_kind);
o.addOption(bool, "enable_debug_extensions", false);
exe.root_module.addOptions("build_options", o);
}

Expand Down Expand Up @@ -220,8 +224,10 @@ fn addTests(
.anyzig = anyzig,
.wrap_exe = b.addExecutable(.{
.name = "wrap",
.root_source_file = b.path("test/wrap.zig"),
.target = b.graph.host,
.root_module = b.createModule(.{
.root_source_file = b.path("test/wrap.zig"),
.target = b.graph.host,
}),
}),
.make_build_steps = opt.make_build_steps,
};
Expand Down
12 changes: 6 additions & 6 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.{
.name = .anyzig,
.version = "0.0.0",
.version = "0.0.1",
.fingerprint = 0x7cd092f5bd0fed33, // Changing this has security and trust implications.
.minimum_zig_version = "0.14.0",
.minimum_zig_version = "0.15.2",
.dependencies = .{
.zig = .{
.url = "git+https://github.com/ziglang/zig#5ad91a646a753cc3eecd8751e61cf458dadd9ac4",
.hash = "zig-0.0.0-Fp4XJDTgLgvQHn6QVvTe6INRdgdAzu43qE4JBXxhn9Ln",
.url = "git+https://github.com/ziglang/zig#e4cbd752c8c05f131051f8c873cff7823177d7d3",
.hash = "zig-0.0.0-Fp4XJKXnIg1JKwvJXEknkiiVAIj_oVQtP-3VY8zsACRF",
},
.zip = .{
.url = "git+https://github.com/marler8997/zipcmdline#3dfca786a489d117e4b72ea10ffb4bbd9fc2dd72",
.hash = "12201a08d7eff7619c8eb8284691a3ff959861b4bdd87216f180ed136672fb4ea26f",
.url = "git+https://github.com/marler8997/zipcmdline#a8807944231b46565450504cb7f3146e29e51335",
.hash = "zipcmdline-0.0.0-DFii09hmAwAK1TuCE9eIMZANDZRJnodAHOUOCM8pAPO3",
},
},
.paths = .{
Expand Down
2 changes: 1 addition & 1 deletion src/hashstore.zig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn save(hashstore_path: []const u8, name: []const u8, content: []const u8) !
// no need to write to a temporary file and rename since we have a lock file
const store_file = try std.fs.cwd().createFile(lock.hashfile_path, .{});
defer store_file.close();
try store_file.writer().writeAll(content);
try store_file.writeAll(content);
}

pub fn delete(hashstore_path: []const u8, name: []const u8) !void {
Expand Down
Loading