aisingapore / TagUI

Free RPA tool by AI Singapore
Apache License 2.0
5.61k stars 582 forks source link

macOS OpenSSL version issue - Homebrew moved it from v1.0 to v1.1 - initial fix #635

Closed muratcim closed 4 years ago

muratcim commented 4 years ago

Hi Guys, for TagUI we may have found the permanent solution. Note that this solution may not help for other projects. Download directly from below link. After unzipping, put contents of unzipped folder into tagui/src/phantomjs folder.

https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip

Though above zip is PhantomJS v2.1.1 (same as TagUI packaged PJS), total file size for this zip after extraction is different. It might be Ariya, creator of PhantomJS, put in a fix already just to solve this headache with macOS/OpenSSL/Homebrew.


Hi Ken,

Today I encountered some error related to openssl while installing tagui on my mac computer. 2.2.0 version of homebrew released on November 27. In this version openssl 1.0 has been deleted for end of life.brew install openssl now installs version 1.1

referance: https://brew.sh/2019/11/27/homebrew-2.2.0/

Version 1.1 has /usr/local/opt/openssl/lib/libssl.1.1.dylib instead of /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

So the following lines of code in the tagui python project don't work

if not os.path.isfile('/usr/local/opt/openssl/lib/libssl.1.0.0.dylib'): This can be corrected in some way, but most importantly, phantom addiction.phantom gives the following error in openssl 1.1 version

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /Users/mcim/.moxie-tagui/phantomjs/bin/phantomjs Reason: image not found

I continue to research about the problem and I will share it when there is an improvement

dchakro commented 3 years ago

If you're getting errors like:

brew extract or brew create and brew tap-new to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of openssl formula file from an arbitrary URL is unsupported! (UsageError)

OR

Invalid usage: Installation of openssl from a GitHub commit URL is unsupported! brew extract openssl to a stable tap on GitHub instead. (UsageError)

I found this blog post which shows how to properly use brew extract, homebrew doesn't have good documentation for such use cases:

brew tap-new $USER/local-openssl
brew extract --version=1.0.2t openssl $USER/local-openssl

# Install from your freshly created local repo
brew install openssl@1.0.2t
# builds openssl (as no bottle is available)

Disclaimer: I'm not a user of TagUI, I use openssl-1.0.2t with rstudio-server.

kensoh commented 3 years ago

Hi Guys, for TagUI we may have found the permanent solution. Note that this solution may not help for other projects. Download directly from below link. After unzipping, put contents of unzipped folder into tagui/src/phantomjs folder.

https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip

Though above zip is PhantomJS v2.1.1 (same as TagUI packaged PJS), total file size for this zip after extraction is different. It might be Ariya, creator of PhantomJS, put in a fix already just to solve this headache with macOS/OpenSSL/Homebrew.

jack338c commented 3 years ago

rbenv/ruby-build#1489

I meet this issue too on my big sur,and I don't know how to install openssl before openssl was working on my mac 10.15.7 by this post

kensoh commented 3 years ago

Hi Guys, for TagUI we may have found the permanent solution. Note that this solution may not help for other projects. Download directly from below link. After unzipping, put contents of unzipped folder into tagui/src/phantomjs folder.

https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip

Though above zip is PhantomJS v2.1.1 (same as TagUI packaged PJS), total file size for this zip after extraction is different. It might be Ariya, creator of PhantomJS, put in a fix already just to solve this headache with macOS/OpenSSL/Homebrew.

jack338c commented 3 years ago

Hi Guys, for TagUI we may have found the permanent solution. Note that this solution may not help for other projects. Download directly from below link. After unzipping, put contents of unzipped folder into tagui/src/phantomjs folder.

https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip

Though above zip is PhantomJS v2.1.1 (same as TagUI packaged PJS), total file size for this zip after extraction is different. It might be Ariya, creator of PhantomJS, put in a fix already just to solve this headache with macOS/OpenSSL/Homebrew.

hello @kensoh Does you mean I can try your way to install openssl-1.0.2t successfully on mac big sur ? if yes,Could you please tell me the steps,I'm a new on macOS/OpenSSL/Homebrew

thanks for your help

kensoh commented 3 years ago

Hi @jack338c for TagUI, the solution is found, it is to unzip the above PhantomJS v2.1.1 to replace the existing installation.

That should fix the issue for TagUI. However, for other apps having this error message, it'll require the respective apps vendors or maintainer to advise if overriding the OpenSSL version on your macOS works. The real permanent solution will be other apps providers upgrading their apps to support newer OpenSSL but it can take time.

jack338c commented 3 years ago

@kensoh thanks for your detail explain. anyway,I would try it later 🥂

weallblind commented 3 years ago

I just wanted to leave a detail summary (based on the comments above) on how to fix this issue at the current moment:

  1. First go to the local installation of homebrew
cd /usr/local/Homebrew/
  1. Homebrew 2.5 remove the option to install formulas directly from git repos so we need to checkout an older version
git checkout 2.3.0
  1. Install openssl latest 1.0.x version
HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
  1. Go back to current version of homebrew
git checkout -
  1. Tell brew to use the old version of openssl this way you can chose wich version to use if you have both intalled
brew switch openssl 1.0.2t

brew switch is not working anymore:

Error: Calling `brew switch` is disabled! Use `brew link` @-versioned formulae instead.

See: Homebrew/discussions#339

Because of that, I ran 'git checkout -' as the last step. Then it worked

kensoh commented 3 years ago

Thanks @weallblind for adding on! For TagUI at least, the solution has a permanent fix by using the updated PhantomJS package at below link. In the next TagUI release, this will be packaged as part of the release. For other apps having this issue, the solution will depends on whether the app creators have migrated to newer version of OpenSSL (which is the real permanent fix instead of using workarounds which can come with their own disadvantages)

https://github.com/kelaberetiv/TagUI/issues/635#issue-530311716

3minus1 commented 3 years ago

For the RVM folks having trouble installing old Ruby versions on Apple M1, this might help https://medium.com/@akforsn/installing-old-ruby-versions-on-apple-m1-step-by-step-guide-501bb893c843

ari62 commented 2 years ago

I had this issue for using MariaDB. I am on a new Macbook Pro 2021 with M1 Max. I had to use x86 brew as described here: https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f Then dchakro's solution https://github.com/kelaberetiv/TagUI/issues/635#issuecomment-786487124 and also create symlinks:

sudo mkdir -p /usr/local/opt/openssl/lib
sudo ln -s /usr/local/homebrew/opt/openssl@1.0.2t/lib/libssl.dylib /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
sudo ln -s /usr/local/homebrew/opt/openssl@1.0.2t/lib/libcrypto.dylib /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
isole commented 1 year ago

I had this issue for using MariaDB. I am on a new Macbook Pro 2021 with M1 Max. I had to use x86 brew as described here: https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f Then dchakro's solution #635 (comment) and also create symlinks:

Stop putting information behind paywalls.... makes me sick