Commit dea479d
authored
[bug] Added abs path ref. to devbox binary in wrappers (#1260)
## Summary
This fixes an issue where if you install `coreutils` devbox shell in
some cases gets stuck in infinite loop due this sequence of events:
1. devbox shell creates wrappers
2. wrappers try to omit wrappers from PATH and call devbox shellenv but
it's unsuccessful
3. devbox call in wrappers uses a couple of util tools (like `tr`) that
now have their own wrappers because of coreutils.
4. the process is never able to skip the wrappers hence showing `fork:
Resource Temporarily Unavailable`
I think it addresses #881 or at least a portion of it.
The fix:
in step 3 instead of calling devbox (launcher script in /usr/local/bin)
we get the absolute path to the devbox binary and reference that
directly in wrappers script.
This way the launcher script is not called more than once and avoids
getting stuck in infinite loop.
## How was it tested?
- compile -> compiled binary is now in <path to devbox>/dist/devbox
- update line 413 of launcher (/usr/local/devbox) to `local -r
bin="<path to devbox>/dist/devbox"`
- in an empty directory run devbox init
- add `coreutils@latest` to devbox.json
- run `devbox shell`1 parent 5a44d96 commit dea479d
2 files changed
+19
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
| |||
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
0 commit comments