Bug 526414 - missing /dev/fd symlink causes some mock builds using it to fail
Summary: missing /dev/fd symlink causes some mock builds using it to fail
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 13
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Clark Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 453583 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-30 07:21 UTC by Tuomo Soini
Modified: 2013-01-10 05:30 UTC (History)
7 users (show)

Fixed In Version: mock-1.1.10-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-09-23 04:57:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Proposed patch for problem (833 bytes, patch)
2009-09-30 07:21 UTC, Tuomo Soini
no flags Details | Diff
Proposed patch for problem with enhanced comment (860 bytes, patch)
2009-09-30 07:28 UTC, Tuomo Soini
no flags Details | Diff

Description Tuomo Soini 2009-09-30 07:21:48 UTC
Created attachment 363137 [details]
Proposed patch for problem

Description of problem:

missing /dev/fd symlink causes some mock builds relying on it to fail

Version-Release number of selected component (if applicable):

mock 0.9.17.

How reproducible:

Always with packages needing /dev/fd/self or other specific file handle.

Steps to Reproduce:
1. try to rebuild package in mock, build may be successful (some fail)
2. Check build logs for: '/dev/fd' or 'Broken pipe'
3. You'll find errors like these caused by missing /dev/fd symlink

join: /dev/fd/63: No such file or directory
sort: write failed: standard output: Broken pipe
sort: fflush failed: standard output: Broken pipe
zcat: stdout: Broken pipe
cat: write error: Broken pipe
/usr/bin/libtool: line 836: echo: write error: Broken pipe
|/usr/bin/libtool: line 836: echo: write error: Broken pipe
yes: standard output: Broken pipe
sort: fflush failed: standard output: Broken pipe
tr: write error: Broken pipe
sort: write failed: standard output: Broken pipe

Actual results:

Failed or broken builds.

Expected results:

Successful builds.

Comment 1 Tuomo Soini 2009-09-30 07:28:16 UTC
Created attachment 363138 [details]
Proposed patch for problem with enhanced comment

Add missing /dev/fd symlink. Missing symlink causes problems
with fd handling during build causing failed builds.

Comment 2 Bug Zapper 2009-11-16 13:06:55 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Clark Williams 2010-07-16 14:00:24 UTC
for some reason I thought we had this and dropped it, but I can't find why we did so. I'll add it and run it through the test suite, since it looks reasonable.

Comment 4 Clark Williams 2010-07-16 17:31:15 UTC
commit 0dbb10e278c2121b3d6dd8385974c3f777a8ef03
Author: Clark Williams <williams>
Added for mock-1.1.2

Date:   Fri Jul 16 09:42:21 2010 -0500

    added symlink from /proc/self/fd to /dev/fd in the chroot (BZ# 526414)
    
    Added a symlink in the chroot from /proc/self/fd to /dev/fd. Only
    do this for EPEL5+ and FC hosts since the 2.6.9 kernel for EPEL4
    does not support this.
    
    Signed-off-by: Clark Williams <williams>

diff --git a/py/mock/backend.py b/py/mock/backend.py
index f8cb412..f22ac12 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -359,6 +359,10 @@ class Root(object):
         os.symlink("/proc/self/fd/1", self.makeChrootPath("dev/stdout"))
         os.symlink("/proc/self/fd/2", self.makeChrootPath("dev/stderr"))
 
+        # don't symlink for RHEL4 systems
+        if kver > '2.6.9':
+            os.symlink("/proc/self/fd",   self.makeChrootPath("dev/fd"))
+
         # symlink it for FC hosts
         if kver >= '2.6.19':
             os.symlink("/dev/pts/ptmx", self.makeChrootPath("dev/ptmx"))

Comment 5 Clark Williams 2010-07-27 19:29:50 UTC
*** Bug 453583 has been marked as a duplicate of this bug. ***

Comment 6 Fedora Update System 2010-08-03 22:24:36 UTC
mock-1.1.3-1.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/mock-1.1.3-1.fc14

Comment 7 Fedora Update System 2010-08-03 22:25:29 UTC
mock-1.1.3-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/mock-1.1.3-1.fc13

Comment 8 Fedora Update System 2010-08-03 22:28:29 UTC
mock-1.0.10-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/mock-1.0.10-1.el5

Comment 9 Fedora Update System 2010-08-03 22:29:33 UTC
mock-1.0.10-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mock-1.0.10-1.fc12

Comment 10 Fedora Update System 2010-08-04 23:04:04 UTC
mock-1.0.10-1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.0.10-1.el5

Comment 11 Fedora Update System 2010-08-05 14:21:52 UTC
mock-1.1.3-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.1.3-1.fc14

Comment 12 Fedora Update System 2010-08-05 23:35:34 UTC
mock-1.1.3-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.1.3-1.fc13

Comment 13 Fedora Update System 2010-08-05 23:37:06 UTC
mock-1.0.10-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.0.10-1.fc12

Comment 14 Fedora Update System 2010-08-07 23:23:08 UTC
mock-1.1.3-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Jack Neely 2010-08-13 20:45:33 UTC
This patch does not work.  /dev/fd is not symlinked in on my Fedora 13 system running mock-1.1.3-1.fc13.

I've verified that the patch above is present, and it is.  However, we are comparing STRINGS not version numbers.

Python 2.6.4 (r264:75706, Jun  4 2010, 18:20:31) 
[GCC 4.4.4 20100503 (Red Hat 4.4.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> kver = os.uname()[2]
>>> kver
'2.6.33.6-147.fc13.x86_64'
>>> kver > '2.6.9'
False
>>> kver >= '2.6.19'
True

'2.6.33.6-147.fc13.x86_64' is NOT greater than '2.6.9' and the symlink does not get instaleld.

Comment 16 Clark Williams 2010-08-13 21:44:20 UTC
Ugh. Good catch. 

Maybe there's an rpmlib routine exported to python that I can use to do a more thorough comparison. I really don't want to try and write my own RPM NVR comparison routine...

Comment 17 manuel wolfshant 2010-08-13 23:42:09 UTC
Just do an "import rpm" and you'll have the same abilities as /usr/bin/rpmdev-vercmp does :)

Comment 18 Fedora Update System 2010-08-19 17:21:16 UTC
mock-1.1.4-1.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/mock-1.1.4-1.fc14

Comment 19 Fedora Update System 2010-08-19 17:22:22 UTC
mock-1.1.4-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/mock-1.1.4-1.fc13

Comment 20 Fedora Update System 2010-08-19 17:33:08 UTC
mock-1.0.11-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mock-1.0.11-1.fc12

Comment 21 Fedora Update System 2010-08-19 17:34:28 UTC
mock-1.0.11-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/mock-1.0.11-1.el5

Comment 22 Fedora Update System 2010-08-19 22:00:28 UTC
mock-1.0.11-1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.0.11-1.el5

Comment 23 Fedora Update System 2010-08-23 21:57:53 UTC
mock-1.1.4-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2010-08-24 01:28:34 UTC
mock-1.1.4-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2010-08-26 01:03:18 UTC
mock-1.0.11-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 26 Jack Neely 2010-09-02 21:44:08 UTC
Back around to looking at kABI kernel module packages.  Using mock-1.1.4-1.fc13 I still don't have any success with /dev/fd being present in the chroot.

In fact I still see at line 372 in backend.py the buggy code:

        # don't symlink for RHEL4 systems
        if kver > '2.6.9':
            os.symlink("/proc/self/fd",   self.makeChrootPath("dev/fd"))

On my Fedora 13 build host I'm testing by running mock <options> init.  Then mock <options> shell.  Finally ls /dev/fd.

Comment 27 Richard W.M. Jones 2010-09-16 10:34:16 UTC
Koji (F14) also lacks /dev/fd -> /proc/self/fd.

http://git.fedorahosted.org/git/?p=mock.git;a=blob;f=py/mock/backend.py;h=c7d0ca9c4bb1a6f05608049151ac657379eb7e3f;hb=HEAD#l371

 371         # don't symlink for RHEL4 systems
 372         if kver > '2.6.9':
 373             os.symlink("/proc/self/fd",   self.makeChrootPath("dev/fd"))

That test must surely be wrong.  It should be kver <= '2.6.9' if the
comment is to be believed.

This bug has been opened for 2 years, can we fix it now please.

Comment 28 Richard W.M. Jones 2010-09-16 10:35:25 UTC
OK, I'm an idiot, but can we make the link unconditionally, because that
test is failing to create the symlink.

Comment 29 Clark Williams 2010-09-16 15:51:36 UTC
The biggest problem with that comparison is that it doesn't work, since it's a string comparison and 2.6.9 is > 2.6.33. I created a utility function called cmpKernelEVR() which uses the rpmutils function compareEVR(). It's in the queue so I'll try and push it out this week.

Comment 30 Fedora Update System 2010-09-20 14:35:20 UTC
mock-1.1.5-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.5-1.fc14

Comment 31 Fedora Update System 2010-09-20 14:35:39 UTC
mock-1.1.5-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.5-1.fc13

Comment 32 Fedora Update System 2010-09-20 14:42:38 UTC
mock-1.0.12-1.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/mock-1.0.12-1.fc12

Comment 33 Fedora Update System 2010-09-20 14:44:12 UTC
mock-1.0.12-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.12-1.el5

Comment 34 Fedora Update System 2010-09-20 17:53:25 UTC
mock-1.0.12-1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/mock-1.0.12-1.el5

Comment 35 Fedora Update System 2010-09-23 04:56:59 UTC
mock-1.1.5-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 36 Fedora Update System 2010-09-30 06:17:06 UTC
mock-1.1.5-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 37 Fedora Update System 2010-10-20 15:44:22 UTC
mock-1.0.13-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.13-1.el5

Comment 38 Fedora Update System 2010-10-20 15:46:44 UTC
mock-1.0.13-1.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/mock-1.0.13-1.fc12

Comment 39 Fedora Update System 2010-12-14 16:14:34 UTC
mock-1.0.14-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.14-1.el5

Comment 40 Fedora Update System 2011-01-18 20:04:46 UTC
mock-1.0.15-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.15-1.el5

Comment 41 Fedora Update System 2011-02-20 02:26:57 UTC
mock-1.1.9-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc13

Comment 42 Fedora Update System 2011-02-20 02:30:00 UTC
mock-1.0.16-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.16-1.el5

Comment 43 Fedora Update System 2011-02-20 02:32:52 UTC
mock-1.1.9-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.el6

Comment 44 Fedora Update System 2011-02-20 02:35:44 UTC
mock-1.1.9-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc14

Comment 45 Fedora Update System 2011-03-03 08:25:40 UTC
mock-1.1.9-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 46 Fedora Update System 2011-03-03 08:34:23 UTC
mock-1.1.9-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 47 Fedora Update System 2011-05-13 20:34:43 UTC
mock-1.1.10-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc15

Comment 48 Fedora Update System 2011-05-13 20:39:14 UTC
mock-1.1.10-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc14

Comment 49 Fedora Update System 2011-05-13 20:43:30 UTC
mock-1.0.17-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.17-1.el5

Comment 50 Fedora Update System 2011-05-13 20:47:48 UTC
mock-1.1.10-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc13

Comment 51 Fedora Update System 2011-05-13 20:52:08 UTC
mock-1.1.10-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6

Comment 52 Fedora Update System 2011-05-19 04:36:05 UTC
mock-1.1.10-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 53 Fedora Update System 2011-05-25 02:43:25 UTC
mock-1.1.10-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 54 Fedora Update System 2011-05-25 03:17:41 UTC
mock-1.1.10-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 55 Fedora Update System 2011-06-02 19:07:33 UTC
mock-1.0.17-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 56 Fedora Update System 2011-06-02 19:17:26 UTC
mock-1.1.10-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.


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