Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samba: reduce bloat by linking dynamically #110

Closed
edolstra opened this issue Aug 17, 2012 · 7 comments
Closed

Samba: reduce bloat by linking dynamically #110

edolstra opened this issue Aug 17, 2012 · 7 comments

Comments

@edolstra
Copy link
Member

edolstra commented Aug 17, 2012

Samba is insanely bloated:

$ nix-build -A samba
/nix/store/i8qvmdq9b3q38ma8w0y04jzgf32xavd2-samba-3.6.7

$ du -sch ./result/
110M    ./result/

$ ls -l ./result/bin/
total 72872
-r-xr-xr-x 1 root nixbld 1862096 Dec 31  1969 eventlogadm
-r-xr-xr-x 1 root nixbld    4641 Dec 31  1969 findsmb
-r-xr-xr-x 1 root nixbld 8219864 Dec 31  1969 net
-r-xr-xr-x 1 root nixbld 1593640 Dec 31  1969 nmblookup
-r-xr-xr-x 1 root nixbld 3070992 Dec 31  1969 ntlm_auth
-r-xr-xr-x 1 root nixbld 2024040 Dec 31  1969 pdbedit
...

The main reason seems to be that the binaries in bin and sbin are statically linked against libsmbclient and libnetapi, even though we build dynamic versions of those.

The Samba source code says:

# WORKAROUND:
#   until we have organized other internal subsystems (as util, registry
#   and smbconf) into shared libraries, we CAN NOT link libnetapi
#   dynamically to samba programs.
#
LINK_LIBNETAPI=STATIC

LINK_LIBSMBCLIENT=STATIC

so it's not clear if dynamic linking is currently safe. However, https://bugs.archlinux.org/task/24678 suggests that using Samba's alternative "waf"-based build system does the right thing. So maybe we should investigate that.

edolstra pushed a commit to edolstra/nixpkgs that referenced this issue Oct 1, 2013
@shlevy
Copy link
Member

shlevy commented Apr 4, 2014

@edolstra Have you had a chance to look into this yet? Do you plan to get it in before 14.04?

@vcunat
Copy link
Member

vcunat commented Mar 14, 2015

@wkennington: any ideas about this issue? I see the size of samba is ~72MB currently, and we also have samba_light with ~113MB size (and less dependencies). I suspect that not supplying some dependencies forces samba to pack more stuff in, so it isn't really clear which is lighter (perhaps depending on other installed packages).

@wkennington
Copy link
Contributor

Yeah, exactly. Light is just nicer in the sense that you have far fewer
dependencies.
On Mar 14, 2015 6:17 AM, "Vladimír Čunát" notifications@github.com wrote:

@wkennington https://github.com/wkennington: any ideas about this
issue? I see the size of samba is ~72MB currently, and we also have
samba_light with ~113MB size (and less dependencies). I suspect that not
supplying some dependencies forces samba to pack more stuff in, so it isn't
really clear which is lighter (perhaps depending on other installed
packages).


Reply to this email directly or view it on GitHub
#110 (comment).

@domenkozar
Copy link
Member

$  du -sch $(nix-store -qR $(nix-build -A samba_light))
...
162M    /nix/store/kml4z8cdrqjdbibzzil1wzzj5vl34r2l-samba-4.2.0
447M    total

$ du -sch $(nix-store -qR $(nix-build -A samba))
...
159M    /nix/store/wykzvg6bn0mip4dir7qzpfkm56a4ikgp-samba-4.2.0
841M    total

nckx added a commit that referenced this issue May 30, 2015
Hotfix, solving issues with lz4cat.

- Fixed: incompatibility sparse mode vs console (#105)
- Fixed: LZ4IO exits too early when frame crc not present (#106)
- Fixed: incompatibility sparse mode vs append mode (#110)
- Performance fix: big compression speed boost for clang (+30%)
- New: cross-version test
@7c6f434c
Copy link
Member

Samba is now 52MiB and the entire closure is 225MiB, of which 90MiB come from Python and Perl. Should this issue be closed?

@vcunat
Copy link
Member

vcunat commented Feb 16, 2017

I do think so. Also ./result/bin/* sizes look sane now.

@vcunat vcunat closed this as completed Feb 16, 2017
@vcunat
Copy link
Member

vcunat commented Feb 16, 2017

It might still be possible to improve. I suspect many reverse dependencies use mainly the libraries, so the ~13 MB in bin/ might be nice to split, for example (half of it is due to smbtorture, too :).

Profpatsch pushed a commit that referenced this issue Jun 20, 2020
dell/xps/13-9380: also import intel profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants