Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle a too old system Git on OS X 10.8 and below #3837

Merged
merged 1 commit into from
Feb 27, 2018
Merged

Handle a too old system Git on OS X 10.8 and below #3837

merged 1 commit into from
Feb 27, 2018

Conversation

MikeMcQuaid
Copy link
Member

@@ -390,7 +390,7 @@ EOS
brew install curl
fi

if ! git --version >/dev/null 2>&1
if [[ -n "$HOMEBREW_SYSTEM_GIT_TOO_OLD" ]] || ! git --version >/dev/null 2>&1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>/dev/null 2>&1 can be changed here and on line 398 to &>/dev/null. It does the same, yet is less verbose and cryptic.

I was going to submit a PR but then noticed Library/Homebrew/readall.rb has something similar on line 79, but there it is reversed (and it makes a difference), so you was unsure if you wanted to keep 2>&1 here for consistency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vitorgalvao 👍 to a PR for that!

Copy link
Member

@sjackman sjackman Feb 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that &>/dev/null is a bash-ism and is not portable to other POSIX shells. In particular, the default shell /bin/sh on Ubuntu is Dash, which does not implement &>/dev/null. It is interpreted as redirecting stdout to /dev/null (>/dev/null) and backgrounding the process (&).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[ is also a bashism but used extensively.

Copy link
Member

@vitorgalvao vitorgalvao Feb 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sjackman Best way around that is to make sure the shell is defined at the top. That way there won’t be surprises (especially since macOS will be forever stuck in Bash 3).

But after I’ve made the initial comment, I’ve noticed the rest of this script did already use &>/dev/null, so if this change is reverted, we should also make sure to replace those.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I see now that bin/brew is #!/bin/bash, so all is good.

@MikeMcQuaid MikeMcQuaid merged commit 8ee2d09 into Homebrew:master Feb 27, 2018
@MikeMcQuaid MikeMcQuaid deleted the system-git-too-old branch February 27, 2018 10:18
@UNIVAC-Colonel-Panic
Copy link

I'm on Mac OS X 10.7.5 Lion. Shouldn't I be able to install homebrew from scratch and have it resolve the SSL issue? Or do I need to manually uninstall the current broken homebrew first?

`$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /usr/bin/chgrp admin /Library/Caches/Homebrew
Password:
==> Downloading and installing Homebrew...
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Failed during: /bin/bash -o pipefail -c '/usr/bin/curl -fsSL https://github.com/Homebrew/brew/tarball/master | /usr/bin/tar xz -m --strip 1'
$`

@MikeMcQuaid
Copy link
Member Author

We don't support macOS versions below 10.11. If you can get it to work and submit a pull request we'll review and consider accepting it.

@sjackman
Copy link
Member

@taa1 Try (untested)…

git clone --depth=1 https://github.com/Homebrew/brew /usr/local/Homebrew
ln -s ../Homebrew/bin/brew /usr/local/bin/
export HOMEBREW_FORCE_BREWED_CURL=1
brew update

@ilovezfs
Copy link
Contributor

You need to use git:// protocol.

@UNIVAC-Colonel-Panic
Copy link

Thank you @sjackman and @ilovezfs for trying to help. I continue to get the SSL error. In addition to @sjackman's suggestion, I've also tried:

  • the various suggestions here which eventually led me to THIS issue Handle a too old system Git on OS X 10.8 and below #3837 which gave me initial hope
  • installing git-2.0.5-intel-universal-snow-leopard
  • uninstall Homebrew and reinstall
  • uninstall Homebrew and use Macports to install git (2.16.2) and curl (7.59)
  • use perlbrew to update perl to 5.26.1 (I tried to fix "perl version 5.16.0 can't run /usr/bin/shasum")
  • tried building openssl-1.1.1-pre2 from source ("recipe for target 'libcrypto.dylib' failed")

My most recent attempt to install from scratch:

==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown taa /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Homebrew /usr/local/Frameworks /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /bin/mkdir -p /Users/taa/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/taa/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown taa /Users/taa/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown taa /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/bin/chgrp admin /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 98437, done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 98437 (delta 3), reused 7 (delta 2), pack-reused 98413
Receiving objects: 100% (98437/98437), 22.54 MiB | 6.95 MiB/s, done.
Resolving deltas: 100% (71554/71554), done.
From https://github.com/Homebrew/brew
 * [new branch]          master     -> origin/master
 * [new tag]             0.1        -> 0.1
 * [new tag]             0.2        -> 0.2
 * [new tag]             0.3        -> 0.3
 * [new tag]             0.4        -> 0.4
 * [new tag]             0.5        -> 0.5
 * [new tag]             0.6        -> 0.6
 * [new tag]             0.7        -> 0.7
 * [new tag]             0.7.1      -> 0.7.1
 * [new tag]             0.8        -> 0.8
 * [new tag]             0.8.1      -> 0.8.1
 * [new tag]             0.9        -> 0.9
 * [new tag]             0.9.1      -> 0.9.1
 * [new tag]             0.9.2      -> 0.9.2
 * [new tag]             0.9.3      -> 0.9.3
 * [new tag]             0.9.4      -> 0.9.4
 * [new tag]             0.9.5      -> 0.9.5
 * [new tag]             0.9.8      -> 0.9.8
 * [new tag]             0.9.9      -> 0.9.9
 * [new tag]             1.0.0      -> 1.0.0
 * [new tag]             1.0.1      -> 1.0.1
 * [new tag]             1.0.2      -> 1.0.2
 * [new tag]             1.0.3      -> 1.0.3
 * [new tag]             1.0.4      -> 1.0.4
 * [new tag]             1.0.5      -> 1.0.5
 * [new tag]             1.0.6      -> 1.0.6
 * [new tag]             1.0.7      -> 1.0.7
 * [new tag]             1.0.8      -> 1.0.8
 * [new tag]             1.0.9      -> 1.0.9
 * [new tag]             1.1.0      -> 1.1.0
 * [new tag]             1.1.1      -> 1.1.1
 * [new tag]             1.1.10     -> 1.1.10
 * [new tag]             1.1.11     -> 1.1.11
 * [new tag]             1.1.12     -> 1.1.12
 * [new tag]             1.1.13     -> 1.1.13
 * [new tag]             1.1.2      -> 1.1.2
 * [new tag]             1.1.3      -> 1.1.3
 * [new tag]             1.1.4      -> 1.1.4
 * [new tag]             1.1.5      -> 1.1.5
 * [new tag]             1.1.6      -> 1.1.6
 * [new tag]             1.1.7      -> 1.1.7
 * [new tag]             1.1.8      -> 1.1.8
 * [new tag]             1.1.9      -> 1.1.9
 * [new tag]             1.2.0      -> 1.2.0
 * [new tag]             1.2.1      -> 1.2.1
 * [new tag]             1.2.2      -> 1.2.2
 * [new tag]             1.2.3      -> 1.2.3
 * [new tag]             1.2.4      -> 1.2.4
 * [new tag]             1.2.5      -> 1.2.5
 * [new tag]             1.2.6      -> 1.2.6
 * [new tag]             1.3.0      -> 1.3.0
 * [new tag]             1.3.1      -> 1.3.1
 * [new tag]             1.3.2      -> 1.3.2
 * [new tag]             1.3.3      -> 1.3.3
 * [new tag]             1.3.4      -> 1.3.4
 * [new tag]             1.3.5      -> 1.3.5
 * [new tag]             1.3.6      -> 1.3.6
 * [new tag]             1.3.7      -> 1.3.7
 * [new tag]             1.3.8      -> 1.3.8
 * [new tag]             1.3.9      -> 1.3.9
 * [new tag]             1.4.0      -> 1.4.0
 * [new tag]             1.4.1      -> 1.4.1
 * [new tag]             1.4.2      -> 1.4.2
 * [new tag]             1.4.3      -> 1.4.3
 * [new tag]             1.5.0      -> 1.5.0
 * [new tag]             1.5.1      -> 1.5.1
 * [new tag]             1.5.10     -> 1.5.10
 * [new tag]             1.5.11     -> 1.5.11
 * [new tag]             1.5.2      -> 1.5.2
 * [new tag]             1.5.3      -> 1.5.3
 * [new tag]             1.5.4      -> 1.5.4
 * [new tag]             1.5.5      -> 1.5.5
 * [new tag]             1.5.6      -> 1.5.6
 * [new tag]             1.5.7      -> 1.5.7
 * [new tag]             1.5.8      -> 1.5.8
 * [new tag]             1.5.9      -> 1.5.9
HEAD is now at 058dad61b Merge pull request #3948 from MikeMcQuaid/audit-run
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
################################################################################################################# 100.0%
perl version 5.26.1 can't run /usr/bin/shasum.  Try the alternative(s):

(Error: no alternatives found)

Run "man perl" for more information about multiple version support in
Mac OS X.
Error: Checksum mismatch.
Expected: 34ce9e4c9c1be28db564d744165aa29291426f8a3d2ef806ba4f0b9175aedb2b
Actual: 
Archive: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install vendor Ruby.
error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/Homebrew/brew/info/refs?service=git-upload-pack
fatal: HTTP request failed
Error: Fetching /usr/local/Homebrew failed!
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Already downloaded: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
perl version 5.26.1 can't run /usr/bin/shasum.  Try the alternative(s):

(Error: no alternatives found)

Run "man perl" for more information about multiple version support in
Mac OS X.
Error: Checksum mismatch.
Expected: 34ce9e4c9c1be28db564d744165aa29291426f8a3d2ef806ba4f0b9175aedb2b
Actual: 
Archive: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install vendor Ruby.
Failed during: /usr/local/bin/brew update --force

The errors above suggest deleting /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz but this made no difference.

If I now try @sjackman's suggestion:

~ taa$ git clone --depth=1 https://github.com/Homebrew/brew /usr/local/Homebrew
fatal: destination path '/usr/local/Homebrew' already exists and is not an empty directory.
~ taa$ rm -fr /usr/local/Homebrew
~ taa$ git clone --depth=1 https://github.com/Homebrew/brew /usr/local/Homebrew
Cloning into '/usr/local/Homebrew'...
remote: Counting objects: 1166, done.
remote: Compressing objects: 100% (1069/1069), done.
remote: Total 1166 (delta 118), reused 394 (delta 57), pack-reused 0
Receiving objects: 100% (1166/1166), 1.23 MiB | 7.31 MiB/s, done.
Resolving deltas: 100% (118/118), done.
~ taa$ ln -s ../Homebrew/bin/brew /usr/local/bin/
ln: /usr/local/bin//brew: File exists
~ taa$ rm -fr /usr/local/bin/brew
~ taa$ ln -s ../Homebrew/bin/brew /usr/local/bin/
~ taa$ export HOMEBREW_FORCE_BREWED_CURL=1
~ taa$ brew update
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Already downloaded: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
perl version 5.26.1 can't run /usr/bin/shasum.  Try the alternative(s):

(Error: no alternatives found)

Run "man perl" for more information about multiple version support in
Mac OS X.
Error: Checksum mismatch.
Expected: 34ce9e4c9c1be28db564d744165aa29291426f8a3d2ef806ba4f0b9175aedb2b
Actual: 
Archive: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install vendor Ruby.
error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/Homebrew/brew/info/refs?service=git-upload-pack
fatal: HTTP request failed
Error: Fetching /usr/local/Homebrew failed!
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Already downloaded: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
perl version 5.26.1 can't run /usr/bin/shasum.  Try the alternative(s):

(Error: no alternatives found)

Run "man perl" for more information about multiple version support in
Mac OS X.
Error: Checksum mismatch.
Expected: 34ce9e4c9c1be28db564d744165aa29291426f8a3d2ef806ba4f0b9175aedb2b
Actual: 
Archive: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install vendor Ruby.
~ taa$ 

I don't know enough about git to even formulate a solution for consideration as a PR.

So... trying to install Homebrew on Mac OS X 10.7 fails in a very spectacular way ever since Weak cryptographic standards removed | The GitHub Blog.

@UNIVAC-Colonel-Panic
Copy link

You need to use git:// protocol.

@ilovezfs, I don't know what you mean.

@sjackman
Copy link
Member

You likely won't be able to use the usual install script. Try instead…

git clone --depth=1 git://github.com/Homebrew/brew /usr/local/Homebrew
ln -s ../Homebrew/bin/brew /usr/local/bin/
export HOMEBREW_FORCE_BREWED_CURL=1
brew update

@ilovezfs
Copy link
Contributor

You also need to clone Homebrew/homebrew-core with git://

@sjackman
Copy link
Member

sjackman commented Mar 19, 2018

git clone --depth=1 git://github.com/Homebrew/brew /usr/local/Homebrew
git clone --depth=1 git://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
ln -s ../Homebrew/bin/brew /usr/local/bin/
export HOMEBREW_FORCE_BREWED_CURL=1
brew update

@UNIVAC-Colonel-Panic
Copy link

I'm making progress... I think... no SSL errors this time....

~ taa$ git clone --depth=1 git://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4692, done.
remote: Compressing objects: 100% (4458/4458), done.
remote: Total 4692 (delta 49), reused 4689 (delta 49), pack-reused 0
Receiving objects: 100% (4692/4692), 3.82 MiB | 6.79 MiB/s, done.
Resolving deltas: 100% (49/49), done.
Checking out files: 100% (4710/4710), done.

~ taa$ ln -s ../Homebrew/bin/brew /usr/local/bin/
ln: /usr/local/bin//brew: File exists

~ taa$ rm -fr /usr/local/bin/brew

~ taa$ ln -s ../Homebrew/bin/brew /usr/local/bin/

~ taa$ export HOMEBREW_FORCE_BREWED_CURL=1

~ taa$ brew update
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Already downloaded: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
perl version 5.26.1 can't run /usr/bin/shasum.  Try the alternative(s):

(Error: no alternatives found)

Run "man perl" for more information about multiple version support in
Mac OS X.
Error: Checksum mismatch.
Expected: 34ce9e4c9c1be28db564d744165aa29291426f8a3d2ef806ba4f0b9175aedb2b
Actual: 
Archive: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install vendor Ruby.
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
Already downloaded: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
perl version 5.26.1 can't run /usr/bin/shasum.  Try the alternative(s):

(Error: no alternatives found)

Run "man perl" for more information about multiple version support in
Mac OS X.
Error: Checksum mismatch.
Expected: 34ce9e4c9c1be28db564d744165aa29291426f8a3d2ef806ba4f0b9175aedb2b
Actual: 
Archive: /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install vendor Ruby.
Already up-to-date.

How do I fix the can't run /usr/bin/shasum error?

@sjackman
Copy link
Member

sjackman commented Mar 20, 2018

How do I fix the can't run /usr/bin/shasum error?

I'm afraid I don't know the answer to that question.
Perhaps @mistydemeo may know?

@UNIVAC-Colonel-Panic
Copy link

I decided to create a virtual machine with a fresh install of Lion 10.7.5, XCode 4.6.3 and its command line tools. This means it is a clean slate with the Apple-provided git 1.7.12.4 (Apple Git-37), perl 5.12.3, and curl 7.21.4.

Results are here, scroll down to the highlighted lines starting at line 79: https://pastebin.com/hK5Ugm00

TL;DR: curl SSL errors accessing:

Does this mean export HOMEBREW_FORCE_BREWED_CURL=1 isn't working?

@sjackman
Copy link
Member

sjackman commented Mar 24, 2018

It looks as though the http mirror is being redirected to https:

==> Installing curl
==> Downloading https://curl.haxx.se/download/curl-7.59.0.tar.bz2
 
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Trying a mirror...
==> Downloading http://curl.askapache.com/download/curl-7.59.0.tar.bz2
==> Downloading from https://curl.askapache.com/curl-7.59.0.tar.bz2
 
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
Error: Failed to download resource "curl"
Download failed: http://curl.askapache.com/download/curl-7.59.0.tar.bz2

We need to change the curl http mirror to a real http download.

As a workaround, you can download this file by some other method, and place it at the location indicated by…

❯❯❯ brew --cache -s curl
~/Library/Caches/Homebrew/curl-7.59.0.tar.bz2

@ilovezfs
Copy link
Contributor

Looks like http://curl.mirror.anstey.ca/curl-7.59.0.tar.bz2 is not redirecting

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants