Skip to content

Commit

Permalink
lxd: Build lxd-user as static binary (#563)
Browse files Browse the repository at this point in the history
This is in preparation for it being used as a container stop hook helper
to allow it to be called across snap base changes without depending in
libs from the core snaps.
  • Loading branch information
tomponline authored Oct 4, 2024
2 parents 74dd6f8 + 2c18445 commit 6538593
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1399,8 +1399,10 @@ parts:
# Build the binaries
go build -trimpath -o "${CRAFT_PART_INSTALL}/bin/lxc" github.com/canonical/lxd/lxc
go build -trimpath -o "${CRAFT_PART_INSTALL}/bin/lxd" -tags=libsqlite3 github.com/canonical/lxd/lxd
# Build static binaries
CGO_ENABLED=0 go build -trimpath -o "${CRAFT_PART_INSTALL}/bin/lxd-agent" -tags=agent,netgo github.com/canonical/lxd/lxd-agent
go build -trimpath -o "${CRAFT_PART_INSTALL}/bin/lxd-user" github.com/canonical/lxd/lxd-user
CGO_ENABLED=0 go build -trimpath -o "${CRAFT_PART_INSTALL}/bin/lxd-user" -tags netgo github.com/canonical/lxd/lxd-user
# Some python dependencies are not available for riscv64 or just require a build from source.
# Not worth the effort for now.
Expand Down

0 comments on commit 6538593

Please sign in to comment.