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: ASSIGNED
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-02-11 17:33 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


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.


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