From 5fb28d3ca18de5d8591df1219bae44af72c3e536 Mon Sep 17 00:00:00 2001 From: John Schmidt Date: Wed, 24 Jan 2024 23:36:14 +0100 Subject: [PATCH] work around Zig issue 12816 --- .github/workflows/build.yml | 4 ++++ src/test.zig | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 146c49c..742e4b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,14 @@ jobs: - name: Zig build test Debug run: | zig build test + env: + PATH: "/" - name: Zig build test Release run: | zig build test -Drelease + env: + PATH: "/" - name: Zig build cross run: | diff --git a/src/test.zig b/src/test.zig index 275cd4f..612b8e8 100644 --- a/src/test.zig +++ b/src/test.zig @@ -166,9 +166,13 @@ fn runCommand(db_path: []const u8, input: []const u8) !void { for (try splitArg(input)) |arg| { try argv.append(arg); } + var env = std.process.EnvMap.init(allocator); + try env.put("PATH", "/"); const result = try std.ChildProcess.exec(.{ .allocator = allocator, .argv = argv.items, + // Work around https://github.com/ziglang/zig/issues/12816 + .env_map = &env, }); if (print_output) { std.debug.print("{s} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n", .{input});