From a90dfff9a51a8a20db0fb0d02f9cbde245b6d14f Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 15 Mar 2022 16:24:42 -0700 Subject: [PATCH 1/3] build: update to Go 1.18 --- .github/workflows/main.yml | 2 +- .github/workflows/release.yaml | 2 +- .travis.yml | 2 +- Dockerfile | 2 +- chainntnfs/bitcoindnotify/bitcoind_test.go | 2 +- discovery/gossiper_test.go | 2 +- discovery/syncer_test.go | 2 +- htlcswitch/circuit_test.go | 2 +- lnrpc/routerrpc/router_backend_test.go | 2 +- make/builder.Dockerfile | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d678e3ebb..5688eb15b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ env: # /dev.Dockerfile # /make/builder.Dockerfile # /.github/workflows/release.yml - GO_VERSION: 1.17.3 + GO_VERSION: 1.18 jobs: ######################## diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 482e74f6c..766965a29 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,7 @@ env: # /dev.Dockerfile # /make/builder.Dockerfile # /.github/workflows/main.yml - GO_VERSION: 1.17.3 + GO_VERSION: 1.18 jobs: main: diff --git a/.travis.yml b/.travis.yml index a8ee93269..e65c2137c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ go: # /make/builder.Dockerfile # /.github/workflows/main.yml # /.github/workflows/release.yml - - "1.17.x" + - "1.18.x" env: global: diff --git a/Dockerfile b/Dockerfile index 9f0048e48..0237fb88c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ # /make/builder.Dockerfile # /.github/workflows/main.yml # /.github/workflows/release.yml -FROM golang:1.17.3-alpine as builder +FROM golang:1.18-alpine as builder # Force Go to use the cgo based DNS resolver. This is required to ensure DNS # queries required to connect to linked containers succeed. diff --git a/chainntnfs/bitcoindnotify/bitcoind_test.go b/chainntnfs/bitcoindnotify/bitcoind_test.go index a3568c168..796735668 100644 --- a/chainntnfs/bitcoindnotify/bitcoind_test.go +++ b/chainntnfs/bitcoindnotify/bitcoind_test.go @@ -175,7 +175,7 @@ func TestHistoricalConfDetailsTxIndex(t *testing.T) { switch txStatus { case chainntnfs.TxFoundMempool: default: - t.Fatal("should have found the transaction within the "+ + t.Fatalf("should have found the transaction within the "+ "mempool, but did not: %v", txStatus) } diff --git a/discovery/gossiper_test.go b/discovery/gossiper_test.go index 668e1db5f..cffe80536 100644 --- a/discovery/gossiper_test.go +++ b/discovery/gossiper_test.go @@ -2009,7 +2009,7 @@ func TestDeDuplicatedAnnouncements(t *testing.T) { // indexes as due to the randomized order of map iteration they may be // in either place. if !reflect.DeepEqual(batch[2].msg, na) && !reflect.DeepEqual(batch[3].msg, na) { - t.Fatal("first node announcement not in last part of batch: "+ + t.Fatalf("first node announcement not in last part of batch: "+ "got %v, expected %v", batch[2].msg, na) } diff --git a/discovery/syncer_test.go b/discovery/syncer_test.go index e63c2fd76..01afaf391 100644 --- a/discovery/syncer_test.go +++ b/discovery/syncer_test.go @@ -2125,7 +2125,7 @@ func TestGossipSyncerSyncTransitions(t *testing.T) { select { case msgs := <-msgChan: if len(msgs) != 1 { - t.Fatal("expected to send a single message at "+ + t.Fatalf("expected to send a single message at "+ "a time, got %d", len(msgs)) } msgSent = msgs[0] diff --git a/htlcswitch/circuit_test.go b/htlcswitch/circuit_test.go index 48c06f19c..fd70c7fec 100644 --- a/htlcswitch/circuit_test.go +++ b/htlcswitch/circuit_test.go @@ -490,7 +490,7 @@ func TestCircuitMapPersistence(t *testing.T) { // Removing already-removed circuit should return an error. err = circuitMap.DeleteCircuits(circuit1.Incoming) if err != nil { - t.Fatal("Unexpected failure when deleting already "+ + t.Fatalf("Unexpected failure when deleting already "+ "deleted circuit: %v", err) } diff --git a/lnrpc/routerrpc/router_backend_test.go b/lnrpc/routerrpc/router_backend_test.go index eab6f3d86..e4880781e 100644 --- a/lnrpc/routerrpc/router_backend_test.go +++ b/lnrpc/routerrpc/router_backend_test.go @@ -203,7 +203,7 @@ func testQueryRoutes(t *testing.T, useMissionControl bool, useMsat bool, route.Vertex, error) { if chanID != 555 { - t.Fatal("expected endpoints to be fetched for "+ + t.Fatalf("expected endpoints to be fetched for "+ "channel 555, but got %v instead", chanID) } diff --git a/make/builder.Dockerfile b/make/builder.Dockerfile index a164337d6..0c5049ba2 100644 --- a/make/builder.Dockerfile +++ b/make/builder.Dockerfile @@ -4,7 +4,7 @@ # /dev.Dockerfile # /.github/workflows/main.yml # /.github/workflows/release.yml -FROM golang:1.17.3-buster +FROM golang:1.18-buster MAINTAINER Olaoluwa Osuntokun From d6b2283279dc0182795f01af45faca6b1b538b61 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 15 Mar 2022 16:31:59 -0700 Subject: [PATCH 2/3] docs/INSTALL.md: update min Go version to 1.18 In this commit, we update the min Go version to be version 1.18. This breaks our prior rule of supporting the last two major versions, but allows us to use the larger features in 1.18 sooner, such as the newly released type parameters. --- docs/INSTALL.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index cabccfbf2..5c16680d5 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -93,23 +93,23 @@ following build dependencies are required: ### Installing Go -`lnd` is written in Go, with a minimum version of 1.16. To install, run one of +`lnd` is written in Go, with a minimum version of 1.18. To install, run one of the following commands for your OS:
Linux (x86-64) ``` - wget https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz - sha256sum go1.17.1.linux-amd64.tar.gz | awk -F " " '{ print $1 }' + wget https://dl.google.com/go/go1.18.linux-amd64.tar.gz + sha256sum go1.18.linux-amd64.tar.gz | awk -F " " '{ print $1 }' ``` The final output of the command above should be - `dab7d9c34361dc21ec237d584590d72500652e7c909bf082758fb63064fca0ef`. If it + `e85278e98f57cdb150fe8409e6e5df5343ecb13cebf03a5d5ff12bd55a80264f`. If it 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 tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz + sudo tar -C /usr/local -xzf go1.18.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin ```
@@ -118,12 +118,12 @@ the following commands for your OS: Linux (ARMv6) ``` - wget https://dl.google.com/go/go1.17.1.linux-armv6l.tar.gz - sha256sum go1.17.1.linux-armv6l.tar.gz | awk -F " " '{ print $1 }' + wget https://dl.google.com/go/go1.18.linux-armv6l.tar.gz + sha256sum go1.18.linux-armv6l.tar.gz | awk -F " " '{ print $1 }' ``` The final output of the command above should be - `ed3e4dbc9b80353f6482c441d65b51808290e94ff1d15d56da5f4a7be7353758`. If it + `a80fa43d1f4575fb030adbfbaa94acd860c6847820764eecb06c63b7c103612b`. If it 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: ``` From 2fadc60ef2f3897c002c5bc205d8df7492b8e76b Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 30 Mar 2022 16:26:46 -0500 Subject: [PATCH 3/3] docs/release-notes: add note entry for Go 1.18 --- docs/release-notes/release-notes-0.15.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/release-notes-0.15.0.md b/docs/release-notes/release-notes-0.15.0.md index fcee2e324..e21d2747c 100644 --- a/docs/release-notes/release-notes-0.15.0.md +++ b/docs/release-notes/release-notes-0.15.0.md @@ -150,6 +150,7 @@ then watch it on chain. Taproot script spends are also supported through the The `apple` task uses `gomobile` to build an `XCFramework` that can be used to embed lnd to both iOS and macOS apps. +* [The CI and build infrastructure for the project has transitioned to using Go 1.18](https://github.com/lightningnetwork/lnd/pull/6340). ## RPC Server