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
3031d00
Compare
|
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/file
echo "Hello?"
# Alternatively:
.
├── symlinked
│ └── 2 -> ../real_2
├── 3
├── env
└── real_2 |
3031d00 to
536daf7
Compare
|
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.) |
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:
|
|
This'll need a rebase after #19928. |
536daf7 to
564a861
Compare
f70e2bd to
ce467f9
Compare
ce467f9 to
4e45b9c
Compare
Should 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/12156 https://www.github.com/ziglang/zig/issues/14146 https://www.github.com/ziglang/zig/issues/14577 https://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
7126841
Compare
|
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: