Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: "0.14.1" # Set the required Zig version
version: "0.16.0" # Set the required Zig version
Comment thread
wemeetagain marked this conversation as resolved.

- name: Build and Test
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
hashtree/
zig-out/
.zig-cache/
.zig-cache/
zig-pkg/
14 changes: 7 additions & 7 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ pub fn build(b: *std.Build) void {
}),
});

const assembly_flags_default = &.{ "-g", "-fpic" };
var assembly_flags = std.ArrayList([]const u8).init(b.allocator);
assembly_flags.appendSlice(assembly_flags_default) catch unreachable;
const assembly_flags_default: []const []const u8 = &.{ "-g", "-fpic" };
var assembly_flags = std.ArrayListUnmanaged([]const u8).empty;
assembly_flags.appendSlice(b.allocator, assembly_flags_default) catch unreachable;
Comment thread
GrapeBaBa marked this conversation as resolved.

if (!target.result.cpu.arch.isAARCH64()) {
assembly_flags.append("-fno-integrated-as") catch unreachable;
assembly_flags.append(b.allocator, "-fno-integrated-as") catch unreachable;
}

// Add the assembly and C source files
// Only arm64 and x86 architectures have optimized assembly implementations.
// All other architectures will use the generic fallback C implementation.

lib.addCSourceFiles(.{
lib.root_module.addCSourceFiles(.{
.root = upstream.path("src"),
.files = if (target.result.cpu.arch.isArm() or target.result.cpu.arch.isAARCH64())
&[_][]const u8{
Expand All @@ -50,7 +50,7 @@ pub fn build(b: *std.Build) void {
.flags = assembly_flags.items,
});

lib.addCSourceFiles(.{
lib.root_module.addCSourceFiles(.{
.root = upstream.path("src"),
.files = &[_][]const u8{
"hashtree.c",
Expand All @@ -62,7 +62,7 @@ pub fn build(b: *std.Build) void {
"-Werror",
},
});
lib.addIncludePath(upstream.path("src"));
lib.root_module.addIncludePath(upstream.path("src"));

lib.installHeader(upstream.path("src/hashtree.h"), "hashtree.h");
b.installArtifact(lib);
Expand Down
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
.version = "0.1.0",
.dependencies = .{
.hashtree = .{
.url = "git+https://github.com/offchainlabs/hashtree#f733b7698511b5498b722421a30ddf7e5066497c",
.hash = "N-V-__8AANPhDADGDLYAKqml8U-1jREHVH_-5vi9Mcwsf6oi",
.url = "git+https://github.com/offchainlabs/hashtree#fba14494dada4420440d985c2c516341d9c24b9b",
.hash = "N-V-__8AAJ03FACfm8Hlfs97yP3-2Hd5ZzSv9yYuoEi3Yi_B",
},
},
.fingerprint = 0xf963e115bea813b0,
Comment thread
GrapeBaBa marked this conversation as resolved.
.minimum_zig_version = "0.14.0",
.minimum_zig_version = "0.16.0",
Comment thread
wemeetagain marked this conversation as resolved.
.paths = .{
"build.zig",
"build.zig.zon",
Expand Down
Loading