mesonbuild / mesonbuild/meson

Modules are global to all subprojects and references to the Interpreter are never updated

Open
#4,094 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug parser/interpreter subprojects/wraps
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.