@@ -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" });
0 commit comments