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 3cbd7c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

env:
PATH: "/"

jobs:
build:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub fn build(b: *std.Build) !void {
.link_libc = true,
});
const run_tests = b.addRunArtifact(tests);
run_tests.step.dependOn(b.getInstallStep());
test_step.dependOn(&run_tests.step);
}

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 3cbd7c3

Please sign in to comment.