x/tools/gopls: use a per-process shared temp directory #42252
gopls can generate a fairly wide-range of temp files and directories (logs, heap dumps, temp modfiles, gc details data, and now temp workspace directories).
We should consolidate these into a top-level temp directory for the gopls process, both so that they are co-located, and so that we can have a catch-all clean up pass when the gopls process exits.
The text was updated successfully, but these errors were encountered:
Locating the workspace module by convention has multiple problems: + gopls's view of $TMPDIR might be different from the client + there might be multiple views + there might be multiple gopls sessions per pid Instead, assign a temp workspace directory for each workspace folder, and provide a command to access this information. Cleaning up all these temp directories was overcomplicated. Instead, create a temp directory for the gopls server to nest them under, that can be removed up on server shutdown. Also fix a bug where the snapshot was not acquired before copying its workspace. Updates golang/go#42252 Change-Id: I0641cebe09cd376dfa27373cac30397711c64a8f Reviewed-on: https://go-review.googlesource.com/c/tools/+/300409 Trust: Robert Findley <firstname.lastname@example.org> Run-TryBot: Robert Findley <email@example.com> gopls-CI: kokoro <firstname.lastname@example.org> TryBot-Result: Go Bot <email@example.com> Reviewed-by: Rebecca Stambler <firstname.lastname@example.org>