Uh oh!
There was an error while loading. Please reload this page.
std.zig.system: use both PATH and hardcoded locations to find env (2 version) - #22814
std.zig.system: use both PATH and hardcoded locations to find env (2 version)#22814BratishkaErik wants to merge 1 commit into
Conversation
bd985a9 to
3031d00CompareBratishkaErik
commented
Feb 8, 2025
Turns out it did not worked with mix of relative interpreters and symlinks, so I rewrote it a little bit: .
├── symlinked
│ └── interpreter -> ../interpreter_with_relative_interpreter
├── cant_find_this_interpreter
├── file_with_relative_symlinked_interpreter
├── interpreter_with_relative_interpreter
└── env -> file_with_relative_symlinked_interpreter
1) env a.k.a file_with_relative_symlinked_interpreter
#!symlinked/interpreter
2) symlinked/interpreter a.k.a interpreter_with_relative_interpreter
#!cant_find_this_interpreter
3) cant_find_this_interpreter
#!/usr/bin/fileecho"Hello?"# Alternatively:.
├── symlinked
│ └── 2 -> ../real_2
├── 3
├── env
└── real_2 |
3031d00 to
536daf7Comparealexrp
commented
Feb 24, 2025
Do you think this is important to get into 0.14.0? (Given the unexpected breakage in v1 of this PR, I'm a bit worried that it might be risky so close to the release.) |
BratishkaErik
commented
Feb 24, 2025
Hmmm... out of my existing PRs I would probably put this at the lowest priority, #22552 and #19975 are more important for me than this PR - it is much easier to patch or workaround this issue than others:
|
alexrp
commented
Mar 26, 2025
This'll need a rebase after #19928. |
536daf7 to
564a861CompareBratishkaErik
commented
Mar 27, 2025
f70e2bd to
ce467f9Comparece467f9 to
4e45b9cCompareShould help systems that have main `env` binary in different location than hardcoded `/usr/bin/env` **during build**, like Nix/Guix, Termux, Gentoo Prefix etc. Related: https://www.github.com/ziglang/zig/issues/12156https://www.github.com/ziglang/zig/issues/14146https://www.github.com/ziglang/zig/issues/14577https://www.github.com/ziglang/zig/issues/15898 This is second attempt after https://www.github.com/ziglang/zig/pull/21540 was reverted before. In this version relative paths are handled too. Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
4e45b9c to
7126841Comparealexrp
commented
Apr 25, 2026
This still looks valuable to me, but the PR has obviously gotten a bit out of sync with Zig master on Codeberg, so please resubmit there if you still want this included. |
This is second attempt after #21540 was reverted before. In this version relative paths are handled too.
Diff compare:
I have tested with following files: