From 7692ced5f57e5e4a79b7f1049a6930a520440d6d Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 2 Dec 2024 09:48:26 +0100 Subject: [PATCH 1/2] multi: update comment on changing Go version Since we now have a scripted check that makes sure the Golang version is synced throughout all files, it is important that the main version in the Makefile is changed, then all other versions can be detected by that script. --- .github/workflows/main.yml | 8 ++------ .github/workflows/release.yaml | 7 ++----- .golangci.yml | 2 ++ Dockerfile | 7 ++----- dev.Dockerfile | 7 ++----- docker/btcd/Dockerfile | 2 ++ go.mod | 5 +++-- lnrpc/Dockerfile | 2 ++ make/builder.Dockerfile | 7 ++----- 9 files changed, 19 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0f101f866..dd8b5dbfe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,12 +25,8 @@ env: TRANCHES: 8 - # If you change this value, please change it in the following files as well: - # /.travis.yml - # /Dockerfile - # /dev.Dockerfile - # /make/builder.Dockerfile - # /.github/workflows/release.yml + # If you change this please also update GO_VERSION in Makefile (then run + # `make lint` to see where else it needs to be updated as well). GO_VERSION: 1.22.6 jobs: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d7e932e15..8a6a0ea40 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,11 +10,8 @@ defaults: shell: bash env: - # If you change this value, please change it in the following files as well: - # /Dockerfile - # /dev.Dockerfile - # /make/builder.Dockerfile - # /.github/workflows/main.yml + # If you change this please also update GO_VERSION in Makefile (then run + # `make lint` to see where else it needs to be updated as well). GO_VERSION: 1.22.6 jobs: diff --git a/.golangci.yml b/.golangci.yml index 8114945c6..7b802cde5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,6 @@ run: + # If you change this please also update GO_VERSION in Makefile (then run + # `make lint` to see where else it needs to be updated as well). go: "1.22.6" # Abort after 10 minutes. diff --git a/Dockerfile b/Dockerfile index 3a6f642b1..f2334c523 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,5 @@ -# If you change this value, please change it in the following files as well: -# /dev.Dockerfile -# /make/builder.Dockerfile -# /.github/workflows/main.yml -# /.github/workflows/release.yml +# If you change this please also update GO_VERSION in Makefile (then run +# `make lint` to see where else it needs to be updated as well). FROM golang:1.22.6-alpine as builder # Force Go to use the cgo based DNS resolver. This is required to ensure DNS diff --git a/dev.Dockerfile b/dev.Dockerfile index 945e6a5b5..8d65fcc9f 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -1,8 +1,5 @@ -# If you change this value, please change it in the following files as well: -# /Dockerfile -# /make/builder.Dockerfile -# /.github/workflows/main.yml -# /.github/workflows/release.yml +# If you change this please also update GO_VERSION in Makefile (then run +# `make lint` to see where else it needs to be updated as well). FROM golang:1.22.6-alpine as builder LABEL maintainer="Olaoluwa Osuntokun " diff --git a/docker/btcd/Dockerfile b/docker/btcd/Dockerfile index 0bb29c898..f62d226ed 100644 --- a/docker/btcd/Dockerfile +++ b/docker/btcd/Dockerfile @@ -1,3 +1,5 @@ +# If you change this please also update GO_VERSION in Makefile (then run +# `make lint` to see where else it needs to be updated as well). FROM golang:1.22.6-alpine as builder LABEL maintainer="Olaoluwa Osuntokun " diff --git a/go.mod b/go.mod index 6ca886630..1330f9a84 100644 --- a/go.mod +++ b/go.mod @@ -207,8 +207,9 @@ replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 // allows us to specify that as an option. replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display -// If you change this please also update .github/pull_request_template.md, -// docs/INSTALL.md and GO_IMAGE in lnrpc/gen_protos_docker.sh. +// If you change this please also update docs/INSTALL.md and GO_VERSION in +// Makefile (then run `make lint` to see where else it needs to be updated as +// well). go 1.22.6 retract v0.0.2 diff --git a/lnrpc/Dockerfile b/lnrpc/Dockerfile index 253e54f16..c857c9ef0 100644 --- a/lnrpc/Dockerfile +++ b/lnrpc/Dockerfile @@ -1,3 +1,5 @@ +# If you change this please also update GO_VERSION in Makefile (then run +# `make lint` to see where else it needs to be updated as well). FROM golang:1.22.6-bookworm RUN apt-get update && apt-get install -y \ diff --git a/make/builder.Dockerfile b/make/builder.Dockerfile index 86762006d..310b4bc4e 100644 --- a/make/builder.Dockerfile +++ b/make/builder.Dockerfile @@ -1,8 +1,5 @@ -# If you change this value, please change it in the following files as well: -# /Dockerfile -# /dev.Dockerfile -# /.github/workflows/main.yml -# /.github/workflows/release.yml +# If you change this please also update GO_VERSION in Makefile (then run +# `make lint` to see where else it needs to be updated as well). FROM golang:1.22.6-bookworm MAINTAINER Olaoluwa Osuntokun From 2fdfa26268bdfaa0c45c002b4a3617213f6cc2a8 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 2 Dec 2024 09:49:25 +0100 Subject: [PATCH 2/2] docs: update Golang minimum version in docs/INSTALL.md --- docs/INSTALL.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 3b7f7cf4b..88375529d 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -93,15 +93,16 @@ following build dependencies are required: ### Installing Go -`lnd` is written in Go, with a minimum version of 1.19. To install, run one of -the following commands for your OS: +`lnd` is written in Go, with a minimum version of `1.22.6` (or, in case this +document gets out of date, whatever the Go version in the main `go.mod` file +requires). To install, run one of the following commands for your OS:
Linux (x86-64) ``` wget https://dl.google.com/go/go1.22.6.linux-amd64.tar.gz - sha256sum go1.22.5.linux-amd64.tar.gz | awk -F " " '{ print $1 }' + sha256sum go1.22.6.linux-amd64.tar.gz | awk -F " " '{ print $1 }' ``` The final output of the command above should be @@ -109,7 +110,7 @@ the following commands for your OS: isn't, then the target REPO HAS BEEN MODIFIED, and you shouldn't install this version of Go. If it matches, then proceed to install Go: ``` - sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz + sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.6.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin ```
@@ -118,8 +119,8 @@ the following commands for your OS: Linux (ARMv6) ``` - wget https://dl.google.com/go/go1.22.5.linux-armv6l.tar.gz - sha256sum go1.22.5.linux-armv6l.tar.gz | awk -F " " '{ print $1 }' + wget https://dl.google.com/go/go1.22.6.linux-armv6l.tar.gz + sha256sum go1.22.6.linux-armv6l.tar.gz | awk -F " " '{ print $1 }' ``` The final output of the command above should be @@ -127,7 +128,7 @@ the following commands for your OS: isn't, then the target REPO HAS BEEN MODIFIED, and you shouldn't install this version of Go. If it matches, then proceed to install Go: ``` - sudo rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.5.linux-armv6l.tar.gz + sudo rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.6.linux-armv6l.tar.gz export PATH=$PATH:/usr/local/go/bin ```