During an attempted rebuild of python-carbon with Python 3.9.0a2, we have found out it fails to build in Fedora 32. + /usr/bin/python3 setup.py install -O1 --skip-build --root /builddir/build/BUILDROOT/python-carbon-1.1.5-6.fc32.x86_64 rm -rfv /builddir/build/BUILDROOT/python-carbon-1.1.5-6.fc32.x86_64/usr/bin/__pycache__ /builddir/build/BUILD/carbon-f36da0f77aaf83a61f9880dec7abbf5c14a7d2bb/setup.py:27: DeprecationWarning: This method will be removed in future versions. Use 'parser.read_file()' instead. cf.readfp(f, 'setup.cfg') ################################################################################ Carbon's default installation prefix is "/opt/graphite". To install Carbon in the Python's default location run: $ GRAPHITE_NO_PREFIX=True python setup.py install ################################################################################ /usr/lib64/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) Warning: 'classifiers' should be a list, got type 'tuple' usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'rm' This is because it adds options for %py3_install like this: %py3_install \ --install-data=%{_localstatedir}/lib/carbon \ --install-lib=%{python3_sitelib} \ --install-scripts=%{_bindir} This was never supported, but some packages started to use it anyway, as it happened to work. Now it doesn't, since https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/34 Let's work together and realize whether we can restore the previously working behavior? The macro gets \ as the argument and hence it sees this: %{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} \ rm -rfv %{buildroot}%{_bindir}/__pycache__ As an immediate fix, I believe getting rid of the line split might work.
This gets the job done: %install -%py3_install \ +%{py3_install -- \ --install-data=%{_localstatedir}/lib/carbon \ --install-lib=%{python3_sitelib} \ - --install-scripts=%{_bindir} + --install-scripts=%{_bindir}} The current form in the spec does the following: it passes the backslash as the argument to %py3_install and the macro hence gets expanded with the backslash. Due to the fact that the setup.py command used to be the last in the macro, it worked. Now the command is followed by another and this doesn't work. The changed way actually passes all the lines as the argument. And RPM needs -- to pass arguments starting with dashes.
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle. Changing version to 32.
This comment is mass posted to all bugs blocking the Python 3.9 tracker, sorry if it is not 100 % relevant. When in doubt, please ask. The Python 3.9 rebuild is in progress in a Koji side tag. If you fix this bug, please don't rebuild the package in regular rawhide, but do it in the side tag with: $ fedpkg build --target=f33-python The rebuild is progressing slowly and it is possible this package won't have all the required build dependencies yet. If that's the case, please just leave the fix committed and pushed and we will eventually rebuild it for you. You are not asked to go and try rebuild all the missing dependencies yourself. If you know there is a bootstrap loop in the dependencies, let me know and we can untangle it together. If you want to test your fix or reproduce the failure, you can still use the Copr repo mentioned in the initial comment of this bug: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/