Skip to content

Commit

Permalink
work around Zig issue 12816
Browse files Browse the repository at this point in the history
  • Loading branch information
schmee committed Jan 24, 2024
1 parent 101c883 commit 5fb28d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 4 additions & 0 deletions src/test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down

0 comments on commit 5fb28d3

Please sign in to comment.