Since RPM rpm-4.18.0-0.alpha1.1.fc37 it seem that many (if not all) packages with Python %generate_buildrequires fail mockbuilds. To reproduce, submit a Koji scratchbuild or do the following: $ mock -r fedora-rawhide-x86_64 clean $ mock -r fedora-rawhide-x86_64 --scrub=all $ fedpkg --release rawhide mockbuild -N --enablerepo=local For example with python-parso, python-setuptools or the example from [1] (use mock -r fedora-rawhide-x86_64 --enablerepo=local python-pello-1.0.3-1.fc35.src.rpm). [1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_example_spec_file We get, more or less: Executing(%generate_buildrequires): Dependencies resolved... dnf installs. Executing(%generate_buildrequires): Dependencies resolved... dnf installs. Executing(%generate_buildrequires): Dependencies resolved... Nothing to do. Executing(%generate_buildrequires): Wrote: /builddir/build/SRPMS/python-pello-1.0.3-1.fc37.buildreqs.nosrc.rpm Finish: rpmbuild python-pello-1.0.3-1.fc35.src.rpm Finish: build phase for python-pello-1.0.3-1.fc35.src.rpm ERROR: Exception(/home/churchyard/rpmbuild/SRPMS/python-pello-1.0.3-1.fc35.src.rpm) Config(fedora-rawhide-x86_64) 0 minutes 53 seconds Previously, we got: Executing(%generate_buildrequires): Dependencies resolved... dnf installs. Executing(%generate_buildrequires): Dependencies resolved... dnf installs. Executing(%generate_buildrequires): Dependencies resolved... Nothing to do. Executing(%build): ...
This happens in local mock, in Koji, and in Copr.
This also happens with Rust packages, not just Python.
Ack, I'll look into it. Thanks for the report.
Should be fixed in rpm-4.18.0-0.alpha1.2.fc37, building now.
It's not fixed. All packages using %generate_buildrequires still fail to build in rawhide: (from the build.log of rust-anyhow from koschei): Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.KfRR7b + umask 022 + cd /builddir/build/BUILD + cd anyhow-1.0.56 + /usr/bin/cargo-inspector -BR Cargo.toml + /usr/bin/cargo-inspector -TR Cargo.toml + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/rust-anyhow-1.0.56-1.fc37.buildreqs.nosrc.rpm Child return code was: 11 EXCEPTION: [Error()] Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/mockbuild/trace_decorator.py", line 93, in trace result = func(*args, **kw) File "/usr/lib/python3.10/site-packages/mockbuild/util.py", line 599, in do_with_status raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode) mockbuild.exception.Error: Command failed: # bash --login -c /usr/bin/rpmbuild -ba --noprep --target x86_64 --nodeps /builddir/build/SPECS/rust-anyhow.spec
Indeed rpm-4.18.0-0.alpha1.2.fc37 does not fix this.
Ok, there's more than one bug then... back to investigating then.
I'm curious if we could coordinate on some /bin/mock integration test for %generate_buildrequires for the future?
I'm adding tests for anything found here to rpm's test-suite. It covers a bunch of %generate_depends cases already but apparently some important ones are missing... so yes.
I meant something like "Fedora CI" check, something which would trigger a mock build for the PR before it gets merged (with fixed RPM on host/in chroot). Then you would have early feedback about a potential breakage like this. Example: https://src.fedoraproject.org/rpms/tar/pull-request/7
And yeah there was another regression, occuring specifically with -ba --nodeps when dynamic buildrequires are present. Building now, should be fixed in rpm-4.18.0-0.alpha1.3. Knock wood. Covering all the myriad of switches in all possible scenarios is simply impossible but since this is something mock relies on for normal operation we'll better add a test. I wont stop anybody from writing a Fedora CI level check, but I want my behind covered at rpm upstream level.
Meh, nope, it gets further but runs into some yet another untested problem :(
Okay, seems third time's the charm, at least python-parso and python-setuptools are in mock again with rpm-4.18.0-0.alpha1.4. Pooh. Apologies for the inconvenience.
> I wont stop anybody from writing a Fedora CI level check... Feel free to reopen this BZ for that purpose, but the problem itself is fixed, so closing. Thanks for the fix. For inspiration, see https://src.fedoraproject.org/rpms/pyproject-rpm-macros/blob/rawhide/f/tests/mocktest.sh
And I guess the easiest way is to just run our own tests: https://src.fedoraproject.org/rpms/rpm/pull-request/24 Note that this runs when you open a PR and it seems that is sadly not your workflow in the rpm package.