Closed joseph-long closed 5 years ago
Unfortunately, I use Linuxbrew to try and save myself from the outdated software on my University's HPC cluster... they won't let me upgrade them to a newer CentOS 🙃
I created Linuxbrew for this reason, so you're in good company.
Try these (untested) alternative alternative (alternative²) installation instructions using curl
rather than git
to install Homebrew:
mkdir -p /home/linuxbrew/.linuxbrew/bin
curl -L https://github.com/Homebrew/brew/archive/2.1.6.tar.gz | tar zx -C /home/linuxbrew/.linuxbrew/Homebrew
ln -s ../Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
A couple of options to try to use your local ~/.local/bin/git
executable. First, try export HOMEBREW_NO_ENV_FILTERING=1
to use your PATH
rather than the default /usr/bin:/bin
.
Second, you can export HOMEBREW_DEVELOPER=1 HOMEBREW_GIT_PATH=$HOME/.local/bin/git
.
Once you get it working, I'd be most happy to review a PR that makes the installation smoother on older distributions. Here's a wiki with installation instructions on for CentOS 6. Feel free to edit it: https://github.com/Linuxbrew/brew/wiki/CentOS6
export HOMEBREW_NO_ENV_FILTERING=1
might have done the trick! I'm certainly getting further along with brew update
.
I tried the curl
instructions just to see if they worked (since that would be easier to document than building one's own git
), but unfortunately brew update
starts by converting the checkout to a shallow clone. I tried brew install git
but it just installs portable ruby and then it too tries to convert the checkout to a git repo.
Written up at https://joseph-long.com/writing/linuxbrew-with-ancient-git/ for posterity, as the wiki page you linked is archived. If there's another good place to put it, I can copy it over!
Nice write up! I've tweeted your article here: https://twitter.com/linuxbrew/status/1146457021174054918 Are you on Twitter? I couldn't find your handle. Get thee on Twitter! If only so other Science tweeps can tag you in posts.
Cutting edge research, eight year old operating systems. Go figure.
😂 This issue still mystifies me. Dealing with a ten year old operating system consumes so much time. It's absolutely insane. Docker and Singularity should help a lot. My site won't use Docker because of security concerns, but they're excited about Singularity.
an enterprising graduate student
That's me! Also, I graduated last month! I have a photo of me wearing a silly hat to prove it. 🎓 Would you mind linking to my web site? https://sjackman.ca
the wiki page you linked is archived
Hmm. Yes, I forgot about that. Do you have the time and inclination to submit a PR to improve the installation of Homebrew on older distributions? This would largely amount to detecting when git
is too old, and either failing with a (hopefully helpful) error message, or better, taking an alternative installation route by default. If so, I'm happy to point you to the right section of code to get started hacking.
If so, I'm happy to point you to the right section of code to get started hacking.
Here's some of the relevant code:
https://github.com/Homebrew/brew/blob/895467ad9f57a9245c36def26abca729f2559fbb/Library/Homebrew/brew.sh#L114-L128 https://github.com/Homebrew/brew/blob/895467ad9f57a9245c36def26abca729f2559fbb/Library/Homebrew/brew.sh#L151-L159 https://github.com/Homebrew/brew/blob/895467ad9f57a9245c36def26abca729f2559fbb/Library/Homebrew/brew.sh#L161-L168
It seems some of this should be happening already.
In the command output above, you can see brew following the "force brewed git" (and curl) path, but other parts of Homebrew are supplying arguments to git that are too new, and the attempt to install its own git
fails.
I'm not sure if I should go through and make those invocations of git
backwards compatible all the way back to 1.7.1... ideally there'd be a "portable git" like the portable ruby homebrew installs, but that may be more effort than it's worth for such an old system.
It's only really brew update
and some git config
stuff that requires git
. Much of that can be deferred until we have a working version of brewed git
installed. The fix as I see it would be to detect when the system version of git
is missing or too old (when HOMEBREW_FORCE_BREWED_CURL
is set), and if the brewed git
is not yet installed, skip running git
. For example, don't auto-update until the brewed git
is installed. Does that make sense?
brew
command and reproduced the problem with multiple formulae? If it's a problem with a single, official formula (not cask) please file this issue at Homebrew/homebrew-core: https://github.com/Homebrew/homebrew-core/issues/new/choose. If it's abrew cask
problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
brew update
a new install of LinuxBrew to/extra/josephlong/.linuxbrew
.What happened (include command output)
Despite the existence of a newer
git
on$PATH
:Homebrew appears to use system
git
, which is much older:which results in the following errors:
Command output
What you expected to happen
I expected
brew update
to complete without errors.Step-by-step reproduction instructions (by running
brew
commands)brew doctor
brew config