Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andrewrk opened this issue Oct 4, 2020 · 1 comment
Closed
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Oct 4, 2020

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();

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. frontend Tokenization, parsing, AstGen, Sema, and Liveness. labels Oct 4, 2020
@andrewrk andrewrk added this to the 0.8.0 milestone Oct 4, 2020
g-w1 added a commit to g-w1/zig that referenced this issue Oct 11, 2020
@andrewrk andrewrk changed the title zig test and zig run should perform an execve on operating systems that support it zig run should perform an execve on operating systems that support it Oct 16, 2020
@andrewrk
Copy link
Member Author

Note that zig test should not because we want to print the error message and command line on failure.

@andrewrk andrewrk modified the milestones: 0.8.0, 0.7.0 Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

No branches or pull requests

1 participant