Skip to content

Commit

Permalink
update usage of afl as lazy dep
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoff-it committed Jul 27, 2024
1 parent 8b1c0fa commit 047f7c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const std = @import("std");
const afl = @import("zig-afl-kit");

pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
Expand Down Expand Up @@ -110,6 +109,7 @@ fn setupFuzzStep(
target: std.Build.ResolvedTarget,
superhtml: *std.Build.Module,
) void {
const afl = b.lazyImport(@This(), "zig-afl-kit") orelse return;
const afl_obj = b.addObject(.{
.name = "superfuzz-afl",
.root_source_file = b.path("src/fuzz/afl.zig"),
Expand All @@ -121,13 +121,13 @@ fn setupFuzzStep(
afl_obj.root_module.stack_check = false; // not linking with compiler-rt
afl_obj.root_module.link_libc = true; // afl runtime depends on libc

// const afl_fuzz = afl.addInstrumentedExe(
// b,
// target,
// .ReleaseSafe,
// afl_obj,
// );
// fuzz.dependOn(&b.addInstallFile(afl_fuzz, "superfuzz-afl").step);
const afl_fuzz = afl.addInstrumentedExe(
b,
target,
.ReleaseSafe,
afl_obj,
);
b.defaultInstallStep().dependOn(&b.addInstallFile(afl_fuzz, "superfuzz-afl").step);

const super_fuzz = b.addExecutable(.{
.name = "superfuzz",
Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
.hash = "12209cde192558f8b3dc098ac2330fc2a14fdd211c5433afd33085af75caa9183147",
},
.scripty = .{
.url = "git+https://github.com/kristoff-it/scripty#3338e0ed9e1ffd869acadca9673c87894b3ba38c",
.hash = "1220a064034f7b797618a1fc5c2f3596b5dbfe4f309afd0798cfc77bbea6bb5eb672",
.url = "git+https://github.com/kristoff-it/scripty#0198a780c47311758a102b2805a1e006f83c7aed",
.hash = "1220d8bf59468a921f64dd063a1a7b8a6668144a67fb85cdd58411fe4260229e08a8",
},
.@"zig-afl-kit" = .{
.url = "git+https://github.com/kristoff-it/zig-afl-kit#f003bfe714f2964c90939fdc940d5993190a66ec",
Expand Down

0 comments on commit 047f7c5

Please sign in to comment.