-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
std.zig.system: use both PATH and hardcoded locations to find env (2 version) #22814
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
base: master
Are you sure you want to change the base?
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. |
Should help systems that have main `env` binary in different location than hardcoded `/usr/bin/env` **during build** (not neccessarily always), 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 <[email protected]>
536daf7
to
564a861
Compare
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: