WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Linuxbrew unable to update, install python

Open alexanderwhatley opened this issue 10 years ago • 35 comments

When I try to install python3 with linuxbrew, I get the following error message:

alex@ALEXANDERPC:/mnt/c/users/Alexander/Downloads$ brew install python3 Error: Unsupported special dependency :perl Please report this bug: https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting /home/alex/.linuxbrew/Library/Homebrew/dependency_collector.rb:123:in parse_symbol_spec' /home/alex/.linuxbrew/Library/Homebrew/compat/dependency_collector.rb:17:inparse_symbol_spec' /home/alex/.linuxbrew/Library/Homebrew/dependency_collector.rb:73:in parse_spec' /home/alex/.linuxbrew/Library/Homebrew/dependency_collector.rb:61:inbuild' /home/alex/.linuxbrew/Library/Homebrew/dependency_collector.rb:48:in block in fetch' /home/alex/.linuxbrew/Library/Homebrew/dependency_collector.rb:48:infetch' /home/alex/.linuxbrew/Library/Homebrew/dependency_collector.rb:48:in fetch' /home/alex/.linuxbrew/Library/Homebrew/dependency_collector.rb:38:inadd' /home/alex/.linuxbrew/Library/Homebrew/software_spec.rb:155:in depends_on' /home/alex/.linuxbrew/Library/Homebrew/formula.rb:1862:inblock in depends_on' /home/alex/.linuxbrew/Library/Homebrew/formula.rb:1862:in each' /home/alex/.linuxbrew/Library/Homebrew/formula.rb:1862:independs_on' /home/alex/.linuxbrew/Library/Taps/homebrew/homebrew-core/Formula/openssl.rb:33:in <class:Openssl>' /home/alex/.linuxbrew/Library/Taps/homebrew/homebrew-core/Formula/openssl.rb:1:inload_formula' /home/alex/.linuxbrew/Library/Homebrew/formulary.rb:21:in module_eval' /home/alex/.linuxbrew/Library/Homebrew/formulary.rb:21:inload_formula' /home/alex/.linuxbrew/Library/Homebrew/formulary.rb:34:in load_formula_from_path' /home/alex/.linuxbrew/Library/Homebrew/formulary.rb:83:inload_file' /home/alex/.linuxbrew/Library/Homebrew/formulary.rb:74:in klass' /home/alex/.linuxbrew/Library/Homebrew/formulary.rb:70:inget_formula' /home/alex/.linuxbrew/Library/Homebrew/formulary.rb:207:in factory' /home/alex/.linuxbrew/Library/Homebrew/dependency.rb:32:into_formula' /home/alex/.linuxbrew/Library/Homebrew/dependency.rb:93:in block in expand' /home/alex/.linuxbrew/Library/Homebrew/dependencies.rb:9:ineach' /home/alex/.linuxbrew/Library/Homebrew/dependencies.rb:9:in each' /home/alex/.linuxbrew/Library/Homebrew/dependency.rb:80:inexpand' /home/alex/.linuxbrew/Library/Homebrew/formula.rb:1223:in recursive_dependencies' /home/alex/.linuxbrew/Library/Homebrew/requirement.rb:196:inexpand' /home/alex/.linuxbrew/Library/Homebrew/formula.rb:1229:in recursive_requirements' /home/alex/.linuxbrew/Library/Homebrew/formula_installer.rb:313:inexpand_requirements' /home/alex/.linuxbrew/Library/Homebrew/formula_installer.rb:263:in compute_dependencies' /home/alex/.linuxbrew/Library/Homebrew/formula_installer.rb:130:inverify_deps_exist' /home/alex/.linuxbrew/Library/Homebrew/formula_installer.rb:123:in prelude' /home/alex/.linuxbrew/Library/Homebrew/cmd/install.rb:231:ininstall_formula' /home/alex/.linuxbrew/Library/Homebrew/cmd/install.rb:93:in block in install' /home/alex/.linuxbrew/Library/Homebrew/cmd/install.rb:93:ineach' /home/alex/.linuxbrew/Library/Homebrew/cmd/install.rb:93:in install' /home/alex/.linuxbrew/Library/brew.rb:84:in

'

When I try to update linuxbrew, I get the following error:

alex@ALEXANDERPC:/mnt/c/users/Alexander/Downloads$ brew update Initialized empty Git repository in /home/alex/.linuxbrew/.git/ remote: Counting objects: 478, done. remote: Compressing objects: 100% (434/434), done. remote: Total 478 (delta 27), reused 320 (delta 17), pack-reused 0 Receiving objects: 100% (478/478), 772.50 KiB | 1.47 MiB/s, done. Resolving deltas: 100% (27/27), done. From https://github.com/Linuxbrew/brew

  • [new branch] master -> origin/master fatal: cannot rmdir 'Library/Formula': Directory not empty

Any help?

alexanderwhatley avatar Jun 03 '16 13:06 alexanderwhatley

Also, when I close and reopen the program, even though I added and exported the path for brew, it is no longer on the path.....

alexanderwhatley avatar Jun 03 '16 15:06 alexanderwhatley

Thanks for reporting the issue. Can you please share out the steps you used to install linuxbrew so we can try to repro locally?

stehufntdev avatar Jun 07 '16 16:06 stehufntdev

Sure - I just installed ruby (sudo apt-get install ruby I believe?) and ran the command "ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)""

alexanderwhatley avatar Jun 07 '16 16:06 alexanderwhatley

Thanks, I was able to repro the error on WSL but I was also able to repro the error on native Ubuntu 14.04. I'm not familiar enough with homebrew to know what's wrong but it appears to be a configuration issue. Can you please confirm?

stehufntdev avatar Jun 07 '16 16:06 stehufntdev

Sorry, how would I confirm that?

alexanderwhatley avatar Jun 07 '16 17:06 alexanderwhatley

Sorry, I should have been more clear :). Have you tried the steps above on native Linux, preferably Ubuntu 14.04 to match WSL? Since it didn't work for me on native Ubuntu 14.04 I'm assuming there's a missing configuration step but wanted to check if you had this working on native Linux.

stehufntdev avatar Jun 07 '16 18:06 stehufntdev

Unfortunately, I don't have Linux setup on my computer at the moment, so I don't think I can help with that.

alexanderwhatley avatar Jun 07 '16 18:06 alexanderwhatley

No worries, just wanted to double check. Searching for the failure message above I found a related failure that described running brew update first - https://github.com/Microsoft/BashOnWindows/issues/471#issuecomment-224369880. That seemed to resolve the failure on both native Ubuntu and WSL.

Closing this out for now, but please let us know if you hit other issues unique to WSL.

stehufntdev avatar Jun 07 '16 18:06 stehufntdev

Thanks. Brew began to download the requirements for python3, but then crashed once it began to install openssl:

alex@ALEXANDERPC:~$ brew install python3
==> Installing dependencies for python3: openssl, bzip2
==> Installing python3 dependency: openssl
==> Downloading https://www.openssl.org/source/openssl-1.0.2h.tar.gz
Already downloaded: /home/alex/.cache/Homebrew/openssl-1.0.2h.tar.gz
==> perl ./Configure --prefix=/home/alex/.linuxbrew/Cellar/openssl/1.0.2h --openssldir=/home/alex/.linuxbrew/etc/openssl no-ssl2 zlib-dynamic shared enable-cms -isystem/home/alex/.linuxbrew/include -Os -w -pipe -march=native -L/home/alex/.linuxbrew/lib -Wl,--dynamic-li
==> make depend
==> make
==> make test
Last 15 lines from /home/alex/.cache/Homebrew/Logs/openssl/04.make:

testing...
make[1]: Entering directory `/tmp/openssl-20160607-5619-1kgsj4k/openssl-1.0.2h/test'
make[2]: Entering directory `/tmp/openssl-20160607-5619-1kgsj4k/openssl-1.0.2h'
making all in apps...
make[3]: Entering directory `/tmp/openssl-20160607-5619-1kgsj4k/openssl-1.0.2h/apps'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/openssl-20160607-5619-1kgsj4k/openssl-1.0.2h/apps'
make[2]: Leaving directory `/tmp/openssl-20160607-5619-1kgsj4k/openssl-1.0.2h'
../util/shlib_wrap.sh ./destest
ERROR: ld.so: object '../util/../libcrypto.so.1.0.0' from LD_PRELOAD cannot be preloaded (cannot enable executable stack as shared object requires): ignored.
./destest: error while loading shared libraries: libcrypto.so.1.0.0: cannot enable executable stack as shared object requires: Invalid argument
make[1]: *** [test_des] Error 127
make[1]: Leaving directory `/tmp/openssl-20160607-5619-1kgsj4k/openssl-1.0.2h/test'
make: *** [tests] Error 2

READ THIS: https://github.com/Linuxbrew/brew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/Linuxbrew/homebrew-core/issues

Apparently, this issue has already been reported as well: https://github.com/Linuxbrew/homebrew-core/issues/292

alexanderwhatley avatar Jun 07 '16 20:06 alexanderwhatley

Thanks for the follow-up. The "cannot enable executable stack" failure is discussed in #286. The workaround in there may work depending on libcrypto.so.1.0.0's requirements.

stehufntdev avatar Jun 07 '16 20:06 stehufntdev

I stumbled into the same issue. In general, binaries aren't executed that are patched with patchelf, and all the bottles (precompiled binaries from brew) are this way. So to use linuxbrew, you currently should set it to always compile from source. You can get openssl to compile if you start with all packages self-compiled (packages like bzip2 and xz have to be compiled on the machine because they otherwise silently fail), but you have to disable tests. See https://github.com/Linuxbrew/homebrew-core/issues/761 and issues referenced in that for further discussion/info.

JMoVS avatar Aug 16 '16 20:08 JMoVS

So to use linuxbrew, you currently should set it to always compile from source.

echo 'export HOMEBREW_BUILD_FROM_SOURCE=1' >>~/.bash_profile
export HOMEBREW_BUILD_FROM_SOURCE=1

See https://github.com/Linuxbrew/brew/wiki/Windows

sjackman avatar Nov 23 '16 07:11 sjackman

@sjackman have you checked that bash_profile is correct? If I remember correctly, out of the box, windows just looks at .bashrc and not cares about .bash_profile, therefore the exports not working...

JMoVS avatar Nov 23 '16 08:11 JMoVS

I don't unfortunately have access to a Windows machine with which to test. If you can confirm, please correct the Wiki. It's world-writable. Thanks for the clarification.

sjackman avatar Nov 23 '16 18:11 sjackman

On current builds, there's an execv issue for running brew test that needs to be investigated related to patch elf binaries. Here are the repro steps:

To reproduce the issue, install Linuxbrew (instructions at http://linuxbrew.sh) and run

brew install hello brew test hello

stehufntdev avatar Nov 30 '16 17:11 stehufntdev

As far as I can tell, the Windows kernel is unable to load ELF executables that have been modified using patchelf.

sjackman avatar Nov 30 '16 18:11 sjackman

Thanks @sjackman, I got the repro under a debugger and confirmed it is an issue with the lxcore driver parsing the elf binary. I filed a task on our side to investigate further and will report back with any updates.

stehufntdev avatar Dec 01 '16 17:12 stehufntdev

@stehufntdev That's great news. Thanks for the update.

sjackman avatar Dec 01 '16 18:12 sjackman

After updating the elf parsing logic in the lxcore driver, I was able to run brew test hello. The fix should be out in an insider build soon.

stehufntdev avatar Dec 06 '16 01:12 stehufntdev

That's very exciting! Thanks! I don't follow the releases closely. Are you able to ping me (tag me) when it's released at such a stage that user's will see the fix? When is that expected?

sjackman avatar Dec 06 '16 02:12 sjackman