-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
The following is slop
Summary
After cloning the repo without modifications, zig build and zig build test-unit fail. 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
- OS: macOS (darwin 25.2.0)
- Zig: 0.15.1
- Shell: zsh
Repro Steps
git clone <repo>zig buildzig 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, callstd.log.warn(...)instead ofstd.log.err(...). - Keep normal behavior in non-test builds.
Notes
- Adding
lib/voltaireto 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().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels