Bug #104402 Minimal Linux binaries for 8.0.26 are not minimal
Submitted: 23 Jul 2021 19:25 Modified: 27 Jul 2021 6:42
Reporter: Jean-François Gagné Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S2 (Serious)
Version:8.0.26 OS:Oracle Linux
Assigned to: CPU Architecture:Any

[23 Jul 2021 19:25] Jean-François Gagné
Description:
Hi,

downloading the minimal Linux binaries for 8.0.26, I found them quite big, and they are compared to 8.0.25 (468M vs 49M):

$ ls -lh mysql-8.0.25-linux-glibc2.17-x86_64-minimal.tar.xz mysql-8.0.26-linux-glibc2.17-x86_64-minimal.tar.xz
-rw-r--r-- 1 jgagne jgagne  49M Apr 25 19:53 mysql-8.0.25-linux-glibc2.17-x86_64-minimal.tar.xz
-rw-r--r-- 1 jgagne jgagne 468M Jul  1 17:51 mysql-8.0.26-linux-glibc2.17-x86_64-minimal.tar.xz

Jeremy Cole found that they include debug info [1], which explains the increased size, but looks suspicious:

$ file mysql_8.0.2{5,6}/bin/mysqld
mysql_8.0.25/bin/mysqld: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped
mysql_8.0.26/bin/mysqld: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, with debug_info, not stripped

[1]: https://twitter.com/jeremycole/status/1418650235690131456

Many thanks for looking into this,

Jean-François Gagné

How to repeat:
See description.
[24 Jul 2021 16:55] Terje Røsten
Hi!

Thanks for your report.

Seems like this is side effect of:

 https://github.com/mysql/mysql-server/commit/38474c44e5330c0cbd338ee10613d4d3e703e672

which adds cmake option -DWITH_PACKAGE_FLAGS=1, which is fine in itself.

The problem is that is option is enabled by default for Release builds,
which need some more consideration.

Fixing this for next release 8.0.26 is simple, however replacing an already public tarball will cause a series of other issues.
[24 Jul 2021 17:49] Jean-François Gagné
> replacing an already public tarball will cause a series of other issues

I agree replacing is problematic, maybe adding a new tarball.
[25 Jul 2021 7:36] Giuseppe Maxia
> replacing an already public tarball will cause a series of other issues

Keeping the tarball as it is is causing many issues already. 
One of the uses for the minimal tarball is downloading and deploying it inside virtual machines or containers with limited resources. When the tarball suddenly consumes ten times its expected storage, there are several workflows that may fail.

Every delay makes the problem more acutely felt. Since releasing the tarball in its current form is clearly a bug, replacing it should be the preferred option.
[27 Jul 2021 6:42] Frederic Descamps
New minimal packages were released this morning: https://dev.mysql.com/downloads/mysql/

Linux - Generic (glibc 2.17) (x86, 64-bit), Compressed TAR Archive
Minimal Install is now 49.5M 	

Thank you for reporting it.

Cheers.
[8 Oct 2021 21:44] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Server 8.0.27 release, and here's the proposed changelog entry from the documentation team:

The code to produce minimal TAR packages added debug symbols to the
packages, which caused larger (roughly by 10x) builds. Now DEB/RPM
compiler flags are on by default for debug symbol builds, and off by
default for minimal sized release builds.

Thank you for the bug report.