mattrobenolt / mattrobenolt/zig-benchmark

Zig 0.16 compatibility: std.process.args and std.time.Timer removed

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Zig
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Problem

The benchmark library doesn't compile under Zig 0.16 due to two std API changes:

  1. std.process.args() → removed; args are now passed via std.process.Init to main(init: std.process.Init)
  2. std.time.Timer → removed/restructured

src/benchmark_main.zig uses std.process.args() and src/benchmark.zig uses std.time.Timer.

Impact

ztls can't build zig build bench-bin under Zig 0.16. This blocks perf captures under 0.16 (ztls #62).

Fix needed

  • benchmark_main.zig: conditionally accept std.process.Init under 0.16 (via `@hasDecl(std.process, "Init"))
  • benchmark.zig: replace std.time.Timer with the 0.16 equivalent or a dual-version shim
  • Options.parse / nextFlagValue / shortFlagValue: change *std.process.ArgIterator to anytype (both ArgIterator and Args.Iterator have .next() / .skip())

The ztls project pins this library at 6e7e9ab. Once fixed, update the hash in ztls build.zig.zon.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/benchmark_main.zig and src/benchmark.zig, then trace Options.parse, nextFlagValue, and shortFlagValue to understand the iterator interfaces. Build with Zig 0.16 using zig build bench-bin and verify the benchmark library remains compatible with the existing API; once it works, the ztls build.zig.zon hash can be updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
zig
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.