Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Building Git

The shim turns on fsmonitor only for a real git of 2.55 or newer. drawbar build-git builds one from the official source tarball into ~/.local/opt/git-<version>, where the shim looks for real git before it falls back to the system one:

$ drawbar build-git
drawbar: built /home/acme/.local/opt/git-2.56.1
OptionDefaultMeaning
--version <v>2.56.1Download git-<v>.tar.xz from kernel.org and build it.
--tarball <path>Build a local git-<v>.tar.xz or git-<v>.tar.gz instead. The version comes from the file name.
--sha256 <digest>pinnedThe tarball’s expected SHA-256. Required for a version drawbar has no pinned digest for.
-j, --jobs <n>4The make -j job count.
--min-free-ram <size>4GRefuse to start when /proc/meminfo shows less available memory than this. Sizes take K, M, G or T. 0 skips the check.

drawbar pins the SHA-256 of the Git 2.56.0 and 2.56.1 tarballs from kernel.org’s signed sha256sums.asc, copies the tarball into a scratch directory, hashes the copy, and unpacks that same copy only when the digest matches. make builds with NO_TCLTK and NO_GETTEXT set, so the build needs a C compiler and the zlib, OpenSSL and libcurl headers, and neither Tcl nor msgfmt. make install writes to a staging directory first, and drawbar moves the result into place only when libexec/git-core holds git-remote-https and git-fsmonitor--daemon, so a git that cannot fetch over HTTPS never lands where the shim would pick it up. A host without the libcurl headers stops earlier, in make, with the compiler’s error.

It refuses to overwrite an existing ~/.local/opt/git-<version>, so remove that directory to rebuild, and DRAWBAR_MAKE names a make program other than make. It exits 0 when Git was built and installed, 1 when the build was refused or failed, and 2 for a bad argument, and every refusal prints one drawbar: line. See ADR 0007.