Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 479656 - multiprocessing.eclass throws errors like .../environment: line 1299: /dev/fd/62: No such file or directory
Summary: multiprocessing.eclass throws errors like .../environment: line 1299: /dev/fd...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-03 18:06 UTC by Anthony Basile
Modified: 2014-06-16 13:26 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2013-08-03 18:06:02 UTC
An example here is =sys-libs/zlib-1.2.8-r1.  When emerged on ISA=mips32r2 ABI=o32 uclibc, the configure phase and the compile phase do nothing and the image directory $D is empty after install (except for a skeletal directory structure).

Here's eclass-debug.log which looks like its picking up the ABI value but not acting on it when the eclass does multilib_foreach_abi ...  Note I killed it at qmerge otherwise it would break my system.

inherit: autotools -> /usr/portage/eclass/autotools.eclass
*** Multiple Inheritence (Level: 2)
inherit: libtool -> /usr/portage/eclass/libtool.eclass
*** Multiple Inheritence (Level: 3)
inherit: multilib -> /usr/portage/eclass/multilib.eclass
*** Multiple Inheritence (Level: 4)
inherit: toolchain-funcs -> /usr/portage/eclass/toolchain-funcs.eclass
*** Multiple Inheritence (Level: 5)
inherit: multilib -> /usr/portage/eclass/multilib.eclass
inherit: toolchain-funcs -> /usr/portage/eclass/toolchain-funcs.eclass
inherit: multiprocessing -> /usr/portage/eclass/multiprocessing.eclass
inherit: toolchain-funcs -> /usr/portage/eclass/toolchain-funcs.eclass
inherit: multilib -> /usr/portage/eclass/multilib.eclass
inherit: multilib-minimal -> /usr/portage/eclass/multilib-minimal.eclass
*** Multiple Inheritence (Level: 2)
inherit: multilib-build -> /usr/portage/eclass/multilib-build.eclass
*** Multiple Inheritence (Level: 3)
inherit: multibuild -> /usr/portage/eclass/multibuild.eclass
*** Multiple Inheritence (Level: 4)
inherit: multiprocessing -> /usr/portage/eclass/multiprocessing.eclass
inherit: multilib -> /usr/portage/eclass/multilib.eclass
EXPORT_FUNCTIONS: src_configure -> multilib-minimal_src_configure
EXPORT_FUNCTIONS: src_compile -> multilib-minimal_src_compile
EXPORT_FUNCTIONS: src_test -> multilib-minimal_src_test
EXPORT_FUNCTIONS: src_install -> multilib-minimal_src_install
multilib_copy_sources: entering function, parameters: 
multilib_get_enabled_abis: entering function, parameters: 
multilib_get_enabled_abis: no ABIs enabled, fallback to o32
multilib_get_enabled_abis: ABI=o32, DEFAULT_ABI=o32
multibuild_copy_sources: entering function, parameters: 
multibuild_foreach_variant: entering function, parameters: _multibuild_create_source_copy
multibuild_foreach_variant: initial build_dir = /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8
multilib_foreach_abi: entering function, parameters: multilib-minimal_abi_src_configure
multilib_get_enabled_abis: entering function, parameters: 
multilib_get_enabled_abis: no ABIs enabled, fallback to o32
multilib_get_enabled_abis: ABI=o32, DEFAULT_ABI=o32
multibuild_foreach_variant: entering function, parameters: _multilib_multibuild_wrapper multilib-minimal_abi_src_configure
multibuild_foreach_variant: initial build_dir = /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8
multilib_foreach_abi: entering function, parameters: multilib-minimal_abi_src_compile
multilib_get_enabled_abis: entering function, parameters: 
multilib_get_enabled_abis: no ABIs enabled, fallback to o32
multilib_get_enabled_abis: ABI=o32, DEFAULT_ABI=o32
multibuild_foreach_variant: entering function, parameters: _multilib_multibuild_wrapper multilib-minimal_abi_src_compile
multibuild_foreach_variant: initial build_dir = /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8
multilib_foreach_abi: entering function, parameters: multilib-minimal_abi_src_install
multilib_get_enabled_abis: entering function, parameters: 
multilib_get_enabled_abis: no ABIs enabled, fallback to o32
multilib_get_enabled_abis: ABI=o32, DEFAULT_ABI=o32
multibuild_foreach_variant: entering function, parameters: _multilib_multibuild_wrapper multilib-minimal_abi_src_install
multibuild_foreach_variant: initial build_dir = /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8
multilib_install_wrappers: entering function, parameters:
Comment 1 Anthony Basile gentoo-dev 2013-08-03 18:35:48 UTC
Here's the build log

 * Package:    sys-libs/zlib-1.2.8-r1
 * Repository: gentoo
 * Maintainer: base-system@gentoo.org
 * USE:        elibc_uclibc kernel_linux mips uclibc userland_GNU
 * FEATURES:   sandbox
 * Package:    sys-libs/zlib-1.2.8-r1
 * Repository: gentoo
 * Maintainer: base-system@gentoo.org
 * USE:        elibc_uclibc kernel_linux mips uclibc userland_GNU
 * FEATURES:   sandbox
>>> Unpacking source...
>>> Unpacking zlib-1.2.8.tar.gz to /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work
>>> Source unpacked in /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work
>>> Preparing source in /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8 ...
 * Will copy sources from /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8
/var/tmp/portage/sys-libs/zlib-1.2.8-r1/temp/environment: line 1285: /dev/fd/62: No such file or directory
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8 ...
/var/tmp/portage/sys-libs/zlib-1.2.8-r1/temp/environment: line 1299: /dev/fd/62: No such file or directory
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8 ...
/var/tmp/portage/sys-libs/zlib-1.2.8-r1/temp/environment: line 1299: /dev/fd/62: No such file or directory
>>> Source compiled.
>>> Test phase [not enabled]: sys-libs/zlib-1.2.8-r1

>>> Install zlib-1.2.8-r1 into /var/tmp/portage/sys-libs/zlib-1.2.8-r1/image/ category sys-libs
/var/tmp/portage/sys-libs/zlib-1.2.8-r1/temp/environment: line 1299: /dev/fd/62: No such file or directory
>>> Completed installing zlib-1.2.8-r1 into /var/tmp/portage/sys-libs/zlib-1.2.8-r1/image/

/usr/lib/portage/bin/ebuild-helpers/prepstrip: line 289: /dev/fd/62: No such file or directory
/usr/lib/portage/bin/ebuild-helpers/ecompressdir: line 72: /dev/fd/62: No such file or directory
/usr/lib/portage/bin/ebuild-helpers/ecompressdir: line 72: /dev/fd/62: No such file or directory
/usr/lib/portage/bin/ebuild-helpers/ecompressdir: line 72: /dev/fd/62: No such file or directory
/usr/lib/portage/bin/ebuild-helpers/ecompressdir: line 72: /dev/fd/62: No such file or directory
/usr/lib/portage/bin/ebuild-helpers/ecompressdir: line 72: /dev/fd/62: No such file or directory
ecompressdir: bzip2 -9 /usr/share/doc
/usr/lib/portage/bin/ebuild-helpers/ecompressdir: line 72: /dev/fd/62: No such file or directory
Comment 2 Anthony Basile gentoo-dev 2013-08-03 19:32:04 UTC
Okay this is solved by adding at least the following to the profile (hardened/linux/uclibc/mips):

    LIBDIR_o32="lib"

however I will add also

    DEFAULT_ABI="o32"
    ABI="${DEFAULT_ABI}"

since it makes explicit the ABI.  This may be required in some of the other minor arches (like eabi for arm) but at least I get what the multilib-* eclasses are looking for.

I'm still puzzled why amd64 and x86 just work without any LIBDIR/ABI set but for good measure I will set them there too.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-08-04 09:16:52 UTC
Well, IMO multiprocessing.eclass would still use some '|| die' or assertion love. Failing that horribly because of improper /dev setup is not something good to do.
Comment 4 SpanKY gentoo-dev 2013-08-27 23:40:28 UTC
(In reply to Michał Górny from comment #3)

you really need to provide actual details and not just generalizations.  if you read the code, you'll see that it already has `die` in a bunch of places.

Anthony: can you attach the output of running `emerge --debug zlib` and make sure you have a /dev/fd symlink ?
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-08-28 07:32:11 UTC
(In reply to SpanKY from comment #4)
> (In reply to Michał Górny from comment #3)
> 
> you really need to provide actual details and not just generalizations.  if
> you read the code, you'll see that it already has `die` in a bunch of places.
> 
> Anthony: can you attach the output of running `emerge --debug zlib` and make
> sure you have a /dev/fd symlink ?

He didn't have the symlink. That's what IMO multiprocessing should assert for.
Comment 6 SpanKY gentoo-dev 2013-10-16 06:42:48 UTC
(In reply to Michał Górny from comment #5)

but multiprocessing.eclass isn't using /dev/fd directly (ignoring the fallback logic in redirect_alloc_fd which wasn't run in Anthony's case)

so why does this check belong in multiprocessing ?
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-16 11:51:37 UTC
(In reply to SpanKY from comment #6)
> (In reply to Michał Górny from comment #5)
> 
> but multiprocessing.eclass isn't using /dev/fd directly (ignoring the
> fallback logic in redirect_alloc_fd which wasn't run in Anthony's case)

Well, I specifically meant asserting in the fallback logic.
Comment 8 SpanKY gentoo-dev 2013-10-16 20:41:44 UTC
(In reply to Michał Górny from comment #7)

but that wouldn't have made a difference in this bug report :).  so even if there was an assert there a year ago, Anthony still would have filed this bug and the output would have been unchanged.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-16 20:45:07 UTC
(In reply to SpanKY from comment #8)
> (In reply to Michał Górny from comment #7)
> 
> but that wouldn't have made a difference in this bug report :).  so even if
> there was an assert there a year ago, Anthony still would have filed this
> bug and the output would have been unchanged.

I know. I'm just using this bug as an opportunity to fix the other issue. Do you really want me to file a separate report for that?
Comment 10 Alexander Tsoy 2013-11-27 01:05:18 UTC
(In reply to Anthony Basile from comment #2)
> Okay this is solved by adding at least the following to the profile
> (hardened/linux/uclibc/mips):
> 
>     LIBDIR_o32="lib"
> 
> however I will add also
> 
>     DEFAULT_ABI="o32"
>     ABI="${DEFAULT_ABI}"
> 
> since it makes explicit the ABI.  This may be required in some of the other
> minor arches (like eabi for arm) but at least I get what the multilib-*
> eclasses are looking for.

I have the same issue with the following profile:
# ls -l /etc/portage/make.profile 
lrwxrwxrwx 1 root root 52 Nov 26 19:54 /etc/portage/make.profile -> ../../usr/portage/profiles/hardened/linux/arm/armv6j
Comment 11 Alexander Tsoy 2013-11-27 01:12:28 UTC
# grep CHOST= /etc/portage/make.conf                          
CHOST="armv6j-hardfloat-linux-gnueabi"
Comment 12 Alexander Tsoy 2013-11-27 12:09:37 UTC
Please ignore my comments. =/
Comment 13 SpanKY gentoo-dev 2013-11-30 05:53:10 UTC
(In reply to Michał Górny from comment #9)

the point was that your comment #3 which re-opened & re-assigned things (as well as later ones) never made that clear.
Comment 15 Michael Haubenwallner (RETIRED) gentoo-dev 2013-12-04 10:47:07 UTC
(In reply to SpanKY from comment #14)

Breaks on AIX (in Prefix) now, as AIX does not have /dev/fd at all.

Because of this, bash handles /dev/fd/[0-9]* and /dev/std{in,out,err} itself, allowing for the fallback in redirect_alloc_fd() to still work.

However, this special handling is disabled (at compile time) when the OS provides this handling.

Thus [[ -L /dev/fd ]] is false while [[ -e /dev/fd/0 ]] still is true.

Though not sure how to fix this correctly:
Does PM guarantee (one of) /dev/fd/{0,1,2} to be available?
Then [[ ! -e /dev/fd/0 ]] should work here instead.
Comment 16 Alan Hourihane 2013-12-04 10:58:52 UTC
Yes,

This hunk of code breaks on FreeMiNT too.

                # Make sure /dev/fd is sane. #479656
                if [[ ! -L /dev/fd ]] ; then
                        eerror "You're missing a /dev/fd symlink to /proc/self/fd."
                        eerror "Please fix the symlink and check your boot scripts (udev/etc...)."
                        die "/dev/fd is broken"
                fi

Surely, it should be moved to the 'else' clause where direct use of /dev/fd is made. That means platforms with an appropriate bash will use the former code.
Not ideal, but it will avoid the issue in most cases.
Comment 17 Paul Varner (RETIRED) gentoo-dev 2013-12-05 18:27:53 UTC
The fix does not work on Mac OSX either.
Comment 18 Paul Varner (RETIRED) gentoo-dev 2013-12-05 19:23:23 UTC
(In reply to SpanKY from comment #14)
> http://sources.gentoo.org/eclass/multiprocessing.eclass?r1=1.4&r2=1.5

Can we please revert this change since it causes any ebuild that calls eautoreconf to fail on those archs that don't have a /dev/fd symlink?
Comment 19 Jonathan Callen (RETIRED) gentoo-dev 2013-12-06 03:05:16 UTC
+  06 Dec 2013; Jonathan Callen <jcallen@gentoo.org> multiprocessing.eclass:
+  Fix multiprocessing.eclass for non-Linux hosts
+

This fix probably could be made better, but at least it isn't completely broken now.
Comment 20 SpanKY gentoo-dev 2013-12-07 09:14:20 UTC
(In reply to Jonathan Callen from comment #19)

please post links to diffs, not useless changelog entries:
http://sources.gentoo.org/eclass/multiprocessing.eclass?r1=1.5&r2=1.6

uname is bad, but i don't have a fundamentally better answer.  i've changed it to CBUILD instead at least.
http://sources.gentoo.org/eclass/multiprocessing.eclass?r1=1.6&r2=1.7
Comment 21 Daa Jaa 2014-06-16 13:26:47 UTC
It breaks gentooandroid.sourceforge.net too.

Isn't it simpler to use
  use prefix ||
than
  if [[ ! -L /dev/fd && ${CBUILD} == *linux* ]] ; then
?
The local fix I use is
  if [[ ! -L /dev/fd && ${CBUILD} == *linux* && ! has non-root ${FEATURES} ]] ; then