Skip to content

fix[tool]: keep import search paths request-local - #5262

Open
DicksonWu654 wants to merge 1 commit into
vyperlang:masterfrom
DicksonWu654:fix/inputbundle-local-search-paths
Open

DicksonWu654 wants to merge 1 commit into
vyperlang:masterfrom
DicksonWu654:fix/inputbundle-local-search-paths

Conversation

@DicksonWu654

Copy link
Copy Markdown

What I did

Allow InputBundle.load_file() to receive a call-local search-path sequence and use it without replacing InputBundle.search_paths. ImportAnalyzer now passes its absolute or relative resolution paths directly.

This preserves existing behavior for ordinary callers while making resolution deterministic when an input bundle is reused by overlapping callers.

How I did it

  • added a keyword-only search_paths override to load_file()
  • retained existing reverse-precedence behavior and default bundle paths
  • removed ImportAnalyzer use of temporary_search_paths
  • added synchronized regression coverage for two relative imports sharing one bundle

Tests

125 passed across the input-bundle tests and relevant interface/module import suites.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T23:17:04.929858Z aa434d9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa434d9906

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


with self.input_bundle.temporary_search_paths(search_paths):
return self.input_bundle.load_file(path)
return self.input_bundle.load_file(path, search_paths=search_paths)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make the top-level search path request-local too

When two CompilerData instances sharing a bundle compile entrypoints from different directories concurrently, CompilerData._resolve_imports still appends each entrypoint directory to the shared input_bundle.search_paths at vyper/compiler/phases.py:167, and each ImportAnalyzer snapshots that contaminated list. Consequently, this call-local override can still resolve an absolute import from the other request's higher-precedence directory; the overlapping context managers can also pop one another's paths. Pass the entrypoint directory into the analyzer without mutating the bundle so the initial absolute-search-path snapshot is request-local as well.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant