From dca9a6780d81ee0007e2da7f1ba62be874dfd8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 9 Oct 2025 23:44:30 +0800 Subject: [PATCH] Update Go to 1.25.2 --- ..._legacy_go.sh => setup_go_for_windows7.sh} | 22 ++++++----- .github/workflows/build.yml | 38 +++++++++---------- .github/workflows/linux.yml | 4 +- 3 files changed, 33 insertions(+), 31 deletions(-) rename .github/{setup_legacy_go.sh => setup_go_for_windows7.sh} (51%) diff --git a/.github/setup_legacy_go.sh b/.github/setup_go_for_windows7.sh similarity index 51% rename from .github/setup_legacy_go.sh rename to .github/setup_go_for_windows7.sh index d4617e795..cf2730e34 100755 --- a/.github/setup_legacy_go.sh +++ b/.github/setup_go_for_windows7.sh @@ -1,25 +1,27 @@ #!/usr/bin/env bash -VERSION="1.23.12" +VERSION="1.25.2" mkdir -p $HOME/go cd $HOME/go wget "https://dl.google.com/go/go${VERSION}.linux-amd64.tar.gz" tar -xzf "go${VERSION}.linux-amd64.tar.gz" -mv go go_legacy -cd go_legacy +mv go go_win7 +cd go_win7 # modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557 -# this patch file only works on golang1.23.x -# that means after golang1.24 release it must be changed -# see: https://github.com/MetaCubeX/go/commits/release-branch.go1.23/ +# this patch file only works on golang1.25.x +# that means after golang1.26 release it must be changed +# see: https://github.com/MetaCubeX/go/commits/release-branch.go1.25/ # revert: # 693def151adff1af707d82d28f55dba81ceb08e1: "crypto/rand,runtime: switch RtlGenRandom for ProcessPrng" # 7c1157f9544922e96945196b47b95664b1e39108: "net: remove sysSocket fallback for Windows 7" # 48042aa09c2f878c4faa576948b07fe625c4707a: "syscall: remove Windows 7 console handle workaround" # a17d959debdb04cd550016a3501dd09d50cd62e7: "runtime: always use LoadLibraryEx to load system libraries" -curl https://github.com/MetaCubeX/go/commit/9ac42137ef6730e8b7daca016ece831297a1d75b.diff | patch --verbose -p 1 -curl https://github.com/MetaCubeX/go/commit/21290de8a4c91408de7c2b5b68757b1e90af49dd.diff | patch --verbose -p 1 -curl https://github.com/MetaCubeX/go/commit/6a31d3fa8e47ddabc10bd97bff10d9a85f4cfb76.diff | patch --verbose -p 1 -curl https://github.com/MetaCubeX/go/commit/69e2eed6dd0f6d815ebf15797761c13f31213dd6.diff | patch --verbose -p 1 +alias curl='curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"' + +curl https://github.com/MetaCubeX/go/commit/8cb5472d94c34b88733a81091bd328e70ee565a4.diff | patch --verbose -p 1 +curl https://github.com/MetaCubeX/go/commit/6788c4c6f9fafb56729bad6b660f7ee2272d699f.diff | patch --verbose -p 1 +curl https://github.com/MetaCubeX/go/commit/a5b2168bb836ed9d6601c626f95e56c07923f906.diff | patch --verbose -p 1 +curl https://github.com/MetaCubeX/go/commit/f56f1e23507e646c85243a71bde7b9629b2f970c.diff | patch --verbose -p 1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a15c75ca2..14c175b80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.25.1 + go-version: ^1.25.2 - name: Check input version if: github.event_name == 'workflow_dispatch' run: |- @@ -88,9 +88,9 @@ jobs: - { os: linux, arch: loong64, debian: loongarch64, rpm: loongarch64, openwrt: "loongarch64_generic" } - { os: windows, arch: amd64 } - - { os: windows, arch: amd64, legacy_go123: true, legacy_name: "windows-7" } + - { os: windows, arch: amd64, legacy_win7: true, legacy_name: "windows-7" } - { os: windows, arch: "386" } - - { os: windows, arch: "386", legacy_go123: true, legacy_name: "windows-7" } + - { os: windows, arch: "386", legacy_win7: true, legacy_name: "windows-7" } - { os: windows, arch: arm64 } - { os: darwin, arch: amd64 } @@ -110,29 +110,29 @@ jobs: if: ${{ ! (matrix.legacy_go123 || matrix.legacy_go124) }} uses: actions/setup-go@v5 with: - go-version: ^1.25.1 + go-version: ^1.25.2 - name: Setup Go 1.24 if: matrix.legacy_go124 uses: actions/setup-go@v5 with: go-version: ~1.24.6 - - name: Cache Go 1.23 - if: matrix.legacy_go123 - id: cache-legacy-go + - name: Cache Go for Windows 7 + if: matrix.legacy_win7 + id: cache-go-for-windows7 uses: actions/cache@v4 with: path: | - ~/go/go_legacy - key: go_legacy_12312 - - name: Setup Go 1.23 - if: matrix.legacy_go123 && steps.cache-legacy-go.outputs.cache-hit != 'true' + ~/go/go_win7 + key: go_win7_1252 + - name: Setup Go for Windows 7 + if: matrix.legacy_win7 && steps.cache-go-for-windows7.outputs.cache-hit != 'true' run: |- - .github/setup_legacy_go.sh - - name: Setup Go 1.23 - if: matrix.legacy_go123 + .github/setup_go_for_windows7.sh + - name: Setup Go for Windows 7 + if: matrix.legacy_win7 run: |- - echo "PATH=$HOME/go/go_legacy/bin:$PATH" >> $GITHUB_ENV - echo "GOROOT=$HOME/go/go_legacy" >> $GITHUB_ENV + echo "PATH=$HOME/go/go_win7/bin:$PATH" >> $GITHUB_ENV + echo "GOROOT=$HOME/go/go_win7" >> $GITHUB_ENV - name: Setup Android NDK if: matrix.os == 'android' uses: nttld/setup-ndk@v1 @@ -300,7 +300,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.25.1 + go-version: ^1.25.2 - name: Setup Android NDK id: setup-ndk uses: nttld/setup-ndk@v1 @@ -380,7 +380,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.25.1 + go-version: ^1.25.2 - name: Setup Android NDK id: setup-ndk uses: nttld/setup-ndk@v1 @@ -479,7 +479,7 @@ jobs: if: matrix.if uses: actions/setup-go@v5 with: - go-version: ^1.25.1 + go-version: ^1.25.2 - name: Set tag if: matrix.if run: |- diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b43cfb394..693e706d3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -30,7 +30,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.25.1 + go-version: ^1.25.2 - name: Check input version if: github.event_name == 'workflow_dispatch' run: |- @@ -71,7 +71,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.25.1 + go-version: ^1.25.2 - name: Setup Android NDK if: matrix.os == 'android' uses: nttld/setup-ndk@v1