4 ms·
> Therefore, we do make a C call to store the env variables that are parsed lol, what? This is definitely not the way you should be trying to do whatever this
by grayhatter 2y ago
> Therefore, we do make a C call to store the env variables that are parsed
lol, what? This is definitely not the way you should be trying to do whatever this is trying to do.
I'll try to find it, and edit if I can, but I'll try to find the context for the sister thread discussing why Zig intentionally doesn't support setting env vars for a running process.
- wredue 2y agoYeah. This is some weird shit for launching multiple processes and having the first set env vars that the other then pick up. I think I’d probably be forced to bitch slap a colleague if they designed applications like that.
- IgorPartola 2y agoSo how do you picture designing a shell or an init process?
- wredue 2y agoI probably should have qualified with “unless they have an extremely good reason for doing so” That said. Applications likely to be using zdotenv are probably not what you’re talking about here and should not likely be setting env especially since setenv is “dangerous”.
- grayhatter 2y agoThe way you'd do that in Zig is by duplicating and providing that env map to the child process. You wouldn't modify the existing envmap.
- IgorPartola 2y agoYou would fork first on POSIX systems.
- grayhatter 2y agoI've written a shell in zig, you don't need to fork before building the new envmap