File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,9 +208,9 @@ impl Locator for Hatch {
208208 // Cold path: parse pyproject.toml + hatch.toml. The
209209 // mtimes we store are the ones we just probed (not
210210 // post-read). If the file changed between probe and
211- // read, the next configure() will see a different
212- // mtime than the one stored here and re-parse —
213- // self-healing under TOCTOU .
211+ // read, the next configure() with an updated mtime will
212+ // see a different value than the one stored here and
213+ // re-parse .
214214 let ( virtual_dirs, env_names) = resolve_workspace_hatch_config ( workspace) ;
215215 Arc :: new ( CachedWorkspaceConfig {
216216 pyproject_mtime,
@@ -232,6 +232,13 @@ impl Locator for Hatch {
232232 // Publish the new caches. Workspaces no longer present are
233233 // implicitly evicted because `next_parsed` was built from the
234234 // current `workspaces` set only.
235+ //
236+ // `workspace_virtual_dirs` is the only cache read by `try_from()` /
237+ // `find()`, so external observers cannot see a half-update. The
238+ // separate `parsed_cache` publish only affects future `configure()`
239+ // calls; a concurrent configure that snapshots the previous parse
240+ // cache will still validate entries against current TOML mtimes
241+ // before reusing them.
235242 * self
236243 . workspace_virtual_dirs
237244 . lock ( )
You can’t perform that action at this time.
0 commit comments