You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[bin wrappers] fixes for only-path-without-wrappers call (#1163)
## Summary
follow up to #1160
correctness:
- consolidate some code into calling `wrapnix.GetWrapperBinPath`
- the earlier code had a bug where I forgot to call `-c <project dir>`,
but that is moot now (see below change)
perf:
- call DO_NOT_TRACK=1 to minimize segment perf impact
- simplify OnlyPathWithoutWrappers to directly call `os.Getenv("PATH")`,
remove WrapperBins, and exportify it. This function is used in a very
specific context, so we can _know_ we can skip the nix.ComputeEnv
calculation.
- Doing `time devbox shellenv only-path-without-wrappers` is now
consistently ~ 18-25 milliseconds.
I have a slight preference for this over writing PATH to a file and
sourcing it, since we may run into correctness issues with that file
getting outdated, and it'll introduce perf regression on every shellenv
call to write the file.
## How was it tested?
- [x] testscripts pass
- [x] `iex -S mix` works
visual inspection:
```
1 #!/nix/store/w849dr5qcbrrnxv69sy7kdnifa9jpjyf-bash-5.2-p15/bin/bash
2
3
4
5 if [[ "$__DEVBOX_SHELLENV_HASH_ac6a60d54a9d1ba6618cce8d40bfdfb50059d814edfe5f49bca3168c5c34e970" != "b1a4903de70aa4d610ecb00ffb3dd755913b4505651e6bebbf41571a406d415c" ]] & & [[ -z "$__DEVBOX_SHELLENV_HASH_ac6a60d54a9d1ba6618cce8d40bfdfb50059d814edfe5f49bca3168c5c34e970_GUARD" ]]; then
6 export __DEVBOX_SHELLENV_HASH_ac6a60d54a9d1ba6618cce8d40bfdfb50059d814edfe5f49bca3168c5c34e970_GUARD=true
7 eval "$(DO_NOT_TRACK=1 devbox shellenv -c /Users/savil/code/jetpack/devbox/examples/development/elixir/elixir_hello)"
8 fi
9
10 eval "$(DO_NOT_TRACK=1 devbox shellenv only-path-without-wrappers -c /Users/savil/code/jetpack/devbox/examples/development/elixir/elixir_hello)"
11
12 exec /nix/store/47whvyx9x48ishndcjw71xs7l0a6v6sd-elixir-1.14.4/bin/iex "$@"
```
0 commit comments