Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nforro opened this issue Jul 24, 2024 · 0 comments
Labels
area/fedora Related to Fedora ecosystem complexity/single-task Regular task, should be done within days. gain/low This doesn't bring that much value to users. impact/low This issue impacts only a few users. kind/bug Something isn't working. workaround-exists There is an existing workaround that can be used in the meantime of implementing the issue.

Comments

@nforro
Copy link
Member

nforro commented Jul 24, 2024

Trivial reproducer:

# recursive macro definition
%global cflags "-O3 %{cflags}"

Name:           test
Version:        0.1
Release:        %autorelease
Summary:        Test package

License:        MIT

%description
Test package

%changelog
%autochangelog
spec = Specfile("test.spec")
spec.update_version("0.2")

This raises specfile.exceptions.RPMException: Too many levels of recursion in macro expansion. It is likely caused by recursive macro declaration..

A workaround is to define the macro (even to an empty value):

spec = Specfile("test.spec", macros=[("cflags", "")])
spec.update_version("0.2")
@nforro nforro added the workaround-exists There is an existing workaround that can be used in the meantime of implementing the issue. label Jul 24, 2024
@nforro nforro changed the title Too many levels of recursion in macro expansion error when running Specfile.update_version() Too many levels of recursion in macro expansion error when calling Specfile.update_version() Jul 24, 2024
@lbarcziova lbarcziova added kind/bug Something isn't working. area/fedora Related to Fedora ecosystem complexity/single-task Regular task, should be done within days. impact/low This issue impacts only a few users. gain/low This doesn't bring that much value to users. labels Jul 25, 2024
@lbarcziova lbarcziova moved this from new to backlog in Packit Kanban Board Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/fedora Related to Fedora ecosystem complexity/single-task Regular task, should be done within days. gain/low This doesn't bring that much value to users. impact/low This issue impacts only a few users. kind/bug Something isn't working. workaround-exists There is an existing workaround that can be used in the meantime of implementing the issue.
Projects
Status: backlog
Development

No branches or pull requests

2 participants