authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2024-04-13 15:30:03+02:00
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2024-06-09 01:55:50+02:00
log44443b833b9c86cb5a3c50b157f13ab4097226d8
treef2636ad2d00caac8d1f6ff7663dafc0710a983df
parentfba6b7e4c20c3d1e1701ad737ad47a2440f44ea7
signaturebadge-check Signed by SSH key SHA256:ZS52FNyUv2WUXvO4njmVaFVO46RHojFuOrxRc4LuKzg

build: inherit setExecCmd from test compile steps when creating run steps

This should fix #17756

1 files changed, 17 insertions(+), 3 deletions(-)

lib/std/Build.zig+17-3
......@@ -972,10 +972,24 @@ pub fn addRunArtifact(b: *Build, exe: *Step.Compile) *Step.Run {
972972 // Consider that this is declarative; the run step may not be run unless a user
973973 // option is supplied.
974974 const run_step = Step.Run.create(b, b.fmt("run {s}", .{exe.name}));
975 run_step.addArtifactArg(exe);
975 if (exe.kind == .@"test") {
976 if (exe.exec_cmd_args) |exec_cmd_args| {
977 for (exec_cmd_args) |cmd_arg| {
978 if (cmd_arg) |arg| {
979 run_step.addArg(arg);
980 } else {
981 run_step.addArtifactArg(exe);
982 }
983 }
984 } else {
985 run_step.addArtifactArg(exe);
986 }
976987
977 if (exe.kind == .@"test" and exe.test_server_mode) {
978 run_step.enableTestRunnerMode();
988 if (exe.test_server_mode) {
989 run_step.enableTestRunnerMode();
990 }
991 } else {
992 run_step.addArtifactArg(exe);
979993 }
980994
981995 return run_step;