Skip to content

Commit 47e50cf

Browse files
committed
replace evmone with zevem
Signed-off-by: Guillaume Ballet <[email protected]>
1 parent 32ff91d commit 47e50cf

File tree

7 files changed

+15
-558
lines changed

7 files changed

+15
-558
lines changed

.gitmodules

Lines changed: 0 additions & 9 deletions
This file was deleted.

build.zig

Lines changed: 2 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -75,64 +75,7 @@ pub fn build(b: *std.Build) !void {
7575
.optimize = optimize,
7676
});
7777
const mod_httpz = httpz.module("httpz");
78-
79-
const ethash = b.addStaticLibrary(.{
80-
.name = "ethash",
81-
.optimize = optimize,
82-
.target = target,
83-
});
84-
const cflags = [_][]const u8{
85-
"-Wall", "-O3", "-fvisibility=hidden",
86-
"-fvisibility-inlines-hidden", "-Wpedantic", "-Werror",
87-
"-Wextra", "-Wshadow", "-Wconversion",
88-
"-Wsign-conversion", "-Wno-unknown-pragmas", "-fno-stack-protector",
89-
"-Wimplicit-fallthrough", "-Wmissing-declarations", "-Wno-attributes",
90-
"-Wextra-semi", "-fno-exceptions", "-fno-rtti",
91-
"-Wno-deprecated", // this one is used to remove a warning about char_trait deprecation
92-
"-Wno-strict-prototypes", // this one is used by glue.c to avoid a warning that does not disappear when the prototype is added.
93-
};
94-
ethash.addCSourceFiles(.{ .root = b.path(""), .files = &[_][]const u8{"ethash/lib/keccak/keccak.c"}, .flags = &cflags });
95-
ethash.addIncludePath(b.path("ethash/include"));
96-
ethash.linkLibC();
97-
ethash.linkLibCpp();
98-
b.installArtifact(ethash);
99-
100-
const evmone = b.addStaticLibrary(.{
101-
.name = "evmone",
102-
.optimize = optimize,
103-
.target = target,
104-
});
105-
const cppflags = [_][]const u8{
106-
"-Wall", "-std=c++20", "-O3",
107-
"-fvisibility=hidden", "-fvisibility-inlines-hidden", "-Wpedantic",
108-
"-Werror", "-Wextra", "-Wshadow",
109-
"-Wconversion", "-Wsign-conversion", "-Wno-unknown-pragmas",
110-
"-fno-stack-protector", "-Wimplicit-fallthrough", "-Wmissing-declarations",
111-
"-Wno-attributes", "-Wextra-semi", "-fno-exceptions",
112-
"-fno-rtti",
113-
"-Wno-deprecated", // this one is used to remove a warning about char_trait deprecation
114-
"-DPROJECT_VERSION=\"0.14.0-dev\"",
115-
};
116-
evmone.addCSourceFiles(.{ .root = b.path(""), .files = &[_][]const u8{
117-
"evmone/lib/evmone/advanced_analysis.cpp",
118-
"evmone/lib/evmone/eof.cpp",
119-
"evmone/lib/evmone/advanced_execution.cpp",
120-
"evmone/lib/evmone/instructions_calls.cpp",
121-
"evmone/lib/evmone/advanced_instructions.cpp",
122-
"evmone/lib/evmone/instructions_storage.cpp",
123-
"evmone/lib/evmone/baseline.cpp",
124-
"evmone/lib/evmone/tracing.cpp",
125-
"evmone/lib/evmone/baseline_instruction_table.cpp",
126-
"evmone/lib/evmone/vm.cpp",
127-
}, .flags = &cppflags });
128-
129-
evmone.addIncludePath(b.path("evmone/evmc/include"));
130-
evmone.addIncludePath(b.path("evmone/include"));
131-
evmone.addIncludePath(b.path("intx/include"));
132-
evmone.addIncludePath(b.path("ethash/include"));
133-
evmone.linkLibC();
134-
evmone.linkLibCpp();
135-
b.installArtifact(evmone);
78+
const zevem = b.dependency("zevem", .{ .target = target, .optimize = optimize });
13679

13780
const zigcli = b.dependency("zigcli", .{});
13881

@@ -144,19 +87,7 @@ pub fn build(b: *std.Build) !void {
14487
.target = target,
14588
.optimize = optimize,
14689
});
147-
exe.addIncludePath(b.path("evmone/include/evmone"));
148-
exe.addIncludePath(b.path("evmone/evmc/include"));
149-
if (target.result.cpu.arch == .x86_64) {
150-
// On x86_64, some functions are missing from the static library,
151-
// so we define dummy functions to make sure that it compiles.
152-
exe.addCSourceFile(.{
153-
.file = b.path("src/glue.c"),
154-
.flags = &cflags,
155-
});
156-
}
157-
exe.linkLibrary(ethash);
158-
exe.linkLibrary(evmone);
159-
exe.linkLibC();
90+
exe.root_module.addImport("zevem", zevem.module("zevem"));
16091
exe.root_module.addImport("zig-rlp", dep_rlp.module("zig-rlp"));
16192
exe.linkLibrary(depSecp256k1.artifact("secp256k1"));
16293
exe.root_module.addImport("zig-eth-secp256k1", mod_secp256k1);
@@ -199,19 +130,6 @@ pub fn build(b: *std.Build) !void {
199130
.target = target,
200131
.optimize = optimize,
201132
});
202-
unit_tests.addIncludePath(b.path("evmone/include/evmone"));
203-
unit_tests.addIncludePath(b.path("evmone/evmc/include"));
204-
if (target.result.cpu.arch == .x86_64) {
205-
// On x86_64, some functions are missing from the static library,
206-
// so we define dummy functions to make sure that it compiles.
207-
unit_tests.addCSourceFile(.{
208-
.file = b.path("src/glue.c"),
209-
.flags = &cflags,
210-
});
211-
}
212-
unit_tests.linkLibrary(ethash);
213-
unit_tests.linkLibrary(evmone);
214-
unit_tests.linkLibC();
215133
unit_tests.root_module.addImport("zig-rlp", dep_rlp.module("zig-rlp"));
216134
unit_tests.linkLibrary(depSecp256k1.artifact("secp256k1"));
217135
unit_tests.root_module.addImport("zig-eth-secp256k1", mod_secp256k1);

build.zig.zon

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@
77
.hash = "12201b3645a414dffc2bca872a1467b549d0029b9e36c80fcaeb22a06ec27fab9aee",
88
},
99
.@"zig-eth-secp256k1" = .{
10-
.url = "https://github.com/jsign/zig-eth-secp256k1/archive/95b7f93.tar.gz",
11-
.hash = "1220c0cf921a5311489bdd6eaf2f2b82bc9245ba39c2da346039aa311e28db633828",
10+
.url = "https://github.com/jsign/zig-eth-secp256k1/archive/6cf0d1f.tar.gz",
11+
.hash = "1220e3c49d0a2e0e7e84dcc3f8ca00b357af526a8ea28d3c848001d72bda4ddc1e66",
1212
},
1313
.httpz = .{
14-
.url = "https://github.com/karlseguin/http.zig/archive/c224ebb.tar.gz",
15-
.hash = "12206297df84406cd4eed306acef30eb2a1a6a18b6771ebb4920391a3a7299b2e6a7",
14+
.url = "https://github.com/karlseguin/http.zig/archive/46753ab.tar.gz",
15+
.hash = "12207dbe64a04fb960156cbc990153cb3637a08e3fe23077c7199621b5c6377f5d20",
1616
},
1717
.zigcli = .{
1818
.url = "https://github.com/jiacai2050/zigcli/archive/54d095c.tar.gz",
1919
.hash = "1220e8fb37224ab6ee9c575129594a808643b548596d63dd8b87cb42e22a7eed9f51",
2020
},
21+
.zevem = .{
22+
.url = "https://github.com/gballet/zevem/archive/3ce1930.tar.gz",
23+
.hash = "1220be22307447ddcb715ab71e14cd58e00215408bc235fb143a58fa8a4b51fd72ae",
24+
},
2125
},
2226
.paths = .{""},
2327
}

ethash

Lines changed: 0 additions & 1 deletion
This file was deleted.

evmone

Lines changed: 0 additions & 1 deletion
This file was deleted.

intx

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)