-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
std: add compile error when using std.os.getenv
on the wasi target
#17140
std: add compile error when using std.os.getenv
on the wasi target
#17140
Conversation
I do wonder what happens in this block when targeting WASI: Lines 1896 to 1908 in 047efec
Given nothing prepopulates |
When targeting WASI and libc is linked,
|
Didn't know that was the case. It's great then 👍 |
Head branch was pushed to by a user without write access
047efec
to
c254346
Compare
Head branch was pushed to by a user without write access
34ea0af
to
c6a37f5
Compare
I'm not sure why CI is failing on linux. I'm going to check how to reproduce this locally so I can iterate faster. |
It's failing when running
So it's failing because of the zig/lib/std/zig/system/NativePaths.zig Lines 103 to 155 in 8fb4a4e
My initial thought is that the condition should just be changed to if (builtin.os.tag != .windows and builtin.os.tag != .wasi) { but I'm not familiar enough with this code. Either way, this is finding a real bug since those cc @kubkon @andrewrk: Is this branch in |
`std.process.getEnvMap` or `std.process.getEnvVarOwned` should be used instead, requiring allocation.
Head branch was pushed to by a user without write access
c6a37f5
to
8d8c302
Compare
I have updated the PR, thanks again @squeek502! I am not familiar with Zig and its build process, however in terms of WASI, unless the build machinery is doing something I am missing, adding Not so sure about the include paths right now, that depends. I have updated the PR to skip the whole block though and check on CI. |
Shoutout to @voigt for having stumbled upon the original issue! |
std.process.getEnvMap
orstd.process.getEnvVarOwned
should be used instead, requiring allocation.Fixes: #17117
Thanks to @squeek502 for the pointer!