#Running multiple instances of the program with build.zig

1 messages · Page 1 of 1 (latest)

twin ferry
#

Is there an idiomatic way of running multiple instances of a program with build.zig? I'm thinking will probably need to use b.addSystemCommand() but wasn't sure if there was a more idiomatic way

surreal forge
#

do you want to run an progam created with addExecutable multiple times?

#
    const run_cmd = b.addRunArtifact(exe);
    const run2_cmd = b.addRunArtifact(exe);

    run_cmd.step.dependOn(b.getInstallStep());
    run2_cmd.step.dependOn(b.getInstallStep());

    const run_step = b.step("run", "Run the app");
    run_step.dependOn(&run_cmd.step);
    run_step.dependOn(&run2_cmd.step);
little stump
#

Does run them concurrently though, or one after the other ?

I can think of of use cases where you might want zig build run to bring up multiple instances of a thing concurrently- like a server process, a client, and a message broker or something

How to “run in background” from build.zig in a portable way ?

twin ferry