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

Conditional build dependencies seem to be resolved on host #336

Closed
hroncok opened this issue Sep 18, 2019 · 2 comments
Closed

Conditional build dependencies seem to be resolved on host #336

hroncok opened this issue Sep 18, 2019 · 2 comments

Comments

@hroncok
Copy link
Contributor

hroncok commented Sep 18, 2019

Short description of the problem

Conditional BRs (with if in them) seem to be evaluated on host.

Output of rpm -q mock

mock-1.4.18-1.fc30.noarch

Steps to reproduce issue

Run on Fedora 29, 30 or 31. Get this spec:

Name:           reproducer_if
Version:        0.0
Release:        1%{?dist}
Summary:        ...
License:        MIT
BuildRequires:  python3
BuildRequires:  (python3dist(importlib-metadata) if python3 < 3.8)

%description
...

Create a SRPM:

$ rpmbuild -bs reproducer_if.spec

See the dependencies:

$ rpm -qp --requires ../SRPMS/reproducer_if-0.0-1.fc30.src.rpm 
(python3dist(importlib-metadata) if python3 < 3.8)
python3
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(RichDependencies) <= 4.12.0-1

Attempt a rawhide mockbuild:

$ mock -r fedora-rawhide-x86_64 ../SRPMS/reproducer_if-0.0-1.fc30.src.rpm 
...
No matching package to install: '(python3dist(importlib-metadata) if python3 < 3.8)'
Package python3-3.8.0~b4-1.fc32.x86_64 is already installed.
Not all dependencies satisfied
Error: Some packages could not be found.

Any additional notes

The conditional works good on Fedora 32. However mock running on Fedora 30 seems to choke on it. The package providing python3dist(importlib-metadata) was retired on Fedora 32, because it is not needed with Python 3.8.

cc @encukou

See also fedora-infra/koschei#295

@hroncok
Copy link
Contributor Author

hroncok commented Sep 18, 2019

This also affects dynamic buildrequires. When a rawhide build prints (python3dist(importlib-metadata) if python3 < 3.8) in %generate_buildrequires, Fedora 30 mock exists with No matching package to install: '(python3dist(importlib-metadata) if python3 < 3.8)'

@xsuchy
Copy link
Member

xsuchy commented Sep 30, 2019

After quick debugging session with Jarda M. we found that this is DNF bug. https://bugzilla.redhat.com/show_bug.cgi?id=1756902

@xsuchy xsuchy closed this as completed Sep 30, 2019
karelyatin pushed a commit to rdo-common/pytest that referenced this issue Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants