Skip to content

How to reset the Lua interpreter state (from Python) #3357

Answered by pmatilai
hroncok asked this question in Q&A
Discussion options

You must be logged in to vote

It's not just Lua state, parsing a spec can and very commonly does change things in the global macro space, and doing another parse without forcing a full reset (rpm.reloadConfig()) can and will yield different results to the point one might call it undefined behavior.

So no, there's no lighter way to reset the Lua state, you really need to reset the entire state between spec parses, whether the same spec or something else. Of course that the caller needs to do such a thing is a flawed design in rpm. Isolating the entire parse context to the spec struct is something I would love to do but it's a huge job.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hroncok
Comment options

Answer selected by hroncok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants