Bug 1558192

Summary: Python bytecompilation queued after %install in /usr/lib/rpm/redhat/macros relies on %{__python} that possibly clashes with https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
Product: [Fedora] Fedora Reporter: Jan Pokorný [poki] <jpokorny>
Component: redhat-rpm-configAssignee: Miro Hrončok <mhroncok>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ajax, ffesti, fweimer, ignatenko, john.j5live, jonathan, mhroncok, pmatilai, praiskup, pviktori
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-19 14:24:38 UTC Type: Bug
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:    
Bug Blocks: 1551326    

Description Jan Pokorný [poki] 2018-03-19 19:41:26 UTC
For now, the immediate impact are difficult to root-cause-analyse
warnings raised with koji/mock builds against Rawhide (F28?).  Later on,
the builds may fail completely (unless %__python -> %__python3).

Fedora change related to the build environment should not interfere
with this very environment.

# rpm -q rpm-build redhat-rpm-config
> rpm-build-4.14.1-8.fc28.x86_64
> redhat-rpm-config-105-1.fc29.noarch

Comment 1 Jan Pokorný [poki] 2018-03-19 19:57:32 UTC
> Fedora change related to the build environment should not interfere
> with this very environment.

(meant bidirectionally/mutually, indeed)

And see also [bug 1506355], might be wise to limit infuence of
environment variables etc. here as well.

Comment 2 Miro Hrončok 2018-03-19 20:01:18 UTC
We are aware of that. Workaround is to set __python to either python2 or python3 explicitly.

Comment 3 Miro Hrončok 2018-03-19 20:08:05 UTC
Added https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Python_bytecompilation

Do you have a specific example where this breaks the build? It shouldn't.

Comment 4 Jan Pokorný [poki] 2018-03-19 20:24:23 UTC
No breakage to report, just extrapolating the declared plan.

And that warning was just slightly annoying when I was after what
cases of plain python invocation I might have missed when fine-tuning
clufter package as it invokes some python scripts in %build,
sometimes even indirectly.

Comment 5 Miro Hrončok 2018-03-19 20:29:17 UTC
This should eventually be superseded by https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation

Comment 6 Jan Pokorný [poki] 2018-03-19 21:27:25 UTC
Thanks, I now see that I should have been following
https://fedoraproject.org/wiki/Packaging:Python_Appendix#Manual_byte_compilation
for non-standard paths in the first place, as otherwise
I am spreading Python 2 bytecode even when not desired.
(Fixed in clufter now.)

Comment 7 Miro Hrončok 2018-03-20 09:54:18 UTC
See also https://pagure.io/packaging-committee/issue/755