FS#62589 - [git] Use "INSTALL_SYMLINKS=1" in "_make_options"

Attached to Project: Arch Linux
Opened by Michel Koss (MichelKoss1) - Friday, 10 May 2019, 13:47 GMT
Last edited by Christian Hesse (eworm) - Tuesday, 13 August 2019, 19:20 GMT
Task Type General Gripe
Category Packages: Extra
Status Closed
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

Using "INSTALL_SYMLINKS=1" in "_make_options" variable will switch all duplicate git binaries into symlinks which should save some additional space (currently they are hardlinks). At the same time "NO_CROSS_DIRECTORY_HARDLINKS=1" option could be removed.

Other distros like Fredora already use that option[1]

[1] https://src.fedoraproject.org/rpms/git/blob/e17874a9b14b10561d16cbb7ad1fa4311e8abafe/f/git.spec#_479
This task depends upon

Closed by  Christian Hesse (eworm)
Tuesday, 13 August 2019, 19:20 GMT
Reason for closing:  Implemented
Additional comments about closing:  in SVN
Comment by Doug Newgard (Scimmia) - Friday, 10 May 2019, 13:56 GMT
If they're hardlinks, it doesn't matter and won't save any space.
Comment by Michel Koss (MichelKoss1) - Friday, 10 May 2019, 14:09 GMT
@Scimmia my testing shows it will save some. Perhaps not all of them are hardlinks. Anyway using symlinks is more obvious.
Comment by Michel Koss (MichelKoss1) - Friday, 10 May 2019, 14:35 GMT
Official Arch package:
git-2.21.0-1-x86_64.pkg.tar.xz: 5.7M
unpacked (du -sh): 40M

After changing "NO_CROSS_DIRECTORY_HARDLINKS=1" to "INSTALL_SYMLINKS=1":
git-2.21.0-1-x86_64.pkg.tar.xz: 5.6M
unpacked (du -sh): 35M

12.5% improvement is still something.
Comment by Felipe Contreras (felipec) - Friday, 07 June 2019, 14:51 GMT
If I install git without any option the directory weights 167M, if I use INSTALL_SYMLINKS=1, it also weights 167M. The problem is NO_CROSS_DIRECTORY_HARDLINKS=1, which results in a size of 196M, so yeah (17% bigger).

So for example `libexec/git-core/git-add` and `bin/git` should be the same file, but since they are in different directories; they are not.

Just remove NO_CROSS_DIRECTORY_HARDLINKS=1.
Comment by Michel Koss (MichelKoss1) - Saturday, 08 June 2019, 10:33 GMT
The reason for using NO_CROSS_DIRECTORY_HARDLINKS=1 is weird case when /usr/lib and /usr/bin are on different partitions and hardlinks won't work there.

Symlinks doesn't have such issues. That's why using symlinks is no-brainer.
Comment by Michel Koss (MichelKoss1) - Sunday, 14 July 2019, 20:39 GMT
Also if you build from arch-chroot in tmpfs and install git then hardlinks don't work - it will use over 300MB of space.

Really, there is no excuse for using hardlinks over symlinks.

Loading...