bazel-contrib / bazel-contrib/rules_go
Fix leaks in /tmp
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 760
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
In a recent discussion with my team, we discovered that our shared dev environment is filled with `/tmp/rules_go_work-XXXXX` not being clean up.

I think this is because we are currently calling the cleanup function for this tmpdir in a `defer()` statement, which will not be executed if somewhere down the stack `log.Fatalf()` is called.
We should ensure that either `fatal` is only used in the outer `main()` func, or we have a reliable cleanup that survives `os.Exit` and `log.Fatal`
Contributor guide
Research direction
Start by tracing the tmpdir cleanup function and the call sites that use fatal, especially the outer main() entry point mentioned in the issue. Confirm the cleanup behavior on fatal exits and ensure the relevant exit paths no longer leave /tmp/rules_go_work-XXXXX directories behind.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100