Commit ad0ab22
feat(file_ops): Implement Branch 4 solution with JSON config and WASI sandbox mapping
Key improvements:
- Eliminated runfiles dependency that was failing with 'no runfiles found'
- Pass all paths (wasmtime, WASM component) via JSON config from Bazel
- Expose WASM component file in file_ops_toolchain
- Map entire Bazel sandbox root to / in WASI sandbox for file access
- Convert operations to absolute paths compatible with WASI sandbox mapping
- Add debug logging for sandbox environment troubleshooting
- Add wasmtime_toolchain_type to go_wasm_component rule
Architecture:
- Bazel passes paths via JSON config to avoid runfiles fragility
- file_ops Go binary locates wasmtime and WASM component from config
- Maps sandbox root to WASI root for hermetic file operations
- Operations are converted to absolute sandbox-root paths
This is a solid Bazel-native foundation that eliminates the runfiles issue.
The remaining work is final path resolution tuning in the WASI sandbox.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 846925e commit ad0ab22
File tree
6 files changed
+211
-116
lines changed- go
- toolchains
- tools
- bazel_helpers
- file_ops
6 files changed
+211
-116
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
831 | 831 | | |
832 | 832 | | |
833 | 833 | | |
| 834 | + | |
834 | 835 | | |
835 | 836 | | |
836 | 837 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
154 | 160 | | |
155 | | - | |
| 161 | + | |
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
| |||
208 | 214 | | |
209 | 215 | | |
210 | 216 | | |
| 217 | + | |
| 218 | + | |
211 | 219 | | |
212 | | - | |
| 220 | + | |
213 | 221 | | |
| 222 | + | |
| 223 | + | |
214 | 224 | | |
215 | 225 | | |
216 | 226 | | |
| |||
457 | 467 | | |
458 | 468 | | |
459 | 469 | | |
| 470 | + | |
460 | 471 | | |
461 | 472 | | |
462 | 473 | | |
0 commit comments