Skip to content

Commit 1e2afcc

Browse files
committed
fix windows build and update dependencies
1 parent 84e3689 commit 1e2afcc

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

build.zig

+21-18
Original file line numberDiff line numberDiff line change
@@ -419,24 +419,27 @@ pub fn build(b: *std.Build) !void {
419419

420420
const test_step = b.step("test", "Run core unit tests (requires python)");
421421
{
422-
// Fix the test fixture file permissions. This is necessary because Zig does
423-
// not respect the execute permission on arbitrary files it extracts from dependencies.
424-
// Since we need those files to have the execute permission set for tests to
425-
// run successfully, we need to patch them before we bake them into the
426-
// test executable. While modifying the global cache is hacky, it wont break
427-
// hashes for the same reason above.
428-
for ([_]std.Build.LazyPath{
429-
libgit_root.path(b, "tests/resources/filemodes/exec_on"),
430-
libgit_root.path(b, "tests/resources/filemodes/exec_off2on_staged"),
431-
libgit_root.path(b, "tests/resources/filemodes/exec_off2on_workdir"),
432-
libgit_root.path(b, "tests/resources/filemodes/exec_on_untracked"),
433-
}) |lazy| {
434-
const path = lazy.getPath2(b, null);
435-
const file = try std.fs.cwd().openFile(path, .{
436-
.mode = .read_write,
437-
});
438-
defer file.close();
439-
try file.setPermissions(.{ .inner = .{ .mode = 0o755 } });
422+
if (@import("builtin").os.tag != .windows) {
423+
424+
// Fix the test fixture file permissions. This is necessary because Zig does
425+
// not respect the execute permission on arbitrary files it extracts from dependencies.
426+
// Since we need those files to have the execute permission set for tests to
427+
// run successfully, we need to patch them before we bake them into the
428+
// test executable. While modifying the global cache is hacky, it wont break
429+
// hashes for the same reason above. -blurrycat 3/31/25
430+
for ([_]std.Build.LazyPath{
431+
libgit_root.path(b, "tests/resources/filemodes/exec_on"),
432+
libgit_root.path(b, "tests/resources/filemodes/exec_off2on_staged"),
433+
libgit_root.path(b, "tests/resources/filemodes/exec_off2on_workdir"),
434+
libgit_root.path(b, "tests/resources/filemodes/exec_on_untracked"),
435+
}) |lazy| {
436+
const path = lazy.getPath2(b, null);
437+
const file = try std.fs.cwd().openFile(path, .{
438+
.mode = .read_write,
439+
});
440+
defer file.close();
441+
file.setPermissions(.{ .inner = .{ .mode = 0o755 } });
442+
}
440443
}
441444

442445
const gen_cmd = b.addSystemCommand(&.{"python3"});

build.zig.zon

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99
.hash = "N-V-__8AAJbmLwHHxHDWkz0i6WIR6FpNe6tXSLzaPuWtvBBg",
1010
},
1111
.openssl = .{
12-
.url = "https://github.com/allyourcodebase/openssl/archive/refs/tags/3.3.1-1.tar.gz",
13-
.hash = "openssl-3.3.1-1-AAAAACi3ZAB8QM76OP6Q5CMN-6Llx2s34e42YCUSytj_",
12+
.url = "git+https://github.com/allyourcodebase/openssl.git#f348124c5382bcc377f1b3277357cbf2ed2fb8db",
13+
.hash = "openssl-3.3.1-2-TC9C3Se3ZACF5WO_CjoD7Bt_X94oCsAAbbwhOp1rTZBe",
1414
.lazy = true,
1515
},
1616
.mbedtls = .{
17-
// @Temporary waiting for patch to be upstreamed (https://github.com/allyourcodebase/mbedtls/pull/2)
18-
.url = "git+https://github.com/Parzival-3141/mbedtls#b9ec01cbaf29e19f8fc3b40e541bd86a6878027f",
17+
.url = "git+https://github.com/allyourcodebase/mbedtls#7d862fe61ff2eac37ee54e1e017fc287bed1cd7a",
1918
.hash = "mbedtls-3.6.2-E4NURzYUAABWLBwHJWx_ppb_j2kDSoGfCfR2rI2zs9dz",
2019
.lazy = true,
2120
},

0 commit comments

Comments
 (0)