Commit b642db7
committed
Restore a toolchain the container was built with but no longer has
Fair point that this belongs in core rather than in vaultwarden.sh. Measured
it: 144 ct scripts call a toolchain in their update path without ensuring it
first -- 87 node, 30 uv, 16 go, 9 composer, 2 rust. Patching them one at a
time is not a fix.
Every setup_* already records what it installed under /var/cache/app-versions,
so the container knows what it was built with. When the binary that record
promises is not callable, ensure_recorded_toolchains re-runs the setup that
put it there. It runs on the update path, right after ensure_profile_loaded so
a tool that is merely off PATH is not mistaken for a missing one.
Only acts when something is actually broken: the normal cost is one
`command -v` per recorded tool. Restricted to the toolchains a build needs and
that are installed outside apt -- rust, go, nodejs, uv, composer, yq, ruby.
Unknown records are ignored rather than guessed at.
Tested against all four cases: rust recorded and cargo gone reinstalls and
comes back callable, cargo present does nothing, nothing recorded does
nothing, an unrelated record is ignored.
The vaultwarden.sh change from earlier is reverted -- it would have run
setup_rust on every update instead of only when needed, and the core check
covers the other 143 scripts too.1 parent 6347d33 commit b642db7
3 files changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
139 | 172 | | |
140 | 173 | | |
141 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
| 1107 | + | |
1107 | 1108 | | |
1108 | 1109 | | |
1109 | 1110 | | |
| |||
1131 | 1132 | | |
1132 | 1133 | | |
1133 | 1134 | | |
| 1135 | + | |
1134 | 1136 | | |
1135 | 1137 | | |
1136 | 1138 | | |
| |||
1177 | 1179 | | |
1178 | 1180 | | |
1179 | 1181 | | |
| 1182 | + | |
1180 | 1183 | | |
1181 | 1184 | | |
1182 | 1185 | | |
| |||
0 commit comments