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 1585626

Summary: Move /usr/bin/python into a separate package
Product: [Fedora] Fedora Reporter: Jan Kurik <jkurik>
Component: Changes TrackingAssignee: Miro Hrončok <mhroncok>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ChangeAcceptedF29,SystemWideChange
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-01 15:49:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1603243, 1603281, 1603300, 1603301, 1603302, 1603303, 1603304, 1603307, 1603326, 1603327, 1603359, 1603441, 1603442, 1603468, 1603476, 1603492, 1603493, 1603535, 1603536, 1603617, 1603618, 1603639, 1603644, 1603659, 1603664, 1603715, 1603730, 1603735, 1603741, 1603742, 1603756, 1603764, 1603779, 1603791, 1603799, 1603802, 1603813, 1603823, 1603827, 1603829, 1603851, 1603879, 1603886, 1603887, 1603937, 1603951, 1603954, 1603955, 1603956, 1603959, 1603970, 1604019, 1604022, 1604023, 1604025, 1604026, 1604062, 1604068, 1604074, 1604076, 1604110, 1604133, 1604141, 1604153, 1604154, 1604155, 1604167, 1604179, 1604245, 1604249, 1604250, 1604253, 1604268, 1604271, 1604305, 1604316, 1604329, 1604332, 1604343, 1604360, 1604379, 1604387, 1604393, 1604394, 1604486, 1604527, 1604533, 1604534, 1604543, 1604544, 1604547, 1604574, 1604602, 1604608, 1604610, 1604635, 1604647, 1604649, 1604650, 1604661, 1604720, 1604735, 1604757, 1604759, 1604760, 1604761, 1604762, 1604778, 1604782, 1604790, 1604807, 1604817, 1604822, 1604840, 1604853, 1604871, 1604888, 1604902, 1604909, 1604918, 1604935, 1604956, 1604959, 1605252, 1605253, 1605256, 1605272, 1605281, 1605293, 1605299, 1605318, 1605322, 1605327, 1605329, 1605347, 1605352, 1605356, 1605366, 1605393, 1605434, 1605442, 1605461, 1605466, 1605467, 1605469, 1605475, 1605483, 1605488, 1605511, 1605520, 1605522, 1605533, 1605534, 1605535, 1605536, 1605539, 1605541, 1605542, 1605545, 1605546, 1605547, 1605548, 1605549, 1605550, 1605553, 1605555, 1605561, 1605562, 1605565, 1605570, 1605571, 1605572, 1605573, 1605578, 1605579, 1605581, 1605582, 1605584, 1605585, 1605586, 1605587, 1605588, 1605591, 1605592, 1605593, 1605596, 1605597, 1605599, 1605602, 1605608, 1605612, 1605613, 1605614, 1605616, 1605618, 1605620, 1605621, 1605623, 1605627, 1605628, 1605629, 1605630, 1605631, 1605636, 1605638, 1605640, 1605644, 1605645, 1605647, 1605648, 1605649, 1605650, 1605651, 1605652, 1605654, 1605655, 1605658, 1605663, 1605664, 1605665, 1605666, 1605667, 1605669, 1605674, 1605677, 1605678, 1605696, 1605697, 1605698, 1605701, 1605704, 1605707, 1605709, 1605710, 1605712, 1605713, 1605716, 1605717, 1605719, 1605720, 1605722, 1605723, 1605729, 1605730, 1605731, 1605732, 1605733, 1605736, 1605737, 1605738, 1605742, 1605743, 1605744, 1605745, 1605747, 1605748, 1605749, 1605757, 1605758, 1605770, 1605775, 1605779, 1605782, 1605783, 1605785, 1605786, 1605787, 1605789, 1605793, 1605795, 1605796, 1605798, 1605801, 1605802, 1605803, 1605804, 1605805, 1605806, 1605808, 1605809, 1605810, 1605813, 1605814, 1605815, 1605816, 1605817, 1605819, 1605820, 1605822, 1605824, 1605825, 1605826, 1605827, 1605829, 1605830, 1605831, 1605832, 1605835, 1605836, 1605837, 1605838, 1605839, 1605840, 1605842, 1605843, 1605845, 1605847, 1605848, 1605849, 1605857, 1605859, 1605860, 1605861, 1605866, 1605867, 1605868, 1605869, 1605870, 1605872, 1605874, 1605877, 1605881, 1605882, 1605885, 1605886, 1605888, 1605889, 1605891, 1605893, 1605895, 1605902, 1605903, 1605905, 1605908, 1605910, 1605915, 1605918, 1605923, 1605924, 1605926, 1605927, 1605928, 1605929, 1605933, 1605938, 1605942, 1605946, 1605950, 1605951, 1605954, 1605959, 1605961, 1605962, 1605963, 1605964, 1605965, 1605966, 1605967, 1605968, 1605969, 1605970, 1605974, 1605980, 1605981, 1605985, 1605990, 1605991, 1605992, 1605993, 1605997, 1605999, 1606000, 1606002, 1606003, 1606006, 1606007, 1606008, 1606009, 1606010, 1606019, 1606020, 1606021, 1606022, 1606023, 1606024, 1606026, 1606029, 1606035, 1606037, 1606054, 1606074, 1606081, 1606090, 1606099, 1606105, 1606107, 1606109, 1606120, 1606121, 1606137, 1606141, 1606289, 1606293, 1606294, 1606297, 1606330, 1606340, 1606341, 1606350, 1606363, 1606375, 1606376, 1606385, 1606386, 1606388, 1606393, 1606398, 1606417, 1606426, 1606433, 1606434, 1606442, 1606443, 1606447, 1606451, 1606454, 1606455, 1606458, 1606462, 1606463, 1606467, 1606474, 1606475, 1606508, 1606511, 1606516, 1606520, 1606529, 1606530, 1606542, 1606544, 1606545, 1606546, 1606547, 1606548, 1606549, 1606550, 1606551, 1606552, 1606553, 1606554, 1606555, 1606556, 1606558, 1606560, 1606561, 1606562, 1606563, 1606564, 1606567, 1606588, 1606609, 1606612, 1606640, 1606650, 1606665, 1606701, 1606706, 1606710, 1606711, 1606717, 1606736, 1606763, 1606774, 1606775, 1606776, 1606777, 1606779, 1606784, 1606786, 1606794, 1606832, 1606837, 1606841, 1606880, 1606900, 1606901, 1650528, 1674826, 1732633    
Bug Blocks: 1601256    

Description Jan Kurik 2018-06-04 08:46:00 UTC
This is a tracking bug for Change: Move /usr/bin/python into a separate package
For more details, see: https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package

Reflecting the recent changes of https://www.python.org/dev/peps/pep-0394/ PEP 394 -- ''The "python" Command on Unix-Like Systems'', we are moving /usr/bin/python from the {{package|python2}} package into a separate package called {{package|python-unversioned-command}}.
{{package|python2}} will recommend this package.
This means Fedora users will get it automatically with {{package|python2}}, but they might opt-out and remove it. In Fedora's build system, only packages explicitly buildrequiring /usr/bin/python will get it.
This change obsoletes "Avoid /usr/bin/python in RPM build" change.

Comment 1 Miro Hrončok 2018-06-04 08:57:27 UTC
Setting to depends on PYTHON37.

"This change will be done after the switch to Python 3.7 to avoid work on one change from interfering with work on the other."

Comment 2 Miro Hrončok 2018-06-21 14:06:06 UTC
Prepared in https://src.fedoraproject.org/rpms/python2/pull-request/20

Comment 3 Miro Hrončok 2018-07-03 14:26:05 UTC
Build in progress https://koji.fedoraproject.org/koji/taskinfo?taskID=28001290

Comment 4 Miro Hrončok 2018-07-16 13:47:44 UTC
218 packages list one of the following in %files:

%{python_sitearch}/*

%{python_sitelib}/*


Unfortunately, both statements currently evaluate to /*.

I think we should mass patch those, as this is a kind of error that passes silently. Thoughts?

Comment 5 Zbigniew Jędrzejewski-Szmek 2018-07-16 16:52:09 UTC
Are they actually defined to empty, or are they just undefined? I always thought any undefined macros are not replaced, leading to a non-absolute path, and consequently an error from rpm…

Comment 6 Zbigniew Jędrzejewski-Szmek 2018-07-16 16:52:50 UTC
+1 to mass patching, though, as usual ;)

Comment 7 Miro Hrončok 2018-07-16 17:14:22 UTC
They are basically defined to undefined:

(I know this is bash, but it behaves similarly here)

$ value=$(nonexisting command is here)
bash: nonexisting: command not found
$ echo "$value"
(empty)

Comment 8 Miro Hrončok 2018-07-16 17:22:48 UTC
Also, plenty of those use python or %__python and will fail to build.

So I'd only patch 42 that don't:

abiword
afflib
cwiid
denyhosts
did
dtc
gitosis
gr-air-modes
gr-fcdproplus
gr-iqbal
gr-osmosdr
gtts
langtable
libdasm
libpfm
mathgl
player
pocketsphinx
pyserial
python-alsaaudio
python-ansi
python-anyconfig
python-atomicwrites
python-bottle
python-guppy
python-lyricwiki
python-nitrate
python-openoffice
python-optcomplete
python-ordered-set
python-pygraphviz
python-pylcdsysinfo
python-pymilter
python-repoze-tm2
python-trml2pdf12
python-vkontakte
python-xmpp
python-yenc
stgit
sugar-datastore
sugar-toolkit
wordxtr

Comment 9 Zbigniew Jędrzejewski-Szmek 2018-07-17 10:57:18 UTC
(In reply to Miro Hrončok from comment #7)
> They are basically defined to undefined:
/usr/lib/rpm/macros:%python_sitelib %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper sitelib)
/usr/lib/rpm/macros:%python_sitearch %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper sitearch)

That's ugly. I think we should update those definitions to something like this:
%python_sitelib %{__python} -Es %{_rpmconfigdir}/python-macro-helper sitelib 2>/dev/null || echo %%python_sitelib
%python_sitearch %{__python} -Es %{_rpmconfigdir}/python-macro-helper sitearch 2>/dev/null || echo %%python_sitearch

Comment 10 Miro Hrončok 2018-07-17 11:06:32 UTC
That would work.

Comment 11 Zbigniew Jędrzejewski-Szmek 2018-07-17 11:08:47 UTC
https://github.com/rpm-software-management/rpm/pull/469

Comment 12 Raphael Groner 2018-07-17 22:40:11 UTC
FTBFS of python-jnius:

<snip>
BUILD SUCCESSFUL
Total time: 0 seconds
python setup.py build_ext --inplace -f -g
make: python: Command not found

The above output is a result of calling: CFLAGS="$RPM_OPT_FLAGS" %py2_build

https://koji.fedoraproject.org/koji/taskinfo?taskID=28222392
https://github.com/kivy/pyjnius/blob/a7e791aa26c84645c53dac985dd97183071f7bc4/setup.py

Comment 13 Miro Hrončok 2018-07-17 22:47:32 UTC
Raphael, the above output is a result of calling "make":

https://github.com/kivy/pyjnius/blob/master/Makefile#L20

If you really need to call make, set PYTHON=%{__python2}.

Also note that you don't need to set CFLAGS with %py2_build, the macro does that for you.

Note that I see no reason to call "%py_build" and follow it with "make" that calls python setup.py build_ext, as they both do essentially the same thing.

Comment 14 Miro Hrončok 2018-07-17 23:14:08 UTC
Raphael, here is a PR https://src.fedoraproject.org/rpms/python-jnius/pull-request/1

Comment 15 Miro Hrončok 2018-08-03 19:45:33 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #11)
> https://github.com/rpm-software-management/rpm/pull/469

https://src.fedoraproject.org/rpms/rpm/pull-request/14

Comment 16 Jan Kurik 2018-08-14 11:22:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 17 Miro Hrončok 2018-11-01 15:49:14 UTC
This has happened in F29.