Compare commits
3 Commits
7284b9d4b9
...
81d73e9b08
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81d73e9b08 | ||
|
|
36111ff781 | ||
|
|
3a1db4e80c |
@@ -12,6 +12,7 @@ jobs:
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21'
|
||||
cache: false
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
|
||||
@@ -14,7 +14,8 @@ jobs:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.21' # Adjust to your version
|
||||
go-version: '1.21'
|
||||
cache: false
|
||||
|
||||
- name: Setup MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
@@ -34,9 +35,14 @@ jobs:
|
||||
# Ensure Go can find the C libraries via pkg-config
|
||||
export CGO_ENABLED=1
|
||||
go build -o dist/tui_windows.exe ./cmd/tui
|
||||
# Copy necessary DLLs for portability
|
||||
cp /mingw64/bin/libogg-0.dll dist/
|
||||
cp /mingw64/bin/libopus-0.dll dist/
|
||||
cp /mingw64/bin/libopusfile-0.dll dist/
|
||||
cp /mingw64/bin/libportaudio-2.dll dist/ || true
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: tui-windows-binary
|
||||
path: dist/tui_windows.exe
|
||||
path: dist/
|
||||
|
||||
@@ -4,7 +4,8 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func redirectStderr(f *os.File) {
|
||||
@@ -12,12 +13,12 @@ func redirectStderr(f *os.File) {
|
||||
// Silence altogether if no debug file
|
||||
null, err := os.OpenFile(os.DevNull, os.O_WRONLY, 0)
|
||||
if err == nil {
|
||||
syscall.Dup2(int(null.Fd()), int(os.Stderr.Fd()))
|
||||
_ = unix.Dup2(int(null.Fd()), int(os.Stderr.Fd()))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Redirect fd 2 (stderr) to our debug file
|
||||
// This captures C-level library noise (ALSA, PortAudio) into the log
|
||||
syscall.Dup2(int(f.Fd()), int(os.Stderr.Fd()))
|
||||
_ = unix.Dup2(int(f.Fd()), int(os.Stderr.Fd()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user