[Bug] Trying to install Git
3f6a opened this issue · 9 comments
What were you trying to install (or what else went wrong)?
git
What exactly did you do?
curl -sS https://webi.sh/git | sh
What went wrong?
I get a message saying:
'git' already installed
But yeah, I know it's already installed, it's just a very old version. I wanted webi
to install a newer version for me so that I could use it.
So the point of this ticket is: Can we get webi
to install the new version of git
, taking precedence over the old one installed by default on the system?
Which OS did you try on?
- Mac
- Windows
- Linux
More pspecifically, Ubuntu 20.04.6.
What type of computer (i.e. laptop, desktop, Raspberry Pi)?
- Laptop or Desktop (amd64 / x86-64)
- Raspberry Pi (ARM-64)
- Other (please specify, if you know)
git
doesn't have standalone releases for each platform.
Generally speaking we don't offer 3rd party builds. If the author doesn't provide the build, it's out of our hands.
I'm going to close this out. However, if you know a good way for us to get official builds of git for Linux, please reopen. I'd love to have it if the authors will make it available.
I just checked and they still don't offer builds for Mac or Linux:
https://git-scm.com/download/linux
Only Windows has official builds.
On Mac the webi installer runs xcode-select --install
.
On Linux it will run ask for permission and then run apk add git
or apt install -y git
.
Ah I thought webi
could build from source in such a case?
Building from C source is a bespoke process for every project. There is no uniform set of tools or processes.
Your best option would be to install brew via webi (so that it's installed conflict-free in your user directory) and the brew install git.
brew works on Linux too these days.
I would consider breaking the "official 1st party builds only" rule for git since there are no official builds, but that would be a git mirror with releases.
I don't think I would ever want Webi to build C-family projects from source - it's just too complicated and requires too much maintenance and troubleshooting.
How about relying on these: https://github.com/JuliaBinaryWrappers/Git_jll.jl/releases. They provide binaries for various platforms, e.g. https://github.com/JuliaBinaryWrappers/Git_jll.jl/releases/download/Git-v2.44.0%2B2/Git.v2.44.0.x86_64-linux-gnu.tar.gz.
This is part of Yggdrasil, a project that aims to produce reliable and reproducible builds of many common binary dependencies used in Julia.
I really like the idea, but due to the reality of supply-chain vulnerabilities from rogue sleeper agents (npm, xz
, etc), I wouldn't use those binaries.
Perhaps I could find their build scripts and run them myself.
I would probably host the releases on github.com/webinstall/git-mirror or some such.
If you would get me a simple set of steps for how to do cross-platform builds, I'll put up a mirror and host them.
For example:
webi julia
source ~/.config/envman/PATH.env
git clone https://github.com/JuliaPackaging/Yggdrasil.git
pushd ./Yggdrasil/
julia --do-stuff --cross-platform --build=git
# see releases
ls ./builds/git/git-v2.4.4-*
Or better yet, extracting and transforming the bash script here to work on macOS to cross-compile with llvm:
- https://github.com/JuliaPackaging/Yggdrasil/blob/master/G/Git/build_tarballs.jl
(I only peeked at it, that may be very simple)
I'm not sure how trivial is it to extract the bash script from the build_tarbajlls.jl
file. The problem is that that's depending on other _jll
build recipes in Yggdrasil, so you'd have to get those too and so on.
So maybe the easiest is to just use Julia. After you have Julia installed,
julia --eval 'import Pkg; Pkg.add("Git_jll")' # installs Git_jll for the OS running this script
julia --eval 'import Git_jll; println(Git_jll.git_path)' # print the path to the compiled git executable
That gets you the git binary for the OS where you run this script. If you want another binary, I think you have to run it from a different machine.
The compiled git
binary also depends on some libraries that I'm not sure you'll be able to find. Just in case, you can inspect this:
julia --eval 'import Git_jll; println(Git_jll.git())'
which prints all the relevant environment variables that need to be set.
Hi, any updates on this?
Your best option would be to install brew via webi (so that it's installed conflict-free in your user directory) and the brew install git.
I tried doing this, but ...
Updating brew...
Error: Please update your system curl or set HOMEBREW_CURL_PATH to a newer version.
Minimum required version: 7.41.0
Your curl version: 7.29.0
Your curl executable:
Error: Please update your system Git or set HOMEBREW_GIT_PATH to a newer version.
Minimum required version: 2.7.0
Your Git version: 1.8.3.1
So homebrew wants a newer version of git, which seems a chicken and egg problem!
Then at the end it failed with this:
##################################################### 73.7%
curl: (18) transfer closed with 24780997 bytes remaining to read
Error: curl: Failed to download resource "binutils"
Download failed: https://ghcr.io/v2/homebrew/core/binutils/blobs/sha256:1b498d741c952477f46dc6a2f46f91ace4e65579c56c419188f25e3e792d959a
Error: 'curl' must be installed and in your PATH!
Not sure if that's a connection problem, or there was a failure because it didn't find curl
?