lucagrulla / cw

The best way to tail AWS CloudWatch Logs from your terminal
https://www.lucagrulla.com/cw
Apache License 2.0
792 stars 59 forks source link

Why does the deb package depend on git? #256

Open iainelder opened 1 year ago

iainelder commented 1 year ago

Describe the bug

$ apt depends cw-tail
cw-tail
  Depends: git
    git:i386
  Replaces: cw (<< 3.3.0)

In an Ubuntu 20 container it installs about 105MB of stuff when the executable itself is only about 9MB.

$ ls -lh "$(which cw)"
-rwxr-xr-x 1 root root 9.3M Apr 21 19:56 /usr/bin/cw

Copied from my CI install log.

+ sudo apt-get install --yes ./cw_amd64.deb
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  git git-man less libbsd0 libcbor0.6 libcurl3-gnutls libedit2 liberror-perl
  libexpat1 libfido2-1 libgdbm-compat4 libgdbm6 libperl5.30 libx11-6
  libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 netbase
  openssh-client patch perl perl-modules-5.30 xauth
Suggested packages:
  gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-el git-email
  git-gui gitk gitweb git-cvs git-mediawiki git-svn gdbm-l10n keychain
  libpam-ssh monkeysphere ssh-askpass ed diffutils-doc perl-doc
  libterm-readline-gnu-perl | libterm-readline-perl-perl make libb-debug-perl
  liblocale-codes-perl
The following NEW packages will be installed:
  cw-tail git git-man less libbsd0 libcbor0.6 libcurl3-gnutls libedit2
  liberror-perl libexpat1 libfido2-1 libgdbm-compat4 libgdbm6 libperl5.30
  libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 netbase
  openssh-client patch perl perl-modules-5.30 xauth
0 upgraded, 27 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.7 MB/18.5 MB of archives.
After this operation, 105 MB of additional disk space will be used.

Expected behavior

One of the features is "No external dependencies", so I was surprised to see git as a dependency.

Desktop (please complete the following information):

lucagrulla commented 1 year ago

Thanks for finding this out!

I've had a look, and it's probably just an oversight in the package creation. I have time over the coming weeks to confirm this hypothesis and eventually release a slimmer package.

iainelder commented 1 year ago

Thanks for checking.

I'm not familiar with GoReleaser, but I think I found where this dependency is configured:

https://github.com/lucagrulla/cw/blob/a578b3bdfed4d06b482536e513e57dcca774bb15/.goreleaser.yml#L101-L102

Would the fix be as simple as removing these two lines?

lucagrulla commented 1 year ago

Yep, That's the line.

It should be as simple as deleting the deps block, but I will check it to be sure.

lucagrulla commented 1 year ago

Test done: removed the git dependency (and tested on a Debian), but the .deb package size is the same. 🤔🤷🏻‍♂️

The dependency is unnecessary and I'll remove it. For a smaller package, I need to dig deeper.

lucagrulla commented 1 year ago

Ignore my second comment: The ~10MB of the executable is correct (as you highlighted).

I will remove the unnecessary git dep, and from the next release, the package will contain only what is required.

iainelder commented 1 year ago

Thanks for checking it!

Where I expect to see a difference is in apt's installation confirmation.

Instead of:

0 upgraded, 27 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.7 MB/18.5 MB of archives.
After this operation, 105 MB of additional disk space will be used.

I'd expect something like this (??? means I don't know what to expect there!):

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get ??? of archives.
After this operation, 10 MB of additional disk space will be used.

I'll try again when you make the next release to confirm it.