Modules are global to all subprojects and references to the Interpreter are never updated
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 1.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 33
Description
Basically, we have one single module of a kind for the whole process, but the Module has a reference to an interpreter.
Imagine a simple project A with a subproject B, project A does import('mymodule'), now mymodule is being initialized with:
def initialize(interpreter):
return MyModule(interpreter)
So probably MyModule keeps a reference to the interpreter to use it later (to use source_strings_to_files method for example) but.. once we enter project B and do import('mymodule') again the same MyModule object is used, so when we use that object the interpreter we kept a reference on is the one from module A meaning using that function returns wrong values.
This was discoverer when working on #4016 but should definitely not block it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how modules are initialized and cached when project A and subproject B each import the same module. Reproduce the two-project scenario described in the issue and inspect how the module retains its Interpreter reference. Done means a module used by B no longer uses A's Interpreter for later operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100