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

Attempt to expand macros before processing conditions #394

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

nforro
Copy link
Member

@nforro nforro commented Jul 1, 2024

Fixes #391.

RELEASE NOTES BEGIN

specfile now tries to expand macros before processing conditions to be able to resolve conditional expressions defined by macros, for example OpenSUSE Tumbleweed defines %ifpython3 macro as %if "%{python_flavor}" == "python3".

RELEASE NOTES END

Macros can expand to conditional expressions, for example
OpenSUSE Tumbleweed defines `%ifpython3` macro as
`%if "%{python_flavor}" == "python3"`. Try to expand macros first
to be able to process such conditions but ignore expansion errors.

Signed-off-by: Nikola Forró <nforro@redhat.com>
Conditions using these statements with a macro as a parameter
(e.g. `%ifarch %ix86`) weren't resolved properly because the macro
wasn't expanded.

Signed-off-by: Nikola Forró <nforro@redhat.com>
Copy link

We were not able to find or create Copr project packit/packit-specfile-394 specified in the config with the following error:

Cannot create a new Copr project (owner=packit project=packit-specfile-394 chroots=['epel-8-x86_64']): Response is not in JSON format, there is probably a bug in the API code.

Please check your configuration for:

  1. typos in owner and project name (groups need to be prefixed with @)
  2. whether the project name doesn't contain not allowed characters (only letters, digits, underscores, dashes and dots must be used)
  3. whether the project itself exists (Packit creates projects only in its own namespace)
  4. whether Packit is allowed to build in your Copr project
  5. whether your Copr project/group is not private

Copy link
Contributor

Build succeeded.
https://softwarefactory-project.io/zuul/t/packit-service/buildset/f25a10560b244f74aa1b4013e358a199

✔️ pre-commit SUCCESS in 2m 16s
✔️ specfile-tests-rpm-deps SUCCESS in 1m 10s
✔️ specfile-tests-pip-deps SUCCESS in 1m 07s

@nforro
Copy link
Member Author

nforro commented Jul 1, 2024

/packit rebuild-failed

@nforro nforro added the mergeit Zuul, merge it! label Jul 2, 2024
Copy link
Contributor

Build succeeded (gate pipeline).
https://softwarefactory-project.io/zuul/t/packit-service/buildset/74f7cf3af4ec489d8c928f65609406de

✔️ pre-commit SUCCESS in 2m 10s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 1a40ae6 into main Jul 2, 2024
27 of 28 checks passed
@nforro nforro deleted the conditions branch July 2, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit Zuul, merge it!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

specfile fails to extract tags from python-mysqlclient.spec for openSUSE
2 participants