lxd: statically compile agent and migration tools

This commit is contained in:
Adam Stephens 2023-07-19 09:17:54 -04:00
parent fdf9837118
commit e53c0de8dd
No known key found for this signature in database

View file

@ -32,7 +32,7 @@ buildGoModule rec {
--replace "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
'';
excludedPackages = [ "test" "lxd/db/generate" ];
excludedPackages = [ "test" "lxd/db/generate" "lxd-agent" "lxd-migrate" ];
nativeBuildInputs = [ installShellFiles pkg-config ];
buildInputs = [
@ -53,6 +53,11 @@ buildGoModule rec {
export CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
'';
# build static binaries: https://github.com/canonical/lxd/blob/6fd175c45e65cd475d198db69d6528e489733e19/Makefile#L43-L51
postBuild = ''
make lxd-agent lxd-migrate
'';
preCheck =
let skippedTests = [
"TestValidateConfig"