Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 451566 - sys-fs/udev-197-r2: parallel build fails libudev-install-hook target
Summary: sys-fs/udev-197-r2: parallel build fails libudev-install-hook target
Status: RESOLVED DUPLICATE of bug 451500
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-12 20:26 UTC by Martin von Gagern
Modified: 2013-01-15 14:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (sys-fs:udev-197-r2:20130112-133705.log,44.31 KB, text/plain)
2013-01-12 20:26 UTC, Martin von Gagern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2013-01-12 20:26:18 UTC
Created attachment 335366 [details]
build log

Parallel build for sys-fs/udev-197-r2 failed for me:

libname=libudev.so && 	if test "/usr/lib64" != "/lib64"; then /bin/mkdir -p /var/tmp/portage/sys-fs/udev-197-r2/image//lib64 && so_img_name=$(readlink /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/$libname) && so_img_rel_target_prefix=$(echo /usr/lib64 | sed 's,\(^/\|\)[^/][^/]*,..,g') && ln -sf $so_img_rel_target_prefix/lib64/$so_img_name /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/$libname && mv /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/$libname.* /var/tmp/portage/sys-fs/udev-197-r2/image//lib64; fi
libname=libsystemd-daemon.so && 	if test "/usr/lib64" != "/lib64"; then /bin/mkdir -p /var/tmp/portage/sys-fs/udev-197-r2/image//lib64 && so_img_name=$(readlink /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/$libname) && so_img_rel_target_prefix=$(echo /usr/lib64 | sed 's,\(^/\|\)[^/][^/]*,..,g') && ln -sf $so_img_rel_target_prefix/lib64/$so_img_name /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/$libname && mv /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/$libname.* /var/tmp/portage/sys-fs/udev-197-r2/image//lib64; fi
make: *** [libudev-install-hook] Error 1

The recipes involved look like this:

# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
libudev-install-hook:
        libname=libudev.so && $(move-to-rootlibdir)

# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
libsystemd-daemon-install-hook:
        libname=libsystemd-daemon.so && $(move-to-rootlibdir)

I see no error message in the log, and have no idea as to which command actually fails, and why. Could an `mkdir -p` fail for cases where the directory in question is created while the program executes?

Repeating the command all by itself will succeed. Workaround is a MAKEOPTS=-j1 non-parallelized build. Could repeat this with MAKEOPTS=-j5 on a machine with 4 cores, on my first attempt, so it doesn't seem to be overly rare.
Comment 1 Martin von Gagern 2013-01-12 20:48:32 UTC
OK, I just did another run, this time running the install phase through strace. It appears that the shell command returns non-zero due to readlink returning non-zero:

execve("/usr/bin/readlink", ["readlink", "/var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/libudev.so"], [/* 296 vars */]) = 0
[…]
readlink("/var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/libudev.so", 0x257c100, 64) = -1 ENOENT (No such file or directory)
close(1)              = 0
close(2)              = 0
exit_group(1)         = ?
+++ exited with 1 +++

With this information in mind, you will notice in the build log attached in comment #0 that the error occurs *before* the output

libtool: install: (cd /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64 && { ln -s -f libudev.so.1.2.1 libudev.so || { rm -f libudev.so && ln -s libudev.so.1.2.1 libudev.so; }; })

So it seems to me as if the hook atempts to move the file before it even has been installed. The corresponding command

/bin/sh ./libtool   --mode=install /usr/bin/install -c   libsystemd-daemon.la libudev.la libgudev-1.0.la '/var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64'

comes earlier but takes too long to execute. So I'd say libudev-install-hook (and other similar hooks probably as well) should depend on the install-libLTLIBRARIES target. But perhaps a cleaner solution would be to install these things into the right directory in the first place, e.g. by setting the libdir variable to some different value for these targets. Not sure how fasible or portable that would be, but it might be worth considering.

As a quick solution, passing -j1 to the emake install call is easiest.
Comment 2 vesna 2013-01-13 12:22:21 UTC
Reproduced for me, the "-j1" solution also works.
Build failes with:

libtool: install: /usr/bin/install -c .libs/libgudev-1.0.so.0.1.3T /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/libgudev-1.0.so.0.1.3
libtool: install: (cd /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64 && { ln -s -f libgudev-1.0.so.0.1.3 libgudev-1.0.so.0 || { rm -f libgudev-1.0.so.0 && ln -s libgudev-1.0.so.0.1.3 libgudev-1.0.so.0; }; })
libtool: install: (cd /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64 && { ln -s -f libgudev-1.0.so.0.1.3 libgudev-1.0.so || { rm -f libgudev-1.0.so && ln -s libgudev-1.0.so.0.1.3 libgudev-1.0.so; }; })
libtool: install: /usr/bin/install -c .libs/libgudev-1.0.lai /var/tmp/portage/sys-fs/udev-197-r2/image//usr/lib64/libgudev-1.0.la
libtool: install: warning: remember to run `libtool --finish /usr/lib64'
 * ERROR: sys-fs/udev-197-r2 failed (install phase):
 *   emake failed
Comment 3 Alexander Tsoy 2013-01-13 18:46:34 UTC
This is a dublicate of bug 451500
Comment 4 William Hubbs gentoo-dev 2013-01-15 14:42:47 UTC

*** This bug has been marked as a duplicate of bug 451500 ***