Skip to content

Commit

Permalink
chore(sdk): upgrade go to v1.23 (#853)
Browse files Browse the repository at this point in the history
Signed-off-by: Volodymyr Kit <[email protected]>
  • Loading branch information
justakit authored Dec 9, 2024
1 parent 5f69ac8 commit 28e85e1
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 49 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: "wallet-sdk ci"

env:
GO_VERSION: '1.22.4'
GO_VERSION: '1.23.4'

on:
push:
Expand Down Expand Up @@ -98,8 +98,8 @@ jobs:
- name: Build docker images for test server
run: |
docker build -f ./images/mocks/loginconsent/Dockerfile --no-cache -t wallet-sdk/mock-login-consent:latest \
--build-arg GO_VER=1.22 \
--build-arg ALPINE_VER=3.18 .
--build-arg GO_VER=1.23 \
--build-arg ALPINE_VER=3.20 .
- name: Save docker image as tar
run: |
docker save --output /tmp/mock-login-consent.tar wallet-sdk/mock-login-consent
Expand All @@ -121,8 +121,8 @@ jobs:
- name: Build docker images for test server
run: |
docker build -f ./images/mocks/webhook/Dockerfile --no-cache -t wallet-sdk/sample-webhook:latest \
--build-arg GO_VER=1.22 \
--build-arg ALPINE_VER=3.18 .
--build-arg GO_VER=1.23 \
--build-arg ALPINE_VER=3.20 .
- name: Save docker image as tar
run: |
docker save --output /tmp/mock-sample-webhook.tar wallet-sdk/sample-webhook
Expand All @@ -144,8 +144,8 @@ jobs:
- name: Build docker images for test server
run: |
docker build -f ./images/mocks/trustregistry/Dockerfile --no-cache -t wallet-sdk/mock-trust-registry:latest \
--build-arg GO_VER=1.22 \
--build-arg ALPINE_VER=3.18 .
--build-arg GO_VER=1.23 \
--build-arg ALPINE_VER=3.20 .
- name: Save docker image as tar
run: |
docker save --output /tmp/mock-trust-registry.tar wallet-sdk/mock-trust-registry
Expand All @@ -167,8 +167,8 @@ jobs:
- name: Build docker images for test server
run: |
docker build -f ./images/mocks/attestation/Dockerfile --no-cache -t wallet-sdk/mock-attestation:latest \
--build-arg GO_VER=1.22 \
--build-arg ALPINE_VER=3.18 .
--build-arg GO_VER=1.23 \
--build-arg ALPINE_VER=3.20 .
- name: Save docker image as tar
run: |
docker save --output /tmp/mock-attestation.tar wallet-sdk/mock-attestation
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: "wallet-sdk release"

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

on:
push:
Expand All @@ -30,26 +30,26 @@ jobs:
- name: Build Custom GO
run: |
cd ..
git clone https://go.googlesource.com/go goroot
git clone https://go.googlesource.com/go goroot
cd goroot
git checkout go1.22.2
git checkout go1.23.4
cp ../wallet-sdk/cmd/wallet-sdk-gomobile/gopatches/* ./
git apply cmd_cgo__fix_unaligned_arguments_typedmemmove_crash_on_iOS.patch
cd src && ./all.bash
- name: Derive the new version
run: |
echo "new version"
NEW_VER=$(git describe --tags --always `git rev-list --tags --max-count=1`)
NEW_VER=$(git describe --tags --always `git rev-list --tags --max-count=1`)
echo $NEW_VER
- name: Generate Binding
run: |
echo $PATH
echo ${{ github.workspace }}
echo ${GOPATH}
echo ${GOROOT}
export PATH=$GOPATH/bin:$PATH
export PATH=$GOPATH/bin:$PATH
echo $PATH
which go
which go
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
NEW_VERSION=$NEW_VER GIT_REV=$(git rev-parse HEAD) BUILD_TIME=$(date) make generate-android-bindings
Expand Down Expand Up @@ -96,9 +96,9 @@ jobs:
- name: Build Custom GO
run: |
cd ..
git clone https://go.googlesource.com/go goroot
git clone https://go.googlesource.com/go goroot
cd goroot
git checkout go1.22.2
git checkout go1.23.4
cp ../wallet-sdk/cmd/wallet-sdk-gomobile/gopatches/* ./
git apply cmd_cgo__fix_unaligned_arguments_typedmemmove_crash_on_iOS.patch
cd src && ./all.bash
Expand All @@ -117,9 +117,9 @@ jobs:
echo ${{ github.workspace }}
echo ${GOPATH}
echo ${GOROOT}
export PATH=$GOPATH/bin:$PATH
export PATH=$GOPATH/bin:$PATH
echo $PATH
which go
which go
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
NEW_VERSION=$NEW_VER GIT_REV=$(git rev-parse HEAD) BUILD_TIME=$(date) make generate-ios-bindings
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ else
PATH:=$(PATH);$(subst /,\\,$(GOBIN_PATH))
endif

ALPINE_VER ?= 3.18
GO_ALPINE_VER ?= 3.18
GO_VER ?= 1.22
ALPINE_VER ?= 3.20
GO_ALPINE_VER ?= 3.20
GO_VER ?= 1.23

NEW_VERSION ?= $(shell git describe --tags --always `git rev-list --tags --max-count=1`)-SNAPSHOT-$(shell git rev-parse --short=7 HEAD)
GIT_REV ?= $(shell git rev-parse HEAD)
Expand All @@ -35,15 +35,15 @@ all: checks unit-test integration-test
checks: license lint

.PHONY: lint
lint:
lint:
@scripts/check_lint.sh

.PHONY: license
license:
@scripts/check_license.sh

.PHONY: unit-test
unit-test:
unit-test:
@scripts/check_unit.sh

.PHONY: generate-android-bindings
Expand Down
6 changes: 3 additions & 3 deletions cmd/wallet-sdk-gomobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package contains the `gomobile`-compatible version of the SDK. It acts as a

## Prerequisites

* [Go 1.22](https://go.dev/doc/install) or newer
* [Go 1.23](https://go.dev/doc/install) or newer
* The gomobile tools:
```
go install golang.org/x/mobile/cmd/gomobile@latest
Expand Down Expand Up @@ -52,7 +52,7 @@ For usage documentation + examples, see [here](docs/usage.md).

## Helpful Tips

* After importing `walletsdk.aar` into your Android project, to use the Wallet SDK packages in a Kotlin or
* After importing `walletsdk.aar` into your Android project, to use the Wallet SDK packages in a Kotlin or
Java file, you import them in a roughly similar way as you would the equivalent Go package:
```java
// Follow the pattern below for other packages/types as well
Expand All @@ -73,6 +73,6 @@ For usage documentation + examples, see [here](docs/usage.md).
#import <Walletsdk/Api.objc.h>
#import <Walletsdk/Storage.objc.h>
```
Note that the various types, interfaces and methods will have the package names prefixed to them (e.g.
Note that the various types, interfaces and methods will have the package names prefixed to them (e.g.
`Signer` in Go becomes `CredentialsignerSigner` in Swift and Objective-C).
* If you've regenerated bindings on your machine, make sure you update your Android Studio or Xcode project accordingly.
4 changes: 2 additions & 2 deletions cmd/wallet-sdk-gomobile/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

module github.com/trustbloc/wallet-sdk/cmd/wallet-sdk-gomobile

go 1.22.0
go 1.23

toolchain go1.22.2
toolchain go1.23.4

require (
github.com/go-jose/go-jose/v3 v3.0.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Subject: [PATCH] cmd/cgo: fix unaligned arguments typedmemmove crash on iOS
Subject: [PATCH] cmd/cgo: fixes: #46893 unaligned arguments typedmemmove crash on iOS

---
Index: src/cmd/cgo/out.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
src/cmd/cgo/out.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
--- a/src/cmd/cgo/out.go (revision dddf0ae40fa0c1223aba191d73a44425a08e1035)
+++ b/src/cmd/cgo/out.go (date 1712322519672)
@@ -1029,7 +1029,7 @@
index 5329cb3cd2..2cc16fc727 100644
--- a/src/cmd/cgo/out.go
+++ b/src/cmd/cgo/out.go
@@ -1039,7 +1039,7 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
// string.h for memset, and is also robust to C++
// types with constructors. Both GCC and LLVM optimize
// this into just zeroing _cgo_a.
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

module github.com/trustbloc/wallet-sdk

go 1.22.0
go 1.23

toolchain go1.22.2
toolchain go1.23.4

require (
github.com/PaesslerAG/jsonpath v0.1.1
Expand Down
2 changes: 1 addition & 1 deletion scripts/check_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e
echo "Running $0"

DOCKER_CMD=${DOCKER_CMD:-docker}
GOLANGCI_LINT_IMAGE="golangci/golangci-lint:v1.62.0"
GOLANGCI_LINT_IMAGE="golangci/golangci-lint:v1.62.2"

if [ ! $(command -v ${DOCKER_CMD}) ]; then
exit 0
Expand Down
4 changes: 2 additions & 2 deletions test/integration/attestation/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

module github.com/trustbloc/wallet-sdk/test/integration/attestation

go 1.22.0
go 1.23

toolchain go1.22.2
toolchain go1.23.4

require (
github.com/google/uuid v1.3.0
Expand Down
4 changes: 2 additions & 2 deletions test/integration/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

module github.com/trustbloc/wallet-sdk/test/integration/helper

go 1.22.0
go 1.23

toolchain go1.22.2
toolchain go1.23.4

require github.com/trustbloc/wallet-sdk/test/integration v0.0.0-20221207181956-419a3951143f

Expand Down
4 changes: 3 additions & 1 deletion test/integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

module github.com/trustbloc/wallet-sdk/test/integration

go 1.22.0
go 1.23

toolchain go1.23.4

require (
github.com/google/uuid v1.3.0
Expand Down
4 changes: 3 additions & 1 deletion test/integration/loginconsent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

module github.com/trustbloc/vcs/test/bdd/loginconsent

go 1.22.0
go 1.23

toolchain go1.23.4

require (
github.com/google/uuid v1.3.0
Expand Down
4 changes: 3 additions & 1 deletion test/integration/trustregistry/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

module github.com/trustbloc/wallet-sdk/test/integration/trustregistry-mock

go 1.22.0
go 1.23

toolchain go1.23.4

require (
github.com/gorilla/mux v1.8.1
Expand Down
4 changes: 3 additions & 1 deletion test/integration/webhook/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

module github.com/trustbloc/wallet-sdk/test/integration/webhook

go 1.22.0
go 1.23

toolchain go1.23.4

require (
github.com/gorilla/mux v1.8.0
Expand Down

0 comments on commit 28e85e1

Please sign in to comment.