Linuxbrew / legacy-linuxbrew

:skull: This repository is defunct, because it has been split into https://github.com/Linuxbrew/brew and https://github.com/Linuxbrew/homebrew-core
http://linuxbrew.sh
Other
2.23k stars 296 forks source link

Problems installing on Chrome OS #1098

Closed spaceface777 closed 8 years ago

spaceface777 commented 8 years ago

I have tried installing Linuxbrew on Chrome OS (https://goo.gl/gUFvzc) multiple times already, but it doesn't work. The installation fails at line "brew install hello && brew test hello && brew remove hello". When I run the command it gives me the error message "/bin/bash: symbol lookup error: /bin/bash: undefined symbol: rl_signal_event_hook". I have also tried running "brew update" but running any brew command gives me the same error. Chromebrew works with no problem, though. If it helps, my Chromebook info is the following: Version 52.0.2715.0 canary (64-bit) Platform 8240.0.0 (Official Build) canary-channel falco Firmware Google_Falco.4389.92.0

sjackman commented 8 years ago

I don't have a Chromebook on which to test. I'd suggest contacting the author of the wiki article. @jbaum98

Please report the following:

unset LD_LIBRARY_PATH
brew config
brew doctor
spaceface777 commented 8 years ago

Thank you. Unsetting the library path (sort of) worked. The brew command works, but the install fails. This is the terminal log:

chronos@localhost / $ brew install hello && brew test hello && brew remove hello
==> Installing dependencies for hello: patchelf
==> Installing hello dependency: patchelf
==> Downloading https://linuxbrew.bintray.com/bottles/patchelf-0.9.x86_64_linux.bottle.tar.gz
Already downloaded: /home/chronos/user/.cache/Homebrew/patchelf-0.9.x86_64_linux.bottle.tar.gz
==> Pouring patchelf-0.9.x86_64_linux.bottle.tar.gz
Error: No such file or directory - /usr/local/linuxbrew/Cellar/patchelf/0.9/COPYING
Warning: Bottle installation failed: building from source.
==> Downloading http://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.gz
Already downloaded: /home/chronos/user/.cache/Homebrew/patchelf-0.9.tar.gz
==> ./configure --prefix=/usr/local/linuxbrew/Cellar/patchelf/0.9 CXXFLAGS=-static-libgcc -static-libstdc++ --disable-silent-rules
Last 15 lines from /home/chronos/user/.cache/Homebrew/Logs/patchelf/01.configure:

configure: WARNING: unrecognized options: --disable-debug
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... /usr/local/linuxbrew/bin/gcc-4.8
checking whether the C compiler works... no
configure: error: in `/usr/local/linuxbrew/tmp/patchelf20160427-16900-11jaycb/patchelf-0.9':
configure: error: C compiler cannot create executables
See `config.log' for more details

READ THIS: https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
These open issues may also help:
patchelf: Fails on static executables: cannot find section .interp https://github.com/Linuxbrew/linuxbrew/issues/1005
spaceface777 commented 8 years ago

I think that the error is here:

checking whether the C compiler works... no
configure: error: in `/usr/local/linuxbrew/tmp/patchelf20160427-16900-11jaycb/patchelf-0.9':
configure: error: C compiler cannot create executables
jbaum98 commented 8 years ago

I'm trying to replicate this probelm but I'm having some trouble. I got a similar error with an unset LD_LIBRARY_PATH but setting it to /usr/local/lib temporarily like it says in the guide made installing hello work.

sjackman commented 8 years ago

This error is quite odd:

==> Pouring patchelf-0.9.x86_64_linux.bottle.tar.gz
Error: No such file or directory - /usr/local/linuxbrew/Cellar/patchelf/0.9/COPYING

Please report brew gist-logs hello and also

ls -ld /usr/local/linuxbrew /usr/local/linuxbrew/Cellar

You may consider installing instead in /home/linuxbrew/.linuxbrew to make better use of bottles, which are compiled for this prefix. /usr/local/linuxbrew can also work, but can't make use of non-relocatable bottles.

jbaum98 commented 8 years ago

Try doing brew install hello --build-from-source to stop it from using a bottle. That worked for me.

sjackman commented 8 years ago

What error do you get with a bottle? Please report brew remove hello && brew install hello && brew gist-logs hello

jbaum98 commented 8 years ago

For both hello and other programs, it always gets stuck on pouring the bottle. With verbose output, it shows a bunch of patchelf commands and then it gets stuck.

The output of brew gist-logs hello was https://gist.github.com/anonymous/772a6290855ac7289db30d2f40d0e60d

sjackman commented 8 years ago

It just hangs after pouring the bottle? I think @DoomHammer has seen this behaviour as well. We haven't yet figured it out.

DoomHammer commented 8 years ago

I'll try once again with post-split repo, but the thing was simply weird. BTW: should we migrate this to linuxbrew/brew?

sjackman commented 8 years ago

Yep, if you're actively looking into it.

DoomHammer commented 8 years ago

Looks similar to Debian issue (missing /usr/bin/file) and it is something that I'd love to fix ;)

sjackman commented 8 years ago

@jbaum98 Could you please report the output of which -a file?

minektur commented 8 years ago

While the never-ending 'pouring bottle' is sitting there aparently doing nothing, the log files in ~/.cache/Homebrew/Logs/hello/ show that a ./configure was run and seemingly existed OK. If you poke around with ps and look at the process trees you can see that configure is being run multiple times. I dont know what I did, but at some point poking around, I made 'brew install hello' get un-hung and it finished. I tried to repeat it but had no success.

Forcing the build from source seems to avoid the hang. And in the chromebook default OS build there is NO file command:

$ which -a file
which: no file in (.......list of path....)

Is there a brew package that supplies a file command I could build from source and use? If not, I can probably track down the source code for 'file' and build one

rwhogg commented 8 years ago

Is there a brew package that supplies a file command I could build from source and use? If not, I can probably track down the source code for 'file' and build one

Yes, there is. It's called homebrew/dupes/file-formula.

minektur commented 8 years ago

to answer my own question - the libmagic recipie ALMOST builds the file command, but deletes it and just keeps library :) Let me see if I can get myself a working 'file' and then retry

minektur commented 8 years ago

Oh - I see - building now

minektur commented 8 years ago

Can confirm that having a working 'file' command does not help:

chronos@localhost /usr/local/linuxbrew/Library/Formula $ which file
/usr/local/linuxbrew/bin/file
chronos@localhost /usr/local/linuxbrew/Library/Formula $ brew install hello
==> Downloading https://linuxbrew.bintray.com/bottles/hello-2.10.x86_64_linux.bottle.t
Already downloaded: /home/chronos/user/.cache/Homebrew/hello-2.10.x86_64_linux.bottle.tar.gz
==> Pouring hello-2.10.x86_64_linux.bottle.tar.gz

hangs "forever" - or at least a very long time. I let it set for an hour last night. Since this is installing from bottle, it shouldn't be running configure right?

chronos@localhost ~ $ ps ax | grep configure
 3302 pts/1    SN+    0:00 /bin/bash ./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=/usr/local/linuxbrew/Cellar/hello/2.10

also I can confirm that building from source doesn't seem to have this problem:

chronos@localhost /usr/local/linuxbrew/Library/Formula $ time brew install --build-from-source hello
==> Downloading http://ftpmirror.gnu.org/hello/hello-2.10.tar.gz
Already downloaded: /home/chronos/user/.cache/Homebrew/hello-2.10.tar.gz
==> ./configure --disable-silent-rules --prefix=/usr/local/linuxbrew/Cellar/hello/2.10
==> make install
Warning: This keg was marked linked already, continuing anyway
/usr/local/linuxbrew/Cellar/hello/2.10: 52 files, 588.9K, built in 20 seconds

real    0m20.701s
user    0m14.463s
sys     0m5.459s
sjackman commented 8 years ago

Until we fix it, I believe the file command has to live precisely at /usr/bin/file. Try

sudo ln -s `brew --prefix`/bin/file /usr/bin/
sjackman commented 8 years ago

@minektur Please enclose copy-and-pastes in triple back ticks. See https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

minektur commented 8 years ago

will do, on the backticks... as for linking the file command, it is somewhat problematic on the chromebook. There are several layers of protections on the chromebook. One is to go into dev mode (then you can get shell, get root, read anything and have read-write on ~ and /usr/local - but all the OS is still read-only.

You can make /usr/bin and /bin rw but it requires remvoing another layer of protection, and disables automatic OS upgrades and a few other nice-to-have things.

In short, I can't easily make the symlink... Can you tell me which scripts are sensitive to the path of the file command so that I can potentially one-liner-sed-edit them automatically?

minektur commented 8 years ago

Is there an environment variable, or config file where I can force --build-from-source on ALL packages? for every install, including dependencies?

minektur commented 8 years ago

Also, I've done a search... can't find an open issue complaining about debian and missing /usr/bin/file - where can I go read?

sjackman commented 8 years ago

This issue will hopefully be fixed in the next few days. In the mean time, try change the following line: https://github.com/Linuxbrew/brew/blob/master/Library/Homebrew/keg_relocate.rb#L203

      if Utils.popen_read("/usr/bin/file", "--brief", pn).include?("text") ||

from /usr/bin/file to simply file.

minektur commented 8 years ago

This successfully makes installing (at least the one ) bottle pacakge(s) work for me. Thanks much.

sjackman commented 8 years ago

Glad to hear it! I'll commit this fix right now.

sjackman commented 8 years ago

This issue was moved to Linuxbrew/brew#28