Skip to content

Commit

Permalink
build: disable cgo
Browse files Browse the repository at this point in the history
Rather than add static flags and use musl, do the same as zfs
and disable cgo

Signed-off-by: Tiago Castro <tiagolobocastro@gmail.com>
  • Loading branch information
tiagolobocastro committed Jan 20, 2025
1 parent 9ed822d commit a102606
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions buildscripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,9 @@ if [ "$GOOS" = "windows" ]; then
output_name+='.exe'
fi

if command -v musl-gcc; then
CC="musl-gcc"
fi

env CC="$CC" GOOS="$GOOS" GOARCH="$GOARCH" go build -ldflags \
env CC="$CC" GOOS="$GOOS" GOARCH="$GOARCH" CGO_ENABLED=0 go build -ldflags \
"-X github.com/openebs/lvm-localpv/pkg/version.GitCommit=${GIT_COMMIT} \
-X main.CtlName='${CTLNAME}' \
-linkmode external -extldflags -static \
-X github.com/openebs/lvm-localpv/pkg/version.Version=${VERSION} \
-X github.com/openebs/lvm-localpv/pkg/version.VersionMeta=${VERSION_META}" \
-o "$output_name" \
Expand Down
1 change: 0 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pkgs.mkShell {
curl
cacert
util-linux
musl
jq
lvm2_dmeventd
nixos-shell
Expand Down

0 comments on commit a102606

Please sign in to comment.