-
Notifications
You must be signed in to change notification settings - Fork 5
upgrade repo to 0.14.0 #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Guillaume Ballet <[email protected]>
109c7dd to
ce38f82
Compare
Signed-off-by: Guillaume Ballet <[email protected]>
Signed-off-by: Guillaume Ballet <[email protected]>
Signed-off-by: Guillaume Ballet <[email protected]>
Signed-off-by: Guillaume Ballet <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the repository to Zig v0.14.0, updating API usage, dependency references, and build configurations to align with the new version.
- Updated API calls in src/main.zig to reflect changes in the httpz package.
- Adjusted type information usage in src/blockchain/vm.zig for Zig’s updated type introspection.
- Modified build configurations in build.zig.zon and build.zig as well as version references in README.md and CI workflow files.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main.zig | Updated httpz server and router API calls with added error handling. |
| src/blockchain/vm.zig | Replaced "Optional.child" with "optional.child" per Zig 0.14.0 syntax. |
| build.zig.zon | Refactored dependency definitions and project metadata updates. |
| build.zig | Switched from static library assembly to CMake builds and fixed linking redundancy in tests. |
| README.md | Updated the Zig version reference to 0.14.0. |
| .github/workflows/ci.yml | Updated Zig version for CI jobs to align with 0.14.0. |
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Guillaume Ballet <[email protected]>
| const ethash = b.addStaticLibrary(.{ | ||
| .name = "ethash", | ||
| .optimize = optimize, | ||
| .target = target, | ||
| }); | ||
| const cflags = [_][]const u8{ | ||
| "-Wall", "-O3", "-fvisibility=hidden", | ||
| "-fvisibility-inlines-hidden", "-Wpedantic", "-Werror", | ||
| "-Wextra", "-Wshadow", "-Wconversion", | ||
| "-Wsign-conversion", "-Wno-unknown-pragmas", "-fno-stack-protector", | ||
| "-Wimplicit-fallthrough", "-Wmissing-declarations", "-Wno-attributes", | ||
| "-Wextra-semi", "-fno-exceptions", "-fno-rtti", | ||
| "-Wno-deprecated", // this one is used to remove a warning about char_trait deprecation | ||
| "-Wno-strict-prototypes", // this one is used by glue.c to avoid a warning that does not disappear when the prototype is added. | ||
| }; | ||
| ethash.addCSourceFiles(.{ .root = b.path(""), .files = &[_][]const u8{"ethash/lib/keccak/keccak.c"}, .flags = &cflags }); | ||
| ethash.addIncludePath(b.path("ethash/include")); | ||
| ethash.linkLibC(); | ||
| ethash.linkLibCpp(); | ||
| b.installArtifact(ethash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, I don't see any further import changes. Was this an unused module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for context, with 0.14.0 the hacks I did to build evmone directly from zig stopped working. It looks like the new C++ lib that is provided doesn't really work with their C++ code. That's why I fell back to building the lib. (to be continued in the comment about cmake)
| const evmone_cmake_config_step = b.addSystemCommand(&.{ "cmake", "-S", "evmone", "-B", "zig-out/evmone_build" }); | ||
| const evmone_cmake_build_step = b.addSystemCommand(&.{ "cmake", "--build", "zig-out/evmone_build" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this means phant user needs now to have cmake installed and maybe further dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now yes. I am working on a subsequent PR to gradually replace this with zevem. I could go back to your initial approach of including some pre-compiled lib, but I am building phant on three different archs and it's simpler for me to build evmone with the right arch, rather than maintaining 3 binary blobs.
There's an extra issue with this PR, which the next one is supposed to address: the riscv32 build doesn't work. That's why it will be the first target for zevem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and for the record, I don't like cmake, I think it's the wrong way to do a build system. That's why I was very happy to be able to build everything with zig.
Signed-off-by: Guillaume Ballet <[email protected]>
|
One of the issues is fixed by my follow-up PR so I'm not going to worry about this one. The other one, however, is a good point that it doesn't support cross-compilation. |
This is the list of changes that are necessary for running phant with 0.14.0
At this stage, it doesn't cross-compile to riscv, which is the next step.