git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Reducing git size by building libgit.so

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 12, 2019, 23:31 UTC
Message-ID
<20190612233142.GC8616@genre.crustytoothpaste.net>
In-Reply-To
<9c488ce8c1e1e6d6d4c343b0b40c8a64c8147a7f.camel@mad-scientist.net>
On 2019-06-12 at 13:57:43, Paul Smith wrote:
Show 17 quoted lines
> On Tue, 2019-06-11 at 23:48 +0000, brian m. carlson wrote:
> > Also, some people install Git into their home directories, and a
> > shared library means that they'll have to use LD_LIBRARY_PATH (or
> > equivalent) to run Git.
> 
> I don't have strong feeling about .so's although obviously less disk
> space used is always a good thing, everything else being equal.
> 
> However, the above concern isn't actually an issue.  You can install
> the .so in a known location relative to the binaries, then link the
> binaries with an RPATH setting using $ORIGIN (or the equivalent on
> MacOS which does exist but I forget the name).  On Windows, DLLs are
> installed in the same directory as the binary, typically.
> 
> Allowing relocatable binaries with .so dependencies without requiring
> LD_LIBRARY_PATH settings is a solved problem, to the best of my
> understanding.

This is possible to do, but it's not especially portable. People use various C toolchains to compile our code, which may or may not have easy access to linker flags. The proper syntax also varies depending on whether you're using ELF, Mach-O, PE[0], or another object format. And Debian tries hard to avoid RPATH settings[1], so we'd need to be sure to have an option not to set it.

None of these are intractable problems, but there's not simply an easy solution that we can magically set that will work everywhere. If we were using autoconf and friends exclusively, this would be easier, but we're not. So someone is welcome to attack these problems with a set of patches, but I expect it to be fairly involved to get all the corner cases right if we want to make it the default.

[0] AFAIUI, Windows doesn't have RPATH-like functionality, and from what I've read, the same-directory behavior may be going away due to security concerns. I don't use Windows, so any solution there is fine as long as Dscho is happy. [1] https://wiki.debian.org/RpathIssue

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Junio C HamanoNext: Johannes Sixt
Message 8 of 12 in “Reducing git size by building libgit.so”
  1. Elmar PruesseJun 11, 2019
  2. brian m. carlsonJun 11, 2019
  3. Duy NguyenJun 12, 2019
  4. Paul SmithJun 12, 2019
  5. Johannes SchindelinJun 13, 2019
  6. Paul SmithJun 13, 2019
  7. Junio C HamanoJun 13, 2019
  8. brian m. carlsonJun 12, 2019
  9. Johannes SixtJun 13, 2019
  10. Ævar Arnfjörð BjarmasonJun 12, 2019
  11. Duy NguyenJun 12, 2019
  12. SZEDER GáborJun 12, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.