Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 467566 - sys-fs/static-dev-0.1: /dev/fd -> /proc/self/fd symlink is not created automatically
Summary: sys-fs/static-dev-0.1: /dev/fd -> /proc/self/fd symlink is not created automa...
Status: RESOLVED NEEDINFO
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (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-04-27 20:41 UTC by Jaroslav Rakhmatoullin
Modified: 2013-05-01 16:43 UTC (History)
0 users

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


Attachments
build.log (build.log,15.68 KB, text/plain)
2013-04-27 20:41 UTC, Jaroslav Rakhmatoullin
Details
emerge --info (emerge --info,4.79 KB, text/plain)
2013-04-27 20:43 UTC, Jaroslav Rakhmatoullin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Rakhmatoullin 2013-04-27 20:41:52 UTC
Created attachment 346728 [details]
build.log

The bash construct while EXP;do job;done< <(file) fails when there is nothing in /dev/fd. A possible workaround is: 

ln -s /proc/self/fd /dev/fd

Alternatively (imho preferably), one could avoid the <(file) construct. I think this is an important bug because AFAIK, while bash is part of gentoo, it never required udev as part of a functional building system. Surely someone has spotted this before? Maybe no one cares enough to fix it (do comment)? 

It's possible to circumvent the issue in bash with something like: 

    IFS='$'
    for i in $(IFS=' '; find ${dirlist} -name '*.la' -type f);do
         files+=( "$i" )
    done

instead of 

   while read -r line
      do
          files+=( "$line" )
   done< <( find ${dirlist} -name '*.la' -type f )

The above example is from /usr/bin/lafilefixer[148-151] of dev-util/lafilefixer, which is where i imagine this bug originated.
Comment 1 Jaroslav Rakhmatoullin 2013-04-27 20:43:02 UTC
Created attachment 346730 [details]
emerge --info
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-04-28 21:32:23 UTC
Why is there nothing in /dev/?
Comment 3 Zac Medico gentoo-dev 2013-04-28 22:27:53 UTC
The /dev/fd/ directory should be available on any modern unix-like system. A quick google search turned up this link which has some info about it:

  http://www.informit.com/articles/article.aspx?p=99706&seqNum=15

(In reply to comment #0)
> The bash construct while EXP;do job;done< <(file) fails when there is
> nothing in /dev/fd.

I'd say that it's fair for bash to assume that /dev/fd/ exists. So, if your chosen device manager (or lack thereof) doesn't create the /dev/fd -> /proc/self/fd symlink for you, then I'd suggest that you create an init script to do it for you.
Comment 4 SpanKY gentoo-dev 2013-04-28 22:56:17 UTC
yes, /dev/fd should be a symlink to /proc/self/fd and your dev-manager should be setting that up.  that means udev or mdev or something else.  if you've disabled all of those, then you're on the hook for providing those symlinks in /dev.
Comment 5 Jaroslav Rakhmatoullin 2013-04-29 18:56:32 UTC
> I'd say that it's fair for bash to assume that /dev/fd/ exists. So, if your chosen device manager (or lack thereof) doesn't create the /dev/fd 

> if you've disabled all of those, then you're on the hook for providing those symlinks in /dev.

I have wrongly assumed that sys-fs/static-dev would take care of all my needs. Looking at the ebuild for it, I see that it does nothing to check or create that file. Perhaps it would be appropriate to notify the user about their responsibility to maintain a valid /dev/fd folder or symlink. Along with any other features from udev that the build system relies on. 

I see that the recent stage3 tarball has this file, which must be the reason why static-udev assumes there is no need to check for it. 

It's probably not correct of me to expect that a system can be installed in 2008, virtually left alone for five years and then upgraded almost automatically. 

Actually, one of the reasons I cherish and keep using Gentoo is exactly because long-term upgrades are painless compared to the process of upgrading a binary distro with such long intervals in between. They usually leave the system in a broken state and "helping" them manually is a lot more complicated than on Gentoo. 

Anyway, I humbly suggest that static-dev checks for and provides any and all features of /dev that the build system relies on.
Comment 6 SpanKY gentoo-dev 2013-04-29 20:58:25 UTC
(In reply to comment #5)

that's because MAKEDEV creates these things for you as part of the 'generic' target.  seems to work just fine for me:
$ mkdir foo
$ cd foo
$ sudo MAKEDEV -d $PWD generic
$ find -type l
./mixer0
./dsp0
./audio0
./ttyUB1
./ttyUB0
./stderr
./stdout
./stdin
./fd
Comment 7 Jaroslav Rakhmatoullin 2013-05-01 16:43:18 UTC
I see. Thank you for clarifying.