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
4 changes: 4 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,10 @@ pub fn build(b: *std.Build) void {
tls_run_test_bls_spec_tests.dependOn(&run_test_bls_spec_tests.step);
tls_run_test.dependOn(&run_test_bls_spec_tests.step);

const run_bench_ssz = b.addSystemCommand(&.{ "zig", "build", "run:bench_ssz_attestation", "run:bench_ssz_block", "run:bench_ssz_state" });
const tls_run_bench_ssz = b.step("run:bench_ssz", "Run the bench_ssz run");
tls_run_bench_ssz.dependOn(&run_bench_ssz.step);
Comment on lines +1032 to +1034
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Calling zig build via addSystemCommand is an anti-pattern in Zig build scripts. It spawns a sub-process, which is inefficient and breaks the build graph's ability to manage dependencies and parallel execution. Since the individual benchmark steps are already defined in this file, the run:bench_ssz step should directly depend on them.

Additionally, line 1032 exceeds the 100-column limit (Style Guide Repo line 400), and the description "Run the bench_ssz run" is redundant.

Note: As this file is marked as generated, you should ensure that the tool zbuild or its configuration in zbuild.zon is updated to produce the correct dependency-based logic instead of a shell command.

    const tls_run_bench_ssz = b.step("run:bench_ssz", "Run all SSZ benchmarks");
    tls_run_bench_ssz.dependOn(&run_exe_bench_ssz_attestation.step);
    tls_run_bench_ssz.dependOn(&run_exe_bench_ssz_block.step);
    tls_run_bench_ssz.dependOn(&run_exe_bench_ssz_state.step);
References
  1. Hard limit all line lengths, without exception, to at most 100 columns. (link)


module_config.addImport("build_options", options_module_build_options);
module_config.addImport("preset", module_preset);
module_config.addImport("consensus_types", module_consensus_types);
Expand Down
3 changes: 3 additions & 0 deletions zbuild.zon
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,7 @@
.filters = .{},
},
},
.runs = .{
.bench_ssz = "zig build run:bench_ssz_attestation run:bench_ssz_block run:bench_ssz_state",
},
}
Loading