Commit d2aa7ac
authored
fix: create executor cache directory if missing (#220)
## Summary
- `os.MkdirTemp` in `ArchiveSource.Prepare` failed on hosts where the
default cache dir (e.g. `/root/.cache/benchmarkoor`) didn't yet exist,
since `MkdirTemp` does not create parent directories.
- Add an `os.MkdirAll` before the `MkdirTemp` call, matching the pattern
already used by `resolvePartsFile` and the git/eest sources.
Fixes the runtime error:
```
FATL | Failed to execute command error=starting executor: preparing source: creating temp directory: stat /root/.cache/benchmarkoor: no such file or directory
```
## Test plan
- [x] `go build ./pkg/executor/`
- [x] `go test ./pkg/executor/ -run TestArchive`
- [ ] Run on a fresh host where `~/.cache/benchmarkoor` does not exist
and confirm the executor starts.1 parent ddd5100 commit d2aa7ac
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
0 commit comments