Skip to content

Commit b822b73

Browse files
authored
chore: use pure Go resolver and remove CGO_ENABLED=0 (#603)
1 parent 58ade3b commit b822b73

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ VERSION := 0.4.3
88
PROMETHEUS_TAG := github.com/prometheus/common/version
99
KVM_PKG_NAME := github.com/jetkvm/kvm
1010

11+
GO_BUILD_ARGS := -tags netgo
12+
GO_RELEASE_BUILD_ARGS := -trimpath $(GO_BUILD_ARGS)
1113
GO_LDFLAGS := \
1214
-s -w \
1315
-X $(PROMETHEUS_TAG).Branch=$(BRANCH) \
1416
-X $(PROMETHEUS_TAG).BuildDate=$(BUILDDATE) \
1517
-X $(PROMETHEUS_TAG).Revision=$(REVISION) \
1618
-X $(KVM_PKG_NAME).builtTimestamp=$(BUILDTS)
1719

18-
GO_CMD := GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0 go
20+
GO_CMD := GOOS=linux GOARCH=arm GOARM=7 go
1921
BIN_DIR := $(shell pwd)/bin
2022

2123
TEST_DIRS := $(shell find . -name "*_test.go" -type f -exec dirname {} \; | sort -u)
@@ -27,7 +29,7 @@ build_dev: hash_resource
2729
@echo "Building..."
2830
$(GO_CMD) build \
2931
-ldflags="$(GO_LDFLAGS) -X $(KVM_PKG_NAME).builtAppVersion=$(VERSION_DEV)" \
30-
-trimpath \
32+
$(GO_RELEASE_BUILD_ARGS) \
3133
-o $(BIN_DIR)/jetkvm_app cmd/main.go
3234

3335
build_test2json:
@@ -50,6 +52,7 @@ build_dev_test: build_test2json build_gotestsum
5052
test_filename=$$(echo $$test_pkg_name | sed 's/\//__/g')_test; \
5153
$(GO_CMD) test -v \
5254
-ldflags="$(GO_LDFLAGS) -X $(KVM_PKG_NAME).builtAppVersion=$(VERSION_DEV)" \
55+
$(GO_BUILD_ARGS) \
5356
-c -o $(BIN_DIR)/tests/$$test_filename $$test; \
5457
echo "runTest ./$$test_filename $$test_pkg_full_name" >> $(BIN_DIR)/tests/run_all_tests; \
5558
done; \
@@ -71,7 +74,7 @@ build_release: frontend hash_resource
7174
@echo "Building release..."
7275
$(GO_CMD) build \
7376
-ldflags="$(GO_LDFLAGS) -X $(KVM_PKG_NAME).builtAppVersion=$(VERSION)" \
74-
-trimpath \
77+
$(GO_RELEASE_BUILD_ARGS) \
7578
-o bin/jetkvm_app cmd/main.go
7679

7780
release:

dev_deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ cd "${REMOTE_PATH}"
174174
chmod +x jetkvm_app_debug
175175
176176
# Run the application in the background
177-
PION_LOG_TRACE=${LOG_TRACE_SCOPES} ./jetkvm_app_debug
177+
PION_LOG_TRACE=${LOG_TRACE_SCOPES} GODEBUG=netdns=1 ./jetkvm_app_debug
178178
EOF
179179

180180
echo "Deployment complete."

0 commit comments

Comments
 (0)