Few things going on in this commit:
Do not print "Building subPakage $pkg" message if actually going to skip the
package. This was confusing to me when I was trying to figure out how to set
excludedPackages and seeing the "Building subpackage $pkg" messages for
packages I wanted to skip. Turns out this messages was being printed before
checking if we actually wanted to build the package and not necessarily that my
excludedPackages was wrong.
Make go-packages look a little bit more like go-modules, by adding testdata to
the default list of excluded packages.
This commit also does some setup outside the buildGoDir function so that we
avoid checking `excludedPackages` for every package and cut down the number
of grep calls by half since we always want at least one grep for the default
excludedPackages, might as well just add to the patterns being checked.
Finally, adds documentation for usage of excludedPackages and subPackages. I
had to read the implementation to figure out how to correctly use these
function arguments since there was no documentation and different uses in the
code base. So this commit documents usage of the arguments.
The qemu-ga binary is already moved to a separate
output but still depends on qemu, adding about
600MiB to it's closure.
The command "strings qemu-ga" reveals that something
like
/nix/store/bqgpvv5qrpb741swczqk3lrdm5gzaqx2-qemu-host-cpu-only-6.2.0/bin
is contained, causing this false positive. So use
remove-references-to to reduce the closure to about
600KiB.
Previously, the "out" output of openssl would contain would contain a
couple of tiny libraries in etc/, and the big OpenSSL libraries in
lib/. This bloated closures when building things against OpenSSL with
pkgsStatic. To fix this, introduce a lib output, so only the config
files are left in out.
Additionally, we have to disable support for dynamic engines in static
builds to avoid a reference to the engines directory in $lib. I don't
think it's likely that this would ever have worked anyway.