python-ruamel-yaml/10.patch
Miro Hrončok 7ce90a3638 Fix the bootstrap build
- Related: rhbz#2323169

The problem this fixes is a bit complex.

It goes like this:

 1.  %pyproject_buildrequires runs for the first time.
     There is no pyproject.toml, only setup.py, so a dependency on setuptools is generated.
     A build dependency on wheel is not generated (as it is not needed on Fedora 42+).
 2.  %pyproject_buildrequires runs again.
     There is no pyproject.toml, only setup.py, so it is used.
     A build dependency on wheel is still not generated.
     A build dependency on ruamel-yaml-clib is generated when building without bootstrap,
     as it is a runtime dependency.
     Here it comes: setup.py code creates a pyproject.toml file (with a dependency on wheel) 😱
 3a. Without bootstrap, dnf installs ruamel-yaml-clib and %%pyproject_buildrequires runs once more.
     It uses pyproject.toml (which now exists).
     A build dependency on wheel is now generated and %pyproject_buildrequires runs once more,
     dnf install wheel.
 3b. With bootstrap, this step is skipped as there was no new dependency (on ruamel-yaml-clib) to trigger it.
 4.  The final (verification) %pyproject_buildrequires round uses pyproject.toml (which now exists).
     Without bootstrap, all is fine, no new dependency is generated.
     With bootstrap, the wheel dependency is generated for the first time,
     but at this point, it fails rpmbuild (because missing dependencies now fail the build).

We see errors like this as a result:

    error: Failed build dependencies:
        python3dist(wheel) is needed by python-ruamel-yaml-0.18.6-2.fc42~bootstrap.noarch

Considering the wheel dependency is entirely unneeded I proposed removal for upstream.

An alternative solution is to rm -f pyproject.toml
before calling %pyproject_buildrequires in %generate_buildrequires.
But if upstream switches to a proper pyproject.toml, we might not notice that.
2024-12-02 15:04:47 +01:00

28 lines
1 KiB
Diff

# HG changeset patch
# User Miro Hrončok <miro@hroncok.cz>
# Date 1733147018 -3600
# Mon Dec 02 14:43:38 2024 +0100
# Node ID 0c7d924a643f990dd365db57ac3d52baf7db34fb
# Parent 0bef9fa8b3c43637cd90ce3f2e299e81c2122128
Do not specificity build-system.requires on wheel
When building from pyproject.toml, setuptools only needed wheel for building wheels.
It was never needed needed to build sdists.
Setuptools knww this and properly generated the dependency on wheel only when needed.
With the current setuptools version, wheel is not needed at all.
See also https://github.com/pypa/pip/pull/12728
diff -r 0bef9fa8b3c4 -r 0c7d924a643f setup.py
--- a/setup.py Thu Mar 14 10:13:16 2024 +0100
+++ b/setup.py Mon Dec 02 14:43:38 2024 +0100
@@ -830,7 +830,7 @@
with open(file_name, 'w') as fp:
fp.write(dedent("""\
[build-system]
- requires = ["setuptools", "wheel"]
+ requires = ["setuptools"]
# test
build-backend = "setuptools.build_meta"
"""))