fix: build hrp

This commit is contained in:
lilong.129
2025-04-24 18:40:48 +08:00
parent 5d54588f1b
commit dfa8564187
2 changed files with 10 additions and 2 deletions

View File

@@ -19,9 +19,17 @@ bump: ## bump hrp version, e.g. make bump version=4.0.0
.PHONY: build
build: ## build hrp cli tool
# =================== 参数说明 ===================
# CGO_ENABLED=0 : 完全禁用 CGO强制使用纯 Go 实现
# -tags netgo,osusergo : 使用 Go 的 net 和 user 包的纯 Go 实现,不依赖系统库
# -trimpath : 从二进制文件中删除所有文件系统路径,增加安全性和可重现性
# -ldflags "-s -w" :
# -s : 忽略符号表和调试信息
# -w : 忽略 DWARF 调试信息
# -extldflags "-static" : 传递给外部链接器的标志,强制静态链接
@echo "[info] build hrp cli tool"
go mod tidy
GOOS=${TARGET_OS} GOARCH=${TARGET_ARCH} go build -ldflags "\
GOOS=${TARGET_OS} GOARCH=${TARGET_ARCH} CGO_ENABLED=0 go build -tags netgo,osusergo -trimpath -ldflags "\
-s -w \
-X 'github.com/httprunner/httprunner/v5/internal/version.GitCommit=$(shell git rev-parse HEAD)' \
-X 'github.com/httprunner/httprunner/v5/internal/version.GitBranch=$(shell git rev-parse --abbrev-ref HEAD)' \

View File

@@ -1 +1 @@
v5.0.0-beta-2504241750
v5.0.0-beta-2504241840