Skip to content

zig run should perform an execve on operating systems that support it #6531

@andrewrk

Description

@andrewrk

This is a minor regression introduced from #6250. zig run and zig test run the binary as a child process. Instead, on operating systems that support it, they should perform an execve, which is more resource-efficient and has nicer properties when using zig as a child process for these use cases.

zig/src/main.zig

Lines 1684 to 1687 in 52ba2c3

// TODO On operating systems that support it, do an execve here rather than child process,
// when watch=false and arg_mode == .run
const child = try std.ChildProcess.init(argv.items, gpa);
defer child.deinit();

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions