pants icon indicating copy to clipboard operation
pants copied to clipboard

Anonymize sandbox paths instead of stripping completely

Open tgolsson opened this issue 1 year ago • 3 comments

This is a partial reversal of #19923 which ended up stripping all mentions the sandbox in such a way that debugging some issues becomes very hard. For example this thread on Slack, which was spawned by this thread. In both cases, the stripping of paths led to undebuggable issues because I couldn't trust the output and I couldn't see if paths were correct.

This PR attempts to strike a middle ground where we anonymize the sandbox paths. In practice, this should have as high cache hit rate as before but should leave some breadcrumbs when multiple sandboxes might be involved, and show that absolute paths are absolute, and so on.

Also converts the regex to a non-greedy variant, as it'd otherwise strip too much in a string like /tmp/pants-sandbox-.../:/tmp/pants-sandbox/..., removing full first item. Now it will take as few characters as possible, which should behave better.

tgolsson avatar Feb 05 '24 21:02 tgolsson

When you have a chance, please merge main (or rebase onto it) and add some release notes to docs/notes/2.22.x.md. See https://github.com/pantsbuild/pants/discussions/20888 for more info.

huonw avatar May 10 '24 00:05 huonw

@huonw Notes added, PTAL before I merge?

tgolsson avatar May 13 '24 16:05 tgolsson