[Bug 253905] databases/mysql80-server excessive free storage requirements for building from source

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Feb 28 11:18:46 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253905

            Bug ID: 253905
           Summary: databases/mysql80-server excessive free storage
                    requirements for building from source
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: joneum at FreeBSD.org
          Reporter: viktor.stujber+freebsd-bugs_v4CCPfay at gmail.com
          Assignee: joneum at FreeBSD.org
             Flags: maintainer-feedback?(joneum at FreeBSD.org)

mysql-server at this point requires 1GB of storage to build via portmaster,
multiple times more than any other software I'm using. And from what I've
observed, it's not due to the inherent complexity of the source code, but due
to compounding inefficiencies in the build process.

The distfile 'mysql-boost-8.0.23.tar.gz' is 278 MB.
(mysql-5.5.62.tar.gz size is 20 MB.)
The extracted source tree is 810 MB.
(From that, the mysql-test/ directory is 516 MB.)
The intermediate .build/ directory, without tests, is 947 MB.
The stage/ directory is another 177 MB.

In total, the required free storage is no less than 2212 MB, to produce a 177
MB package - a 12.5 : 1 ratio. Back in the mysql 5.x days, it was possible to
fit the whole build, distfile included, onto a 1 GB tmpfs. Perhaps it would be
worthwhile to get closer to that kind of number. Here are my observations.

The ports makefile currently has no options. One of them could be to disable
tests. I did not find any direct knob in their cmakefile that would do that,
but patching it out is easy. That in turn allows having a post-extract step
delete the mysql-test subdirectory for immediate savings of ~516 MB.

The build process generates intermediate .o files and resulting
executables/libraries for the entire source tree without any cleanup steps
inbetween. That is, even though the results are already built, it still keeps
the temporary stuff around. And it does in fact require them to be there - they
will be recompiled if missing, even though all the outputs have already been
built. If the build system instead cleaned its temporary files when they were
no longer needed, and did not require them once the corresponding outputs were
built, that would save ~200 MB.

When the build completes and the files are staged for installation, the staging
is done via copying. It might be possible to do this via symlinks during
staging, and then resolving them during install. This would save another ~177
MB.

I understand that these ideas may not be compatible with how freebsd and mysql
currently does builds, and changes could require upstream cooperation. I just
figured I'd write this to give this issue (or non-issue?) a bit of attention.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list