kart
kart copied to clipboard
Packaged libraries could be reduced in size and shipped as symlinks.
Describe the bug Linux packaging ends up with multiple copies of libraries rather than symlink'ed versioned names - both .deb and .rpm
eg.
ubuntu@kart-test:~$ dpkg -c kart_0.11.4.dev0+ci.4036.git3ccf2d39-1_amd64.deb | grep libgdal
-rwxr-xr-x 0/0 101561856 2022-08-08 10:14 ./opt/kart/libgdal.so.30
-rwxr-xr-x 0/0 101561856 2022-08-08 10:14 ./opt/kart/libgdal.so
-rwxr-xr-x 0/0 101561856 2022-08-08 10:14 ./opt/kart/libgdal.so.30.0.0
These libraries could also be strip'ed which drastically reduces the size of the distribution
ubuntu@kart-test:/opt/kart$ ls -lasi libgdal.so*
1548496 8720 -rwxr-xr-x 1 root root 9588272 Aug 8 11:17 libgdal.so
1548604 8720 -rwxr-xr-x 1 root root 9588272 Aug 8 11:17 libgdal.so.30
1548569 8720 -rwxr-xr-x 1 root root 9588272 Aug 8 11:17 libgdal.so.30.0.0
In the end, if fpm cooperates we could store a single 9.5mb file and 2 symlinks rather than 3 100mb files.
To Reproduce Normal build process
vendor-Linux.tar.gz contains libraries symlink'ed so somewhere post that process they get converted into files.
ubuntu@kart-build:~/kart$ tar tzvf vendor/dist/vendor-Linux.tar.gz | grep libgdal
-rwxr-xr-x root/root 101561856 2022-06-26 14:27 env/lib/libgdal.so.30.0.0
lrwxrwxrwx root/root 0 2022-06-26 14:21 env/lib/libgdal.so.30 -> libgdal.so.30.0.0
lrwxrwxrwx root/root 0 2022-06-26 14:21 env/lib/libgdal.so -> libgdal.so.30.0.0
this is mostly a dupe of #641 but this one's better informed so I'll close that one instead
MacOS .pkg has the same issue with files rather than symlinks but the libraries look to be stripped so much smaller.
Pyinstaller is doing the copy after it does a resolve of all required libraries - it doesn't take into account it being a symlink, just the name.
A potential resolution is to remove the symlinks in the vendor-*.tar.gz as the 'real' file is the fulling versioned one which is used in the symbol linking but need to check if the build pkg is correctly signed.
Experimental fix in https://github.com/koordinates/kart/tree/slim-packages
Fix in v0.11.5