Skip to content

Conversation

bonzini
Copy link
Collaborator

@bonzini bonzini commented Oct 4, 2025

Most of the time the required information is already present in the environment. For the rest, move it from Interpreter to Build or CoreData. Then the interpreter object does not need to exist past finalize_postconf_hooks.

Related: #15064

@bonzini bonzini changed the title Backend interpreter verboten Detach the Interpreter from the Backend Oct 4, 2025
@bonzini bonzini force-pushed the backend-interpreter-verboten branch from d23426a to 9c97f9d Compare October 4, 2025 13:35
@bonzini bonzini added the refactoring No behavior changes label Oct 4, 2025
@bonzini bonzini force-pushed the backend-interpreter-verboten branch from 9c97f9d to ff4661a Compare October 4, 2025 13:58
@bonzini bonzini marked this pull request as ready for review October 4, 2025 15:11
@bonzini bonzini requested a review from jpakkane as a code owner October 4, 2025 15:11
@bonzini bonzini force-pushed the backend-interpreter-verboten branch from ff4661a to aa3b281 Compare October 6, 2025 14:38
@bonzini bonzini force-pushed the backend-interpreter-verboten branch 5 times, most recently from b7a991e to 763684c Compare October 9, 2025 19:12
There is no generator list in the Interpreter.

Signed-off-by: Paolo Bonzini <[email protected]>
GeneratedList does not need the full interpreter, only the source
and build directories which can be found in Environment.

Signed-off-by: Paolo Bonzini <[email protected]>
Objects like targets already store the environment in which they
were created, do the same for Generator: pass it to the constructor
and use it in process_files.

Signed-off-by: Paolo Bonzini <[email protected]>
All that is needed is the subdir, pass it explicitly (and make it
an optional argument so that the backend does not have to pass it).

Signed-off-by: Paolo Bonzini <[email protected]>
The interpreter's build_def_files are the only remaining piece
of interpreter state used by the backend.  Compute it once
and store it in build, using a property to ensure that it's initialized
and accessed correctly.

This also removes one of the cases in which introspection uses the
interpreter object.

Signed-off-by: Paolo Bonzini <[email protected]>
Another place where the interpreter is accessed surreptitiously is
dependency introspection, which looks at the variables.  Do that
at setup time instead while the interpreter is alive.

Signed-off-by: Paolo Bonzini <[email protected]>
No one is accessing backend.interpreter anymore, get rid of it
to avoid future temptations.

Signed-off-by: Paolo Bonzini <[email protected]>
@bonzini bonzini force-pushed the backend-interpreter-verboten branch from 763684c to 7a52310 Compare October 16, 2025 09:18
@dcbaker dcbaker merged commit 9f83bbb into mesonbuild:master Oct 16, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring No behavior changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants