Skip to content

Don't expand macro body in update_value (fixes #402) - #547

Open
dcermak wants to merge 1 commit into
packit:mainfrom
dcermak:recursion-in-macro-expansion
Open

dcermak wants to merge 1 commit into
packit:mainfrom
dcermak:recursion-in-macro-expansion

Conversation

@dcermak

@dcermak dcermak commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

update_value is called via update_tag in update_version and can error out during macro expansion, which happens in setting:

Entity.disabled = md.commented_out or not expand(md.body)

But the expand is actually not really needed here, actually I have no idea why it was added in 4659111 in the first place. It is probably some leftover logic to find undefined macros?

The code works without the expand() and treats %{nil} values correctly

TODO:

  • Write new tests or update the old ones to cover new functionality.
  • Update doc-strings where appropriate.
  • [-] Update or write new documentation in packit/packit.dev.

Fixes #402

`update_value` is called via `update_tag` in `update_version` and can error out
during macro expansion, which happens in setting:
```
Entity.disabled = md.commented_out or not expand(md.body)
```
But the expand is actually not really needed here, actually I have no idea why
it was added in 4659111 in the first place. It
is probably some leftover logic to find undefined macros?

The code works without the `expand()` and treats `%{nil}` values correctly
@centosinfra-prod-github-app

Copy link
Copy Markdown
Contributor

This branch has not been deployed

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Too many levels of recursion in macro expansion error when calling Specfile.update_version()

1 participant