]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Fix golang remove precompiled .a files
authorqydysky <qydysky@foxmail.com>
Sat, 8 Apr 2023 16:59:00 +0000 (00:59 +0800)
committerqydysky <qydysky@foxmail.com>
Sat, 8 Apr 2023 16:59:00 +0000 (00:59 +0800)
.github/workflows/go.yml
.github/workflows/test.yml
README.md
demo/Autoban.txt [deleted file]

index a7fac3af73ae8ee9edb062896a99338b94ec7b83..a713bdea2527a3550765af57a51a49ee8cf2765d 100644 (file)
@@ -29,8 +29,8 @@ jobs:
         sudo apt-get install libgtk-3-dev libcairo2-dev libglib2.0-dev
         cd demo
         go get .
-        go build -v -buildmode=exe -tags 'gtk gtk_3_24' -o demo.gtk.run main.go
-        go build -v -buildmode=exe -o demo.run main.go
+        CGO_ENABLED=0 go build -v -buildmode=exe -tags 'gtk gtk_3_24' -o demo.gtk.run main.go
+        CGO_ENABLED=0 go build -v -buildmode=exe -o demo.run main.go
       
     - name: zip
       run: zip -q -r ubuntu_go${{ matrix.go }}.zip *
@@ -61,7 +61,7 @@ jobs:
       run: |
         cd demo
         go get .
-        go build -v -buildmode=exe -o demo.exe main.go
+        CGO_ENABLED=0 go build -v -buildmode=exe -o demo.exe main.go
         
     - name: zip
       run: .\7za.exe a -r .\windows_go${{ matrix.go }}.zip ./
index 501ac103f3485c740852a7bed26c58669cd70aec..1193fdd23e9b2d586edb31eae4dabbe2e75c7d2f 100644 (file)
@@ -27,8 +27,8 @@ jobs:
         sudo apt-get install libgtk-3-dev libcairo2-dev libglib2.0-dev
         cd demo
         go get .
-        go build -v -buildmode=exe -tags 'gtk gtk_3_24' -o demo.gtk.run main.go
-        go build -v -buildmode=exe -o demo.run main.go
+        CGO_ENABLED=0 go build -v -buildmode=exe -tags 'gtk gtk_3_24' -o demo.gtk.run main.go
+        CGO_ENABLED=0 go build -v -buildmode=exe -o demo.run main.go
       
     - name: zip
       run: zip -q -r ubuntu_go${{ matrix.go }}.zip *
@@ -57,7 +57,7 @@ jobs:
       run: |
         cd demo
         go get .
-        go build -v -buildmode=exe -o demo.exe main.go
+        CGO_ENABLED=0 go build -v -buildmode=exe -o demo.exe main.go
         
     - name: zip
       run: .\7za.exe a -r .\windows_go${{ matrix.go }}.zip ./
index cb6dc40bc30a919e26a8e6a90eb0dd7fcd930119..2ee0f1dfb59028dba24f32b24724afce1069dedd 100644 (file)
--- a/README.md
+++ b/README.md
@@ -453,9 +453,9 @@ go build -v -tags `gtk` -o demo.exe -i main.go
 
 clone/下载本项目。进入`demo`目录(文件夹),运行:
 ```
-go build [-tags "gtk"] main.go
+CGO_ENABLED=0 go build [-tags "gtk"] .
 ```
-再运行生成的`main.exe`或`main`
+再运行生成的`demo.exe`或`demo`
 
 2. 即时编译
 
@@ -463,7 +463,7 @@ go build [-tags "gtk"] main.go
 
 clone/下载本项目。进入`demo`目录(文件夹),运行:
 ```
-go run [-tags "gtk"] main.go [-r 房间ID] [-ckv 自定义config_K_v.json]
+CGO_ENABLED=0 go run [-tags "gtk"] . [-r 房间ID] [-ckv 自定义config_K_v.json]
 ```
 
 3. docker部署
@@ -480,7 +480,7 @@ apt-get update && apt-get install -y ca-certificates openssl
 clone/下载本项目。进入`demo`目录(文件夹),运行:
 ```
 set GOOS=linux
-go build main.go
+CGO_ENABLED=0 go build .
 ```
 
 注意实际使用时,在`config_K_v.json`关闭`tts`等需要关闭界面及音频的功能,配置好录播存放位置,做好直播流服务的端口映射
@@ -498,6 +498,7 @@ go build main.go
 * 法1,2,3建议使用最新提交
 * 弹幕及礼物会记录于danmu.log中
 * 部分功能(如签到、发送弹幕、获取原画等)**需要在`demo`目录(文件夹)下放置`cookie.txt`才可用** 或 **运行时按提示使用扫码登录成功后才可用(登录信息会保存在`demo/cookie.txt`中)**
+* 在golang1.20+,由于某些[原因](https://github.com/golang/go/issues/57328#issuecomment-1353413399),你可能需要在构建时添加`CGO_ENABLED=0`
 * 由于通常是发现功能不正常时,才会检查b站是否更新,又因日常录播并不会使用到全部功能,所以并不能确保全部功能都能正常运行
 
 ### 效果展示
diff --git a/demo/Autoban.txt b/demo/Autoban.txt
deleted file mode 100644 (file)
index 3e47259..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-护士
-群
-学妹
-品屎
-娘炮
-呦钕
-菜
-垃圾
-媳妇的妹换衣服点我
-铭少籹
-来签名婕光了啊免费
-自拍洗造点浅
-不穿内騒
-打开看黄色屎
-0123456789
\ No newline at end of file