From e829e2a2151e5bd3989dbdde947a41ff6175282b Mon Sep 17 00:00:00 2001 From: josc146 Date: Sun, 20 Oct 2024 15:32:51 +0800 Subject: [PATCH] potential crash fix (#396) --- .github/workflows/pre-release.yml | 20 ++++++++++------ .github/workflows/release.yml | 12 +++++----- Makefile | 7 +++++- go.mod | 14 ++++++----- go.sum | 24 +++++++++---------- .../site-packages/cyac-1.9.dist-info/.gitkeep | 0 py310/Lib/site-packages/cyac/.gitkeep | 0 7 files changed, 45 insertions(+), 32 deletions(-) create mode 100644 py310/Lib/site-packages/cyac-1.9.dist-info/.gitkeep create mode 100644 py310/Lib/site-packages/cyac/.gitkeep diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 46bee8e0..1a87bcc2 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -18,7 +18,7 @@ jobs: ref: master - uses: actions/setup-go@v5 with: - go-version: "1.20.5" + go-version: "1.20.14" - uses: actions/setup-python@v5 id: cp310 with: @@ -31,6 +31,7 @@ jobs: Start-BitsTransfer https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_windows_x86_64.exe ./backend-rust/web-rwkv-converter.exe Start-BitsTransfer https://github.com/josStorer/LibreHardwareMonitor.Console/releases/latest/download/LibreHardwareMonitor.Console.zip ./LibreHardwareMonitor.Console.zip Expand-Archive ./LibreHardwareMonitor.Console.zip -DestinationPath ./components/LibreHardwareMonitor.Console + del ./py310 -Recurse -Force Start-BitsTransfer https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip ./python-3.10.11-embed-amd64.zip Expand-Archive ./python-3.10.11-embed-amd64.zip -DestinationPath ./py310 $content=Get-Content "./py310/python310._pth"; $content | ForEach-Object {if ($_.ReadCount -eq 3) {"Lib\\site-packages"} else {$_}} | Set-Content ./py310/python310._pth @@ -39,7 +40,7 @@ jobs: Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../include" -Destination "py310/include" -Recurse Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../libs" -Destination "py310/libs" -Recurse ./py310/python -m pip install cyac==1.9 - go install github.com/wailsapp/wails/v2/cmd/wails@v2.8.0 + go install github.com/wailsapp/wails/v2/cmd/wails@v2.9.2 del ./backend-python/rwkv_pip/cpp/librwkv.dylib del ./backend-python/rwkv_pip/cpp/librwkv.so (Get-Content -Path ./backend-golang/app.go) -replace "//go:custom_build windows ", "" | Set-Content -Path ./backend-golang/app.go @@ -47,11 +48,16 @@ jobs: go install mvdan.cc/garble@v0.10.1 make Rename-Item -Path "build/bin/RWKV-Runner.exe" -NewName "RWKV-Runner_windows_x64.exe" + make debug + Rename-Item -Path "build/bin/RWKV-Runner.exe" -NewName "RWKV-Runner-windows_debug.exe" + - uses: actions/upload-artifact@v4 with: name: RWKV-Runner_windows_x64.exe - path: build/bin/RWKV-Runner_windows_x64.exe + path: | + build/bin/RWKV-Runner_windows_x64.exe + build/bin/RWKV-Runner-windows_debug.exe linux: runs-on: ubuntu-20.04 @@ -61,14 +67,14 @@ jobs: ref: master - uses: actions/setup-go@v5 with: - go-version: "1.20.5" + go-version: "1.20.14" - run: | wget https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_linux_x86_64 -O ./backend-rust/webgpu_server wget https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_linux_x86_64 -O ./backend-rust/web-rwkv-converter sudo apt-get update sudo apt-get install upx sudo apt-get install build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libasound2-dev - go install github.com/wailsapp/wails/v2/cmd/wails@v2.8.0 + go install github.com/wailsapp/wails/v2/cmd/wails@v2.9.2 rm ./backend-python/rwkv_pip/wkv_cuda.pyd rm ./backend-python/rwkv_pip/rwkv5.pyd rm ./backend-python/rwkv_pip/rwkv6.pyd @@ -93,11 +99,11 @@ jobs: ref: master - uses: actions/setup-go@v5 with: - go-version: "1.20.5" + go-version: "1.20.14" - run: | wget https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_darwin_aarch64 -O ./backend-rust/webgpu_server wget https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_darwin_aarch64 -O ./backend-rust/web-rwkv-converter - go install github.com/wailsapp/wails/v2/cmd/wails@v2.8.0 + go install github.com/wailsapp/wails/v2/cmd/wails@v2.9.2 rm ./backend-python/rwkv_pip/wkv_cuda.pyd rm ./backend-python/rwkv_pip/rwkv5.pyd rm ./backend-python/rwkv_pip/rwkv6.pyd diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ce3be51..88026fe5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: ref: master - uses: actions/setup-go@v5 with: - go-version: "1.20.5" + go-version: "1.20.14" - uses: actions/setup-python@v5 id: cp310 with: @@ -67,7 +67,7 @@ jobs: Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../include" -Destination "py310/include" -Recurse Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../libs" -Destination "py310/libs" -Recurse ./py310/python -m pip install cyac==1.9 - go install github.com/wailsapp/wails/v2/cmd/wails@v2.8.0 + go install github.com/wailsapp/wails/v2/cmd/wails@v2.9.2 del ./backend-python/rwkv_pip/cpp/librwkv.dylib del ./backend-python/rwkv_pip/cpp/librwkv.so (Get-Content -Path ./backend-golang/app.go) -replace "//go:custom_build windows ", "" | Set-Content -Path ./backend-golang/app.go @@ -87,14 +87,14 @@ jobs: ref: master - uses: actions/setup-go@v5 with: - go-version: "1.20.5" + go-version: "1.20.14" - run: | wget https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_linux_x86_64 -O ./backend-rust/webgpu_server wget https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_linux_x86_64 -O ./backend-rust/web-rwkv-converter sudo apt-get update sudo apt-get install upx sudo apt-get install build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libasound2-dev - go install github.com/wailsapp/wails/v2/cmd/wails@v2.8.0 + go install github.com/wailsapp/wails/v2/cmd/wails@v2.9.2 rm ./backend-python/rwkv_pip/wkv_cuda.pyd rm ./backend-python/rwkv_pip/rwkv5.pyd rm ./backend-python/rwkv_pip/rwkv6.pyd @@ -117,11 +117,11 @@ jobs: ref: master - uses: actions/setup-go@v5 with: - go-version: "1.20.5" + go-version: "1.20.14" - run: | wget https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_darwin_aarch64 -O ./backend-rust/webgpu_server wget https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_darwin_aarch64 -O ./backend-rust/web-rwkv-converter - go install github.com/wailsapp/wails/v2/cmd/wails@v2.8.0 + go install github.com/wailsapp/wails/v2/cmd/wails@v2.9.2 rm ./backend-python/rwkv_pip/wkv_cuda.pyd rm ./backend-python/rwkv_pip/rwkv5.pyd rm ./backend-python/rwkv_pip/rwkv6.pyd diff --git a/Makefile b/Makefile index 35c1d1d8..9e917f6f 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,14 @@ else build: build-linux endif +windows_build = wails build -ldflags '-s -w -extldflags "-static"' -platform windows/amd64 -devtools -upx -upxflags "-9 --lzma" + build-windows: @echo ---- build for windows - wails build -ldflags '-s -w -extldflags "-static"' -platform windows/amd64 -devtools -upx -upxflags "-9 --lzma" -nsis + $(windows_build) -nsis + +debug: + $(windows_build) -windowsconsole build-macos: @echo ---- build for macos diff --git a/go.mod b/go.mod index c62df0e0..6988dbc5 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,11 @@ require ( github.com/minio/selfupdate v0.6.0 github.com/nyaosorg/go-windows-su v0.2.1 github.com/ubuntu/gowsl v0.0.0-20230615094051-94945650cc1e - github.com/wailsapp/wails/v2 v2.8.0 + github.com/wailsapp/wails/v2 v2.9.2 ) +replace github.com/wailsapp/go-webview2 => github.com/satisfactorymodding/go-webview2 v0.0.0-20241013154245-78eb3c780dee + require ( aead.dev/minisign v0.2.0 // indirect github.com/bep/debounce v1.2.1 // indirect @@ -36,11 +38,11 @@ require ( github.com/ubuntu/decorate v0.0.0-20230125165522-2d5b0a9bb117 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect - github.com/wailsapp/go-webview2 v1.0.10 // indirect + github.com/wailsapp/go-webview2 v1.0.16 // indirect github.com/wailsapp/mimetype v1.4.1 // indirect - golang.org/x/crypto v0.18.0 // indirect + golang.org/x/crypto v0.23.0 // indirect golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect ) diff --git a/go.sum b/go.sum index f091f82b..674d1f15 100644 --- a/go.sum +++ b/go.sum @@ -60,6 +60,8 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM= github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= +github.com/satisfactorymodding/go-webview2 v0.0.0-20241013154245-78eb3c780dee h1:KoyT5gSoFXfy+d7jPY9PEXfv/X9APV9UbNU1+RMFkVY= +github.com/satisfactorymodding/go-webview2 v0.0.0-20241013154245-78eb3c780dee/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -77,24 +79,22 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/wailsapp/go-webview2 v1.0.10 h1:PP5Hug6pnQEAhfRzLCoOh2jJaPdrqeRgJKZhyYyDV/w= -github.com/wailsapp/go-webview2 v1.0.10/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo= github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs= github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o= -github.com/wailsapp/wails/v2 v2.8.0 h1:b2NNn99uGPiN6P5bDsnPwOJZWtAOUhNLv7Vl+YxMTr4= -github.com/wailsapp/wails/v2 v2.8.0/go.mod h1:EFUGWkUX3KofO4fmKR/GmsLy3HhPH7NbyOEaMt8lBF0= +github.com/wailsapp/wails/v2 v2.9.2 h1:Xb5YRTos1w5N7DTMyYegWaGukCP2fIaX9WF21kPPF2k= +github.com/wailsapp/wails/v2 v2.9.2/go.mod h1:uehvlCwJSFcBq7rMCGfk4rxca67QQGsbg5Nm4m9UnBs= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -111,14 +111,14 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/py310/Lib/site-packages/cyac-1.9.dist-info/.gitkeep b/py310/Lib/site-packages/cyac-1.9.dist-info/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/py310/Lib/site-packages/cyac/.gitkeep b/py310/Lib/site-packages/cyac/.gitkeep new file mode 100644 index 00000000..e69de29b