Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

Error: Bad file descriptor when install ace #3

Closed
janckerchen opened this issue Apr 5, 2013 · 10 comments
Closed

Error: Bad file descriptor when install ace #3

janckerchen opened this issue Apr 5, 2013 · 10 comments
Assignees

Comments

@janckerchen
Copy link

$ brew install ace
Error: Bad file descriptor
/home/deploy/linuxbrew/Library/Homebrew/build.rb:27:in `initialize'
/home/deploy/linuxbrew/Library/Homebrew/build.rb:27:in `new'
/home/deploy/linuxbrew/Library/Homebrew/build.rb:27:in `main'
/home/deploy/linuxbrew/Library/Homebrew/build.rb:12:in `block in <top (required)>'
Error: Suspicious installation failure

my linuxbrew commit:

commit 1f2c62fd1111229a72fc2b3f7209d35f9c8f5211
Author: Shaun Jackman <sjackman@gmail.com>
Date:   Fri Apr 5 10:13:45 2013 -0700

    Disable universal_binary on non-OSX systems
@sjackman
Copy link
Member

sjackman commented Apr 5, 2013

From some reason I don't yet understand, Ruby 2.0 does not work with Homebrew on Linux. Can someone confirm whether Ruby 2.0 works with Homebrew on Mac OS X? If it doesn't work on OS X either, this issue should be moved to mxcl/homebrew.

@sjackman
Copy link
Member

sjackman commented Apr 5, 2013

@janckerchen Please report ruby --version

@jacknagel
Copy link
Contributor

This is an issue on all platforms. In Ruby 2.0, all file descriptors (except 0, 1, and 2) are marked close-on-exec by default. Homebrew uses a pipe to pass exceptions between the build process and the main process, but in Ruby 2.0 this descriptor is closed in the build process.

So we either need to pass this fd hash as the last argument to exec on Ruby 2 (which means building up the args as an array because Ruby 1.8 doesn't accept this argument) or unset FD_CLOEXEC on the descriptor before exec'ing.

@sjackman
Copy link
Member

sjackman commented Apr 5, 2013

@jacknagel The latter seems like a clean solution. Does anyone have the impetus to fix this?

@jacknagel
Copy link
Contributor

Looking into it, it doesn't appear it's possible to unset this flag (even from C, let alone ruby). So we'll have to go with the former.

I'll work up a patch later.

@sjackman
Copy link
Member

sjackman commented Apr 5, 2013

Thanks, Jack.

@sjackman
Copy link
Member

sjackman commented Apr 5, 2013

@janckerchen As a workaround:

brew tap homebrew/versions
brew install ruby193

@jacknagel
Copy link
Contributor

@jacknagel
Copy link
Contributor

I merged the patch into core.

@janckerchen
Copy link
Author

oh! my ruby version is ruby20, I install it just for confirm linux brew works well, ruby20 is default version in this brach. I uninstall it now and restore my default ruby19, all errors disappear.

But life is not easy, right? here is another gift for you~, #6 "brew install ace" failed for other reason.

I close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants