Bug 1026469

Summary: brp-python-bytecompile should ignore symlinks to files it cannot write
Product: [Fedora] Fedora Reporter: Zbigniew Jędrzejewski-Szmek <zbyszek>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: rawhideCC: chkr, ffesti, frankly3d, jzeleny, kevin, lkardos, mbacovsk, novyjindrich, nushio, ousia, packaging-team-maint, pmatilai, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-01 13:22:21 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:

Description Zbigniew Jędrzejewski-Szmek 2013-11-04 17:49:04 UTC
Description of problem:
calibre build run /usr/lib/rpm/brp-python-bytecompile. If python-feedparser (a runtime dependency, not a build time one) is *not* installed, everything works fine, becuase brp-python-bytecompile ignored dangling symlinks.

But if python-feedparser is installed, and the dynglings are not symlanked^W^W^W^W symlinks are dangling, it fails with:

+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
Bytecompiling .py files below /home/zbyszek/rpmbuild/BUILDROOT/calibre-1.9.0-1.fc21.x86_64/usr/lib/python2.7/ using /usr/bin/python2.7
Sorry [Errno 13] Permission denied: '/home/zbyszek/rpmbuild/BUILDROOT/calibre-1.9.0-1.fc21.x86_64/usr/lib64/calibre/calibre/web/feeds/feedparser.pyc'
error: Bad exit status from /var/tmp/rpm-tmp.UBLMpQ (%install)

Version-Release number of selected component (if applicable):
calibre-1.9.0-1.fc21.src.rpm
rpm-build-4.11.1-7.fc20.x86_64

How reproducible:
100%

Steps to Reproduce:
1. build calibre
2. install calibre
3. attempt to build again

I'm setting severity to low, because this won't happen in a pristine build environment and is easy enough to work around.

I think that this is really a bug in rpm-build, brp-python-bytecompile should ignore symlinks to files it cannot write. As we symlink to unbundle stuff, such things will happen more and more often. It *could* be worked-around in this srpm, but it won't be particularly easy or elegant, and it's much nicer to fix it in rpm-build.

Comment 1 Zbigniew Jędrzejewski-Szmek 2014-01-24 14:29:28 UTC
Can brp-python-bytecompile ignore symlinks to files it cannot write?

Comment 2 Panu Matilainen 2014-01-24 14:36:20 UTC
Yup, it certainly has no business touching files outside the buildroot.
I'll have a look...

Comment 3 Panu Matilainen 2014-02-07 11:26:55 UTC
Mmh. Getting python compileall.compile_dir() to comply is not entirely straightforward. Its rx-argument could probably be (ab)used for the purpose but doing so within a single-liner python -c invocation is...

Anyway, its something to fix but not perhaps super urgent. As a short-term workaround, you can add "BuildConfilicts: python-feedparser" with a comment pointing to this bug.

Comment 4 Kevin Fenzi 2014-02-07 17:03:08 UTC
ok, added in rawhide. 

Should we keep this open?

Comment 5 Zbigniew Jędrzejewski-Szmek 2014-02-07 17:10:59 UTC
I think so. BuildConflict is just a band-aid.

Comment 6 Panu Matilainen 2014-02-10 06:44:39 UTC
Yeah, lets leave this open.

Comment 7 Fedora End Of Life 2015-05-29 09:41:17 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Ľuboš Kardoš 2015-07-01 13:22:21 UTC
Fixed upstream as d2a6bec00041032f29bc65360adeff04f19f2db5