From 3077a826508e1186d56d2a39930653bdf270c3b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 24 Feb 2024 19:41:24 +0800 Subject: [PATCH] Fix reproducible builds --- .goreleaser.yaml | 12 ------------ Makefile | 4 ++-- clients/android | 2 +- clients/apple | 2 +- cmd/internal/build_libbox/main.go | 6 +++--- go.mod | 2 +- go.sum | 4 ++-- 7 files changed, 10 insertions(+), 22 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index e15f166b..7f9087f5 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -5,10 +5,6 @@ builds: flags: - -v - -trimpath - asmflags: - - all=-trimpath={{.Env.GOPATH}} - gcflags: - - all=-trimpath={{.Env.GOPATH}} ldflags: - -X github.com/sagernet/sing-box/constant.Version={{ .Version }} -s -w -buildid= tags: @@ -44,10 +40,6 @@ builds: flags: - -v - -trimpath - asmflags: - - all=-trimpath={{.Env.GOPATH}} - gcflags: - - all=-trimpath={{.Env.GOPATH}} ldflags: - -X github.com/sagernet/sing-box/constant.Version={{ .Version }} -s -w -buildid= tags: @@ -73,10 +65,6 @@ builds: flags: - -v - -trimpath - asmflags: - - all=-trimpath={{.Env.GOPATH}} - gcflags: - - all=-trimpath={{.Env.GOPATH}} ldflags: - -X github.com/sagernet/sing-box/constant.Version={{ .Version }} -s -w -buildid= tags: diff --git a/Makefile b/Makefile index 5994b6d4..104c232f 100644 --- a/Makefile +++ b/Makefile @@ -191,8 +191,8 @@ lib: go run ./cmd/internal/build_libbox -target ios lib_install: - go install -v github.com/sagernet/gomobile/cmd/gomobile@v0.1.1 - go install -v github.com/sagernet/gomobile/cmd/gobind@v0.1.1 + go install -v github.com/sagernet/gomobile/cmd/gomobile@v0.1.3 + go install -v github.com/sagernet/gomobile/cmd/gobind@v0.1.3 docs: mkdocs serve diff --git a/clients/android b/clients/android index 3b9d24a0..66028176 160000 --- a/clients/android +++ b/clients/android @@ -1 +1 @@ -Subproject commit 3b9d24a0bb757a0b55f5590485934e1012757ba6 +Subproject commit 660281767171d26795018bad577f77e7e6bcdb91 diff --git a/clients/apple b/clients/apple index 60f96985..45b4e58b 160000 --- a/clients/apple +++ b/clients/apple @@ -1 +1 @@ -Subproject commit 60f96985a39c8af7dd66d57efd08bb0b150fcb6d +Subproject commit 45b4e58b3f108f047e5f72e9322ddabcc37497a4 diff --git a/cmd/internal/build_libbox/main.go b/cmd/internal/build_libbox/main.go index d50e03b3..ae0fe34a 100644 --- a/cmd/internal/build_libbox/main.go +++ b/cmd/internal/build_libbox/main.go @@ -46,13 +46,13 @@ var ( func init() { sharedFlags = append(sharedFlags, "-trimpath") - sharedFlags = append(sharedFlags, "-ldflags") + sharedFlags = append(sharedFlags, "-buildvcs=false") currentTag, err := build_shared.ReadTag() if err != nil { currentTag = "unknown" } - sharedFlags = append(sharedFlags, "-X github.com/sagernet/sing-box/constant.Version="+currentTag+" -s -w -buildid=") - debugFlags = append(debugFlags, "-X github.com/sagernet/sing-box/constant.Version="+currentTag) + sharedFlags = append(sharedFlags, "-ldflags", "-X github.com/sagernet/sing-box/constant.Version="+currentTag+" -s -w -buildid=") + debugFlags = append(debugFlags, "-ldflags", "-X github.com/sagernet/sing-box/constant.Version="+currentTag) sharedTags = append(sharedTags, "with_gvisor", "with_quic", "with_wireguard", "with_ech", "with_utls", "with_clash_api") iosTags = append(iosTags, "with_dhcp", "with_low_memory", "with_conntrack") diff --git a/go.mod b/go.mod index d03cb18f..bb57226d 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/oschwald/maxminddb-golang v1.12.0 github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a github.com/sagernet/cloudflare-tls v0.0.0-20231208171750-a4483c1b7cd1 - github.com/sagernet/gomobile v0.1.1 + github.com/sagernet/gomobile v0.1.3 github.com/sagernet/gvisor v0.0.0-20231209105102-8d27a30e436e github.com/sagernet/quic-go v0.40.1 github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 diff --git a/go.sum b/go.sum index b2319699..2af8d2f6 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,8 @@ github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a h1:+NkI2670SQpQWvkk github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a/go.mod h1:63s7jpZqcDAIpj8oI/1v4Izok+npJOHACFCU6+huCkM= github.com/sagernet/cloudflare-tls v0.0.0-20231208171750-a4483c1b7cd1 h1:YbmpqPQEMdlk9oFSKYWRqVuu9qzNiOayIonKmv1gCXY= github.com/sagernet/cloudflare-tls v0.0.0-20231208171750-a4483c1b7cd1/go.mod h1:J2yAxTFPDjrDPhuAi9aWFz2L3ox9it4qAluBBbN0H5k= -github.com/sagernet/gomobile v0.1.1 h1:3vihRGyUfFTToHMeeak0UK6/ldt2MV2bcWKFi2VyECU= -github.com/sagernet/gomobile v0.1.1/go.mod h1:Pqq2+ZVvs10U7xK+UwJgwYWUykewi8H6vlslAO73n9E= +github.com/sagernet/gomobile v0.1.3 h1:ohjIb1Ou2+1558PnZour3od69suSuvkdSVOlO1tC4B8= +github.com/sagernet/gomobile v0.1.3/go.mod h1:Pqq2+ZVvs10U7xK+UwJgwYWUykewi8H6vlslAO73n9E= github.com/sagernet/gvisor v0.0.0-20231209105102-8d27a30e436e h1:DOkjByVeAR56dkszjnMZke4wr7yM/1xHaJF3G9olkEE= github.com/sagernet/gvisor v0.0.0-20231209105102-8d27a30e436e/go.mod h1:fLxq/gtp0qzkaEwywlRRiGmjOK5ES/xUzyIKIFP2Asw= github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 h1:iL5gZI3uFp0X6EslacyapiRz7LLSJyr4RajF/BhMVyE=