Skip to content

Commit

Permalink
Merge pull request #6068 from mysteriumnetwork/fix/datarace3
Browse files Browse the repository at this point in the history
Fix datarace
  • Loading branch information
Zensey authored Aug 30, 2024
2 parents 49b9922 + 2e9421c commit 1f879f5
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 216 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'

- name: Prepare environment
run: |
Expand Down Expand Up @@ -102,11 +106,15 @@ jobs:
- PackageAndroidProvider

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- uses: actions/download-artifact@v4
with:
name: env.sh
Expand All @@ -121,18 +129,22 @@ jobs:
run: |
source env.sh
unset CI # workaround for "PackageAndroid" target
sudo -E go run mage.go -v ${{ matrix.platform }}
go run mage.go -v ${{ matrix.platform }}
build-swagger:
runs-on: ubuntu-latest
needs: [setup-env, build-packages]

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- uses: actions/download-artifact@v4
with:
name: env.sh
Expand Down Expand Up @@ -165,11 +177,15 @@ jobs:
(github.ref == 'refs/heads/master' || github.ref_type == 'tag')
steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- uses: actions/download-artifact@v4
with:
name: env.sh
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ jobs:
NIGHTLY_BUILD: true

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- uses: actions/download-artifact@v4
with:
name: env.sh
Expand Down Expand Up @@ -55,11 +59,15 @@ jobs:
- ReleaseDebianPPASnapshot

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- uses: actions/download-artifact@v4
with:
name: env.sh
Expand Down Expand Up @@ -104,11 +112,15 @@ jobs:
- ReleaseAndroidProviderSDK

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- uses: actions/download-artifact@v4
with:
name: env.sh
Expand Down Expand Up @@ -140,11 +152,15 @@ jobs:
needs: [release-tag]

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'
- uses: actions/download-artifact@v4
with:
name: env.sh
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/tests-and-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'

- name: Install protoc
run: |
Expand All @@ -37,11 +41,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -56,11 +64,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Clean previous go installation
run: |
rm -rf /opt/hostedtoolcache/go
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down
2 changes: 1 addition & 1 deletion bin/build_xgo
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DIR_BUILD="build/myst"
mkdir -p ${DIR_BUILD}
DIR_TEMP=`mktemp -d ${DIR_BUILD}/${tempname}.XXXXXX`

IMAGE="mysteriumnetwork/xgo:1.20.2"
IMAGE="mysteriumnetwork/xgo:1.22.2"

docker run --rm \
-v "$PWD"/$DIR_TEMP:/build \
Expand Down
2 changes: 1 addition & 1 deletion bin/package_android
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ docker run --rm \
-e EXT_GOPATH=/ext-go/1 \
-e GO111MODULE=on \
-e GOFLAGS=-mod=mod \
mysteriumnetwork/xgomobile:1.20.2 ./mobile/mysterium
mysteriumnetwork/xgomobile:1.22.2 ./mobile/mysterium

if [[ -f $OUT_FILENAME_AAR ]]; then
print_success "Android package ${OUT_FILENAME_AAR} build complete!"
Expand Down
2 changes: 1 addition & 1 deletion ci/packages/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func GenerateDocs() error {

// GetSwagger installs swagger tool.
func GetSwagger() error {
err := sh.RunV("go", "install", "github.com/go-swagger/go-swagger/cmd/swagger@v0.30.4")
err := sh.RunV("go", "install", "github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0")
if err != nil {
fmt.Println("could not go get swagger")
return err
Expand Down
3 changes: 2 additions & 1 deletion ci/packages/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ func PackageDockerSwaggerRedoc() error {
}

func goGet(pkg string) error {
return sh.RunWith(map[string]string{"GO111MODULE": "off"}, "go", "get", "-u", pkg)
// don't use GO111MODULE=off with Go 1.22, as it's not supported
return sh.Run("go", "get", "-u", pkg)
}

func packageStandalone(binaryPath, os, arch string, extraEnvs map[string]string) error {
Expand Down
21 changes: 10 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/mysteriumnetwork/node

go 1.19
go 1.22.0

toolchain go1.22.2

require (
github.com/BurntSushi/toml v1.3.2
Expand Down Expand Up @@ -66,12 +68,12 @@ require (
golang.org/x/net v0.24.0
golang.org/x/oauth2 v0.13.0
golang.org/x/sys v0.19.0
golang.org/x/time v0.4.0
golang.org/x/time v0.5.0
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20211230205640-daad0b7ba671
golang.zx2c4.com/wireguard/windows v0.5.3
google.golang.org/protobuf v1.31.0
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259
google.golang.org/protobuf v1.32.0
gvisor.dev/gvisor v0.0.0-20240420021641-b12088a5ac74 // release-20240422.0 @go branch
)

require (
Expand Down Expand Up @@ -140,7 +142,7 @@ require (
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gopacket v1.1.19 // indirect
Expand Down Expand Up @@ -255,9 +257,9 @@ require (
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.15.0 // indirect
golang.org/x/tools v0.16.1 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
google.golang.org/appengine v1.6.8 // indirect
gopkg.in/intercom/intercom-go.v2 v2.0.0-20210504094731-2bd1af0ce4b2 // indirect
Expand All @@ -268,7 +270,4 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace (
golang.zx2c4.com/wireguard => github.com/mysteriumnetwork/wireguard-go v0.0.0-20240416113031-406b13e8996a
//gvisor.dev/gvisor => github.com/mysteriumnetwork/gvisor v0.0.0-20240206094932-ff91e662b9e8
)
replace golang.zx2c4.com/wireguard => github.com/mysteriumnetwork/wireguard-go v0.0.0-20240416113031-406b13e8996a
Loading

0 comments on commit 1f879f5

Please sign in to comment.