mirror of
https://github.com/syncthing/syncthing.git
synced 2025-12-23 22:18:14 -05:00
build: Improve update-deps command, update deps (#8540)
This commit is contained in:
16
build.go
16
build.go
@@ -884,8 +884,20 @@ func shouldRebuildAssets(target, srcdir string) bool {
|
||||
}
|
||||
|
||||
func updateDependencies() {
|
||||
runPrint(goCmd, "get", "-u", "./cmd/...")
|
||||
runPrint(goCmd, "mod", "tidy", "-go=1.17", "-compat=1.17")
|
||||
// Figure out desired Go version
|
||||
bs, err := os.ReadFile("go.mod")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
re := regexp.MustCompile(`(?m)^go\s+([0-9.]+)`)
|
||||
matches := re.FindSubmatch(bs)
|
||||
if len(matches) != 2 {
|
||||
log.Fatal("failed to parse go.mod")
|
||||
}
|
||||
goVersion := string(matches[1])
|
||||
|
||||
runPrint(goCmd, "get", "-u", "all")
|
||||
runPrint(goCmd, "mod", "tidy", "-go="+goVersion, "-compat="+goVersion)
|
||||
|
||||
// We might have updated the protobuf package and should regenerate to match.
|
||||
proto()
|
||||
|
||||
Reference in New Issue
Block a user