Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1792050 - python-carbon fails to build in Fedora 32 -- adds options to %py3_install after \
Summary: python-carbon fails to build in Fedora 32 -- adds options to %py3_install aft...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-carbon
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jonathan Steffan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F32FTBFS PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-01-16 22:25 UTC by Miro Hrončok
Modified: 2020-05-26 16:48 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-26 16:48:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2020-01-16 22:25:26 UTC
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.

Comment 1 Miro Hrončok 2020-01-16 22:35:22 UTC
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.

Comment 2 Ben Cotton 2020-02-11 17:33:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 3 Miro Hrončok 2020-05-25 13:01:30 UTC
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/


Note You need to log in before you can comment on or make changes to this bug.