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

fixes #6531 #6653

Closed
wants to merge 7 commits into from
Closed

fixes #6531 #6653

wants to merge 7 commits into from

Conversation

g-w1
Copy link
Contributor

@g-w1 g-w1 commented Oct 11, 2020

I used execvpe because std.os had a wrapper for it. The only downside is that it needs memory allocation because getEnvMap needs an allocator.

Is execvpe supported on any other os besides linux in zig?

@kubkon kubkon added stage1 The process of building from source via WebAssembly and the C backend. frontend Tokenization, parsing, AstGen, Sema, and Liveness. labels Oct 11, 2020
@g-w1
Copy link
Contributor Author

g-w1 commented Oct 11, 2020

I don't think this will work with zig test because execve transfers the program to the new executable which means it will not be able to tell you if a test failed.

src/main.zig Outdated Show resolved Hide resolved
src/main.zig Outdated Show resolved Hide resolved
src/main.zig Outdated Show resolved Hide resolved
@g-w1
Copy link
Contributor Author

g-w1 commented Oct 12, 2020

I just added the suggestions. To avoid a memory leak, I had to remove the defer and deinit env_vars after const err = ....

@andrewrk
Copy link
Member

@kubkon there is no stage1 code here

@andrewrk andrewrk removed the stage1 The process of building from source via WebAssembly and the C backend. label Oct 15, 2020
@andrewrk andrewrk closed this in 0da027f Oct 16, 2020
@andrewrk
Copy link
Member

Thanks @g-w1

@g-w1 g-w1 deleted the zig-test-zig-run-execve branch October 16, 2020 00:59
@kubkon
Copy link
Member

kubkon commented Oct 16, 2020

@kubkon there is no stage1 code here

Shoot, sorry for the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants