Bug 971474 - mock: --copyout fails on directory trees with broken symlinks
Summary: mock: --copyout fails on directory trees with broken symlinks
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-06 15:32 UTC by Florian Weimer
Modified: 2014-10-12 21:18 UTC (History)
3 users (show)

Fixed In Version: mock-1.2.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-12 21:18:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2013-06-06 15:32:25 UTC
I get this error when calling mock --copyout:

INFO: copying /var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD to agg-2.5-16.fc19
ERROR: [('/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.guess', 'agg-2.5-16.fc19/agg-2.5/config.guess', "[Errno 2] No such file or directory: '/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.guess'"), ('/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/install-sh', 'agg-2.5-16.fc19/agg-2.5/install-sh', "[Errno 2] No such file or directory: '/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/install-sh'"), ('/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/missing', 'agg-2.5-16.fc19/agg-2.5/missing', "[Errno 2] No such file or directory: '/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/missing'"), ('/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.sub', 'agg-2.5-16.fc19/agg-2.5/config.sub', "[Errno 2] No such file or directory: '/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.sub'")]
Traceback (most recent call last):
  File "/usr/sbin/mock", line 561, in <module>
    def do_buildsrpm(config_opts, chroot, options, args):
  File "/usr/sbin/mock", line 925, in main
    shutil.copytree(src, dest)
  File "/usr/lib64/python2.7/shutil.py", line 206, in copytree
    raise Error, errors
Error: [('/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.guess', 'agg-2.5-16.fc19/agg-2.5/config.guess', "[Errno 2] No such file or directory: '/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.guess'"), ('/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/install-sh', 'agg-2.5-16.fc19/agg-2.5/install-sh', "[Errno 2] No such file or directory: '/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/install-sh'"), ('/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/missing', 'agg-2.5-16.fc19/agg-2.5/missing', "[Errno 2] No such file or directory: '/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/missing'"), ('/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.sub', 'agg-2.5-16.fc19/agg-2.5/config.sub', "[Errno 2] No such file or directory: '/var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.sub'")]

Some of the offending symbolic links look like this:

lrwxrwxrwx. 1 root root 37 Jun  6 17:23 /var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.guess -> /usr/share/automake-1.13/config.guess
lrwxrwxrwx. 1 root root 35 Jun  6 17:23 /var/lib/mock/fedora-19-x86_64/root/builddir/build/BUILD/agg-2.5/config.sub -> /usr/share/automake-1.13/config.sub

I think mock --copyout should not try to resolve symlinks, or at least be more clever about it (e.g., resolve them inside the chroot).

This is with mock-1.1.32-1.fc18.

Comment 1 Fedora End Of Life 2013-12-21 13:53:44 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. 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 WONTFIX if it remains open with a Fedora 
'version' of '18'.

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 prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 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 to Fedora 18's end of life.

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 2 Florian Weimer 2013-12-23 16:52:44 UTC
Still present in Fedora 19 AFACIT.

Comment 3 Miroslav Suchý 2014-10-01 20:18:57 UTC
Fixed in msuchy-work branch in commit 8b435e4.

Not this address only copyout.
Copyin does not have too much sense as it would require validaiton of symlinks and can be easily overengineered.

Comment 4 Miroslav Suchý 2014-10-12 21:18:22 UTC
Fixed in mock-1.2.0, which just landed in rawhide.


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