The following is slop ⚠️:
Summary
After cloning the repo without modifications, zig build and zig build test-unit fail. Two issues appear:
zig build fails because lib/voltaire/target/release/libcrypto_wrappers.a is missing.
zig build test-unit fails because the log tests emit err output, which the test runner treats as an error.
Both failures occur on a clean checkout.
Environment
- OS: macOS (darwin 25.2.0)
- Zig: 0.15.1
- Shell: zsh
Repro Steps
git clone <repo>
zig build
zig build test-unit
Observed Errors
1) Missing crypto wrappers library
error: /Users/.../lib/voltaire/target/release/libcrypto_wrappers.a: file not found
The build invokes cargo in lib/voltaire, but the output ends up in the workspace root target/ rather than lib/voltaire/target/, so Zig’s expected path doesn’t exist.
2) Unit tests fail on logging
zig build test-unit shows:
error: 'log.test.log functions compile and execute without error' logged errors
[default] (err): [EVM2] test error message: error
The tests in src/log.zig call err(), and the test harness treats any error log as a test failure.
Proposed Fixes
A) Ensure cargo outputs to lib/voltaire/target/
In lib/voltaire/lib/build.zig, set CARGO_TARGET_DIR=target before invoking cargo so libcrypto_wrappers.a lands where Zig expects.
Suggested change:
cargo_build.setEnvironmentVariable("CARGO_TARGET_DIR", "target");
B) Avoid treating err() as test failure
In src/log.zig, route err() to std.log.warn when running tests (builtin.is_test) so the tests don’t fail on expected output.
Suggested approach:
- If
builtin.is_test, call std.log.warn(...) instead of std.log.err(...).
- Keep normal behavior in non-test builds.
Notes
- Adding
lib/voltaire to the workspace members also resolves a cargo workspace warning.
- If you prefer not to alter logging behavior in tests, another option is to update the log tests to avoid calling
err().
The following is slop⚠️ :
Summary
After cloning the repo without modifications,
zig buildandzig build test-unitfail. Two issues appear:zig buildfails becauselib/voltaire/target/release/libcrypto_wrappers.ais missing.zig build test-unitfails because thelogtests emiterroutput, which the test runner treats as an error.Both failures occur on a clean checkout.
Environment
Repro Steps
git clone <repo>zig buildzig build test-unitObserved Errors
1) Missing crypto wrappers library
The build invokes cargo in
lib/voltaire, but the output ends up in the workspace roottarget/rather thanlib/voltaire/target/, so Zig’s expected path doesn’t exist.2) Unit tests fail on logging
zig build test-unitshows:The tests in
src/log.zigcallerr(), and the test harness treats any error log as a test failure.Proposed Fixes
A) Ensure cargo outputs to
lib/voltaire/target/In
lib/voltaire/lib/build.zig, setCARGO_TARGET_DIR=targetbefore invoking cargo solibcrypto_wrappers.alands where Zig expects.Suggested change:
B) Avoid treating
err()as test failureIn
src/log.zig, routeerr()tostd.log.warnwhen running tests (builtin.is_test) so the tests don’t fail on expected output.Suggested approach:
builtin.is_test, callstd.log.warn(...)instead ofstd.log.err(...).Notes
lib/voltaireto the workspace members also resolves a cargo workspace warning.err().