pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.29k stars 628 forks source link

avoid negatively caching path lookups for binary path requests #21406

Closed tdyas closed 2 weeks ago

tdyas commented 2 weeks ago

As described in https://github.com/pantsbuild/pants/issues/20361, Pants negatively caches binary path lookups such that Pants will not rescan the search paths if a file should be deleted from one of the search paths.

The issue exists because of how the helper subprocess used to do lookups oeprates.

This PR fixes the issue by using the system path metadata lookup from https://github.com/pantsbuild/pants/pull/21404 to scan for candidate paths when operating in the local or workspace environments.

The path lookups are only cached for each session, so each new sessions will see Pants scan the search paths again.

tdyas commented 2 weeks ago

This PR is built on top of https://github.com/pantsbuild/pants/pull/21404 (and https://github.com/pantsbuild/pants/pull/21403). Those two base PRs will need to land first.

Just review the latest commit (since the rest are from the other two PRs).