Bug 1026469 - brp-python-bytecompile should ignore symlinks to files it cannot write
brp-python-bytecompile should ignore symlinks to files it cannot write
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-04 12:49 EST by Zbigniew Jędrzejewski-Szmek
Modified: 2015-07-01 09:22 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-01 09:22:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Zbigniew Jędrzejewski-Szmek 2013-11-04 12:49:04 EST
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 09:29:28 EST
Can brp-python-bytecompile ignore symlinks to files it cannot write?
Comment 2 Panu Matilainen 2014-01-24 09:36:20 EST
Yup, it certainly has no business touching files outside the buildroot.
I'll have a look...
Comment 3 Panu Matilainen 2014-02-07 06:26:55 EST
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 12:03:08 EST
ok, added in rawhide. 

Should we keep this open?
Comment 5 Zbigniew Jędrzejewski-Szmek 2014-02-07 12:10:59 EST
I think so. BuildConflict is just a band-aid.
Comment 6 Panu Matilainen 2014-02-10 01:44:39 EST
Yeah, lets leave this open.
Comment 7 Fedora End Of Life 2015-05-29 05:41:17 EDT
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 09:22:21 EDT
Fixed upstream as d2a6bec00041032f29bc65360adeff04f19f2db5

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