Summary: | sys-apps/portage: prepstrip fails in parallel with splitdebug (sys-libs/glibc: ln: failed to create hard link '.../image/usr/lib/debug/usr/lib64/libieee.a.debug': File exists) | ||
---|---|---|---|
Product: | Portage Development | Reporter: | MaratIK <marat.buharov> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bircoph, gentoobugs, griffon26, solar, toolchain, vapier |
Priority: | Normal | Keywords: | InVCS, REGRESSION |
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 933986, 445274 | ||
Attachments: |
build.log.7z
environment emerge -pqv '=sys-libs/glibc-2.15-r3' emerge --info '=sys-libs/glibc-2.15-r3' use sort -u to avoid duplicates use sort -u to avoid duplicates build.log.xz environment emerge --info |
Created attachment 331042 [details]
environment
Created attachment 331044 [details]
emerge -pqv '=sys-libs/glibc-2.15-r3'
Created attachment 331046 [details]
emerge --info '=sys-libs/glibc-2.15-r3'
in the future, please don't use .7z for compression/archiving. use tar+{gz or bz2 or xz}. error is coming from the strip code in portage. did it fail when using 2.2.0_alpha142 ? using 2.2.0_alpha142 glibc installs with warning: ln complains that var/tmp/portage/sys-libs/glibc-2.15-r3/image/usr/lib/debug/usr/lib64/libieee.a.debug and other *.a.debug files exist and he cannot create hardlink. But it is just warning, no errors as in the case 2.2.0_alpha143 It looks like both scanelf and find are outputting the *.a files in prepstrip here: while read -r x ; do inode_link=$(get_inode_number "${x}") || die "stat failed unexpectedly" echo "${x}" >> "${inode_link}" || die "echo failed unexpectedly" done < <( scanelf -yqRBF '#k%F' -k '.symtab' "$@" find "$@" -type f ! -type l -name '*.a' ) @vapier and solar: Can we safely remove the find command here, or will scanelf omit *.a files in some cases (maybe dependent on scanelf version)? Use sort -u to eliminate any duplicates: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bba20c632e79426cd006dd2b732fcaed079ac43a I haven't tried to reproduce this bug, so please test. The patch applies to /usr/lib/portage/bin/ebuild-helpers/prepstrip. Created attachment 331112 [details, diff]
use sort -u to avoid duplicates
After patching 1 error for 1 file: ln: failed to create hard link ‘/var/tmp/portage/sys-libs/glibc-2.15-r3/image/usr/lib/debug/usr/lib32/libieee.a.debug’: File exists ln: failed to create hard link ‘/var/tmp/portage/sys-libs/glibc-2.15-r3/image/usr/lib/debug/usr/lib32/libmcheck.a.debug’: File exists ln: failed to create hard link ‘/var/tmp/portage/sys-libs/glibc-2.15-r3/image/usr/lib/debug/usr/lib32/libc_stubs.a.debug’: File exists ln: failed to create hard link ‘/var/tmp/portage/sys-libs/glibc-2.15-r3/image/usr/lib/debug/usr/lib64/libieee.a.debug’: File exists ln: failed to create hard link ‘/var/tmp/portage/sys-libs/glibc-2.15-r3/image/usr/lib/debug/usr/lib64/libmcheck.a.debug’: File exists ln: failed to create hard link ‘/var/tmp/portage/sys-libs/glibc-2.15-r3/image/usr/lib/debug/usr/lib64/libc_stubs.a.debug’: File exists (In reply to comment #6) hmm, those files are ELFs, they're just given .a suffixes (presumably so they can get linked against) might have to `grep -v '[.]a$'` the output from scanelf ... $ file /usr/lib/*.a /usr/lib/libanl.a: current ar archive /usr/lib/libBrokenLocale.a: current ar archive /usr/lib/libbsd-compat.a: current ar archive /usr/lib/libc.a: current ar archive /usr/lib/libc_nonshared.a: current ar archive /usr/lib/libcrypt.a: current ar archive /usr/lib/libc_stubs.a: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped /usr/lib/libdl.a: current ar archive /usr/lib/libg.a: current ar archive /usr/lib/libieee.a: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped /usr/lib/libm.a: current ar archive /usr/lib/libmcheck.a: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped /usr/lib/libnsl.a: current ar archive /usr/lib/libpthread.a: current ar archive /usr/lib/libpthread_nonshared.a: current ar archive /usr/lib/libresolv.a: current ar archive /usr/lib/librpcsvc.a: current ar archive /usr/lib/librt.a: current ar archive /usr/lib/libutil.a: current ar archive Created attachment 331158 [details, diff] use sort -u to avoid duplicates (In reply to comment #9) > After patching 1 error for 1 file: > > ln: failed to create hard link > ‘/var/tmp/portage/sys-libs/glibc-2.15-r3/image/usr/lib/debug/usr/lib32/ > libieee.a.debug’: File exists The sort call was not in the right place. I've tested this new patch and it works correctly now: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f930e2fafd14705e548637330cfc2d848c102cfa (In reply to comment #11) i think this is the way to go rather than changing scanelf. the tool knows nothing of file names, just file formats. you should put a comment in there though explaining why there is a sort, or at least mention this bug # Okay, I've added a comment referencing this bug: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d86595e92193fd6b2b76365d01a13147c21bf75f This is fixed in 2.1.11.33 and 2.2.0_alpha144. *** Bug 446976 has been marked as a duplicate of this bug. *** *** Bug 455754 has been marked as a duplicate of this bug. *** Created attachment 341126 [details]
build.log.xz
Hello,
I hit this bug while upgrading to glibc-2.16.0 with FEATURES=splitdebug (required by valgrind), though I use the latest portage-2.2.0_alpha166.
Created attachment 341128 [details]
environment
Created attachment 341130 [details]
emerge --info
Strange thing, I updated pax-utils from 0.3.0 to 0.6 and this fixed my issue. Please add some version dep on pax-utils. (I updated pax-utils because it is where scanelf belongs to). (In reply to comment #20) > Strange thing, I updated pax-utils from 0.3.0 to 0.6 and this fixed my issue. > Please add some version dep on pax-utils. Regardless if pax-utils version, if you still experience an issue like this with latest portage, then it's a portage bug because portage should be using locks to prevent any possibility interference. |
Created attachment 331040 [details] build.log.7z emerge -1 '=sys-libs/glibc-2.15-r3' failed (install phase) during strip binaries: ln: failed to create hard link ‘/var/tmp/portage/sys-libs/glibc-2.15-r3/image/usr/lib/debug/usr/lib64/libieee.a.debug’: File exists * ERROR: sys-libs/glibc-2.15-r3 failed (install phase): * ln failed unexpectedly Seems to me that bug introduced via flag FEATURES="splitdebug".