From 1d4de636ea76a22b5819b308f26d3675db59cf9c Mon Sep 17 00:00:00 2001 From: tamirms Date: Thu, 2 Jan 2025 23:27:43 +0000 Subject: [PATCH] all: Update Go version to 1.23 (#5561) --- .github/workflows/go.yml | 6 +++--- .github/workflows/horizon-release.yml | 2 +- .github/workflows/horizon.yml | 5 +++-- exp/services/recoverysigner/docker/Dockerfile | 2 +- exp/services/webauth/docker/Dockerfile | 2 +- go.mod | 4 +--- ingest/ledgerbackend/toml.go | 2 +- services/friendbot/docker/Dockerfile | 2 +- services/galexie/docker/Dockerfile | 2 +- services/horizon/Makefile | 2 +- services/horizon/docker/Dockerfile.dev | 2 +- services/horizon/docker/verify-range/dependencies | 2 ++ .../horizon/internal/scripts/check_release_hash/Dockerfile | 2 +- services/regulated-assets-approval-server/docker/Dockerfile | 2 +- staticcheck.sh | 2 +- 15 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a84bcd17df..8a97d10f2e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - go: ["1.22.1"] + go: ["1.23"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -38,7 +38,7 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - go: ["1.21", "1.22"] + go: ["1.22", "1.23"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -56,7 +56,7 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - go: ["1.21", "1.22"] + go: ["1.22", "1.23"] pg: [12, 16] runs-on: ${{ matrix.os }} services: diff --git a/.github/workflows/horizon-release.yml b/.github/workflows/horizon-release.yml index 3977ab85d3..b37e357422 100644 --- a/.github/workflows/horizon-release.yml +++ b/.github/workflows/horizon-release.yml @@ -22,7 +22,7 @@ jobs: - uses: ./.github/actions/setup-go with: - go-version: "1.22" + go-version: "1.23" - name: Check dependencies run: ./gomod.sh diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 8eceef8c44..022c18c980 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, ubuntu-22.04] - go: ["1.21", "1.22"] + go: ["1.22", "1.23"] pg: [12, 16] protocol-version: [22] runs-on: ${{ matrix.os }} @@ -126,6 +126,7 @@ jobs: name: Test (and push) verify-range image runs-on: ubuntu-22.04 env: + GO_VERSION: 1.23.4 STELLAR_CORE_VERSION: 22.1.0-2194.0241e79f7.focal CAPTIVE_CORE_STORAGE_PATH: /tmp steps: @@ -136,7 +137,7 @@ jobs: - name: Build and test the Verify Range Docker image run: | - docker build --build-arg="GO_VERSION=$(sed -En 's/^toolchain[[:space:]]+go([[:digit:].]+)$/\1/p' go.mod)" -f services/horizon/docker/verify-range/Dockerfile -t stellar/horizon-verify-range services/horizon/docker/verify-range/ + docker build --build-arg="GO_VERSION=$GO_VERSION" -f services/horizon/docker/verify-range/Dockerfile -t stellar/horizon-verify-range services/horizon/docker/verify-range/ # Any range should do for basic testing, this range was chosen pretty early in history so that it only takes a few mins to run docker run -e BRANCH=$(git rev-parse HEAD) -e FROM=10000063 -e TO=10000127 stellar/horizon-verify-range diff --git a/exp/services/recoverysigner/docker/Dockerfile b/exp/services/recoverysigner/docker/Dockerfile index ff5c14e731..fac8cb3acb 100644 --- a/exp/services/recoverysigner/docker/Dockerfile +++ b/exp/services/recoverysigner/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-bullseye as build +FROM golang:1.23-bullseye as build ADD . /src/recoverysigner WORKDIR /src/recoverysigner diff --git a/exp/services/webauth/docker/Dockerfile b/exp/services/webauth/docker/Dockerfile index 64cff400aa..85f13729e8 100644 --- a/exp/services/webauth/docker/Dockerfile +++ b/exp/services/webauth/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-bullseye as build +FROM golang:1.23-bullseye as build ADD . /src/webauth WORKDIR /src/webauth diff --git a/go.mod b/go.mod index db00aa3435..341c85543e 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/stellar/go -go 1.22 - -toolchain go1.22.1 +go 1.23 require ( cloud.google.com/go/firestore v1.15.0 // indirect diff --git a/ingest/ledgerbackend/toml.go b/ingest/ledgerbackend/toml.go index b7f41b03a7..28f4f8cce6 100644 --- a/ingest/ledgerbackend/toml.go +++ b/ingest/ledgerbackend/toml.go @@ -303,7 +303,7 @@ func (c *CaptiveCoreToml) unmarshal(data []byte, strict bool) error { return err } else if err = toml.NewDecoder(bytes.NewReader(withoutPlaceHolders)).Strict(strict).Decode(&body); err != nil { if message := err.Error(); strings.HasPrefix(message, "undecoded keys") { - return fmt.Errorf(strings.Replace( + return errors.New(strings.Replace( message, "undecoded keys", "these fields are not supported by captive core", diff --git a/services/friendbot/docker/Dockerfile b/services/friendbot/docker/Dockerfile index 764fa5e276..5dab285e83 100644 --- a/services/friendbot/docker/Dockerfile +++ b/services/friendbot/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-bullseye as build +FROM golang:1.23-bullseye as build ADD . /src/friendbot WORKDIR /src/friendbot diff --git a/services/galexie/docker/Dockerfile b/services/galexie/docker/Dockerfile index 42ff2e43d9..ccfc290a2f 100644 --- a/services/galexie/docker/Dockerfile +++ b/services/galexie/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-bookworm AS builder +FROM golang:1.23-bookworm AS builder WORKDIR /go/src/github.com/stellar/go diff --git a/services/horizon/Makefile b/services/horizon/Makefile index 0789453373..64ea380ac3 100644 --- a/services/horizon/Makefile +++ b/services/horizon/Makefile @@ -11,7 +11,7 @@ binary-build: --pull always \ --env CGO_ENABLED=0 \ --env GOFLAGS="-ldflags=-X=github.com/stellar/go/support/app.version=$(VERSION_STRING)" \ - golang:1.22-bullseye \ + golang:1.23-bullseye \ /bin/bash -c '\ git config --global --add safe.directory /go/src/github.com/stellar/go && \ cd /go/src/github.com/stellar/go && \ diff --git a/services/horizon/docker/Dockerfile.dev b/services/horizon/docker/Dockerfile.dev index 91b0f8aeea..83861d5b15 100644 --- a/services/horizon/docker/Dockerfile.dev +++ b/services/horizon/docker/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM golang:1.22-bookworm AS builder +FROM golang:1.23-bookworm AS builder ARG VERSION="devel" WORKDIR /go/src/github.com/stellar/go diff --git a/services/horizon/docker/verify-range/dependencies b/services/horizon/docker/verify-range/dependencies index 3eacede44b..9c13cf09b4 100644 --- a/services/horizon/docker/verify-range/dependencies +++ b/services/horizon/docker/verify-range/dependencies @@ -1,5 +1,7 @@ #! /usr/bin/env bash set -e +set -o xtrace + apt-get update apt-get install -y curl git libpq-dev libsqlite3-dev libsasl2-dev postgresql-client postgresql postgresql-contrib sudo vim zlib1g-dev wget gnupg2 lsb-release diff --git a/services/horizon/internal/scripts/check_release_hash/Dockerfile b/services/horizon/internal/scripts/check_release_hash/Dockerfile index 08f818dad3..92af8d7233 100644 --- a/services/horizon/internal/scripts/check_release_hash/Dockerfile +++ b/services/horizon/internal/scripts/check_release_hash/Dockerfile @@ -1,5 +1,5 @@ # Change to Go version used in CI or rebuild with --build-arg. -ARG GO_IMAGE=golang:1.22-bullseye +ARG GO_IMAGE=golang:1.23-bullseye FROM $GO_IMAGE WORKDIR /go/src/github.com/stellar/go diff --git a/services/regulated-assets-approval-server/docker/Dockerfile b/services/regulated-assets-approval-server/docker/Dockerfile index 8f1562db6d..35cb3ae77e 100644 --- a/services/regulated-assets-approval-server/docker/Dockerfile +++ b/services/regulated-assets-approval-server/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-bullseye as build +FROM golang:1.23-bullseye as build ADD . /src/regulated-assets-approval-server WORKDIR /src/regulated-assets-approval-server diff --git a/staticcheck.sh b/staticcheck.sh index 5e07d0d026..ec8854f0c7 100755 --- a/staticcheck.sh +++ b/staticcheck.sh @@ -1,7 +1,7 @@ #! /bin/bash set -e -version='2023.1.7' +version='2024.1.1' staticcheck='go run honnef.co/go/tools/cmd/staticcheck@'"$version"