From 055a02ac6a816626db5bbd2c2bad8e78819961d0 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 15:18:16 -0500 Subject: [PATCH 01/15] feat: windows build --- build.ps1 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ cmd/boot/main.go | 21 ++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 build.ps1 diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 00000000..c98dd83e --- /dev/null +++ b/build.ps1 @@ -0,0 +1,50 @@ +# build.ps1 + +Write-Host "Checking dependencies..." -ForegroundColor Cyan +if (-not (Get-Command "gcc" -ErrorAction SilentlyContinue)) { + Write-Error "GCC not found. Please ensure MSYS2 MinGW64 bin folder is in your PATH." + exit 1 +} + +# 1. Setup Environment Variables +$env:GOOS = "windows" +$env:GOARCH = "amd64" +$env:CGO_ENABLED = "1" # Required for libwebp and sqlite + +# 2. Get Version Info (mimicking Docker ARGs) +$VERSION = "dev" +$COMMIT = "unknown" +$DATE = Get-Date -Format "yyyy-MM-dd" + +if (Test-Path .git) { + $COMMIT = git rev-parse --short HEAD + $VERSION = git describe --tags --always --dirty +} + +Write-Host "Building Tronbyt Server ($VERSION)..." -ForegroundColor Green + +# 3. Download Dependencies +go mod download + +# 4. Build 'boot' (Entrypoint wrapper) +# Note: Usually on Windows you don't need this wrapper, but building it just in case. +# Boot is CGO-free (CGO_ENABLED=0), so we toggle it off briefly. +$env:CGO_ENABLED = "0" +go build -ldflags="-w -s" -o boot.exe ./cmd/boot +$env:CGO_ENABLED = "1" + +# 5. Build 'tronbyt-server' (The Main App) +$LDFLAGS = "-w -s -extldflags '-static' -X 'tronbyt-server/internal/version.Version=$VERSION' -X 'tronbyt-server/internal/version.Commit=$COMMIT' -X 'tronbyt-server/internal/version.BuildDate=$DATE'" + +go build -ldflags="$LDFLAGS" -tags gzip_fonts -o tronbyt-server.exe ./cmd/server + +if ($LASTEXITCODE -ne 0) { + Write-Error "Server build failed!" + exit 1 +} + +# 6. Build 'migrate' (Database tool) +go build -ldflags="-w -s" -o migrate.exe ./cmd/migrate + +Write-Host "Build Complete!" -ForegroundColor Green +Write-Host "Run the server using: .\start.bat" -ForegroundColor Yellow \ No newline at end of file diff --git a/cmd/boot/main.go b/cmd/boot/main.go index 0fd1e441..130cc59a 100644 --- a/cmd/boot/main.go +++ b/cmd/boot/main.go @@ -13,6 +13,27 @@ func main() { uid := 1000 gid := 1000 + // Add standalone Windows .exe support (create data folder next to .exe) + if os.Getenv("DATA_DIR") == "" { + // Get the directory of the running .exe + ex, _ := os.Executable() + exePath := filepath.Dir(ex) + + // Force the app to look for data next to the .exe + os.Setenv("DATA_DIR", filepath.Join(exePath, "data")) + } + + // 2. Set default Database Path if env var is missing + if os.Getenv("DB_DSN") == "" { + dataDir := os.Getenv("DATA_DIR") + os.Setenv("DB_DSN", filepath.Join(dataDir, "tronbyt.db")) + } + + // 3. Auto-create the data folder so the user doesn't have to + if err := os.MkdirAll(os.Getenv("DATA_DIR"), 0755); err != nil { + panic("Could not create data directory: " + err.Error()) + } + if s := os.Getenv("PUID"); s != "" { if i, err := strconv.Atoi(s); err != nil { slog.Warn("Invalid PUID value, using default", "puid", s, "error", err) From bbfc68a24061b709e5fddd5f7b6b807a85d18987 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 15:21:20 -0500 Subject: [PATCH 02/15] update comments --- build.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build.ps1 b/build.ps1 index c98dd83e..32ee028a 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,5 +1,3 @@ -# build.ps1 - Write-Host "Checking dependencies..." -ForegroundColor Cyan if (-not (Get-Command "gcc" -ErrorAction SilentlyContinue)) { Write-Error "GCC not found. Please ensure MSYS2 MinGW64 bin folder is in your PATH." @@ -11,7 +9,7 @@ $env:GOOS = "windows" $env:GOARCH = "amd64" $env:CGO_ENABLED = "1" # Required for libwebp and sqlite -# 2. Get Version Info (mimicking Docker ARGs) +# 2. Get Version Info $VERSION = "dev" $COMMIT = "unknown" $DATE = Get-Date -Format "yyyy-MM-dd" @@ -33,7 +31,7 @@ $env:CGO_ENABLED = "0" go build -ldflags="-w -s" -o boot.exe ./cmd/boot $env:CGO_ENABLED = "1" -# 5. Build 'tronbyt-server' (The Main App) +# 5. Build 'tronbyt-server' $LDFLAGS = "-w -s -extldflags '-static' -X 'tronbyt-server/internal/version.Version=$VERSION' -X 'tronbyt-server/internal/version.Commit=$COMMIT' -X 'tronbyt-server/internal/version.BuildDate=$DATE'" go build -ldflags="$LDFLAGS" -tags gzip_fonts -o tronbyt-server.exe ./cmd/server From e914cec76212a8c35d0c6d6d75a0cb50512e0fcf Mon Sep 17 00:00:00 2001 From: Noah Podgurski <42069075+noahpodgurski@users.noreply.github.com> Date: Fri, 23 Jan 2026 15:22:03 -0500 Subject: [PATCH 03/15] Update cmd/boot/main.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- cmd/boot/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/boot/main.go b/cmd/boot/main.go index 130cc59a..d001faac 100644 --- a/cmd/boot/main.go +++ b/cmd/boot/main.go @@ -16,7 +16,10 @@ func main() { // Add standalone Windows .exe support (create data folder next to .exe) if os.Getenv("DATA_DIR") == "" { // Get the directory of the running .exe - ex, _ := os.Executable() + ex, err := os.Executable() + if err != nil { + panic("Could not get executable path: " + err.Error()) + } exePath := filepath.Dir(ex) // Force the app to look for data next to the .exe From d6dda766a303ea2c9d82554348e6f62851fb480c Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 15:23:23 -0500 Subject: [PATCH 04/15] address comments --- build.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 32ee028a..f150a350 100644 --- a/build.ps1 +++ b/build.ps1 @@ -15,6 +15,10 @@ $COMMIT = "unknown" $DATE = Get-Date -Format "yyyy-MM-dd" if (Test-Path .git) { + if (-not (Get-Command "git" -ErrorAction SilentlyContinue)) { + Write-Error "git not found, but .git directory exists. Cannot determine version information." + exit 1 + } $COMMIT = git rev-parse --short HEAD $VERSION = git describe --tags --always --dirty } @@ -45,4 +49,3 @@ if ($LASTEXITCODE -ne 0) { go build -ldflags="-w -s" -o migrate.exe ./cmd/migrate Write-Host "Build Complete!" -ForegroundColor Green -Write-Host "Run the server using: .\start.bat" -ForegroundColor Yellow \ No newline at end of file From dca6f4186db4b9b11df94eb688259a7c68672755 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 15:34:27 -0500 Subject: [PATCH 05/15] fix: env check syntax --- cmd/boot/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/boot/main.go b/cmd/boot/main.go index d001faac..8d8dadf8 100644 --- a/cmd/boot/main.go +++ b/cmd/boot/main.go @@ -14,7 +14,7 @@ func main() { gid := 1000 // Add standalone Windows .exe support (create data folder next to .exe) - if os.Getenv("DATA_DIR") == "" { + if s := os.Getenv("DATA_DIR"); s != "" { // Get the directory of the running .exe ex, err := os.Executable() if err != nil { @@ -27,7 +27,7 @@ func main() { } // 2. Set default Database Path if env var is missing - if os.Getenv("DB_DSN") == "" { + if s := os.Getenv("DB_DSN"); s != "" { dataDir := os.Getenv("DATA_DIR") os.Setenv("DB_DSN", filepath.Join(dataDir, "tronbyt.db")) } From d2b19acfa08d19f27c2228e92118ada3b713e36c Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 15:37:18 -0500 Subject: [PATCH 06/15] check error on setenv --- cmd/boot/main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/boot/main.go b/cmd/boot/main.go index 8d8dadf8..8bfc4d9b 100644 --- a/cmd/boot/main.go +++ b/cmd/boot/main.go @@ -23,13 +23,18 @@ func main() { exePath := filepath.Dir(ex) // Force the app to look for data next to the .exe - os.Setenv("DATA_DIR", filepath.Join(exePath, "data")) + if err := os.Setenv("DATA_DIR", filepath.Join(exePath, "data")); err != nil { + panic("Could not set DATA_DIR: " + err.Error()) + } } // 2. Set default Database Path if env var is missing if s := os.Getenv("DB_DSN"); s != "" { dataDir := os.Getenv("DATA_DIR") - os.Setenv("DB_DSN", filepath.Join(dataDir, "tronbyt.db")) + if err := os.Setenv("DB_DSN", filepath.Join(dataDir, "tronbyt.db")); err != nil { + panic("Could not set DB_DSN: " + err.Error()) + } + } // 3. Auto-create the data folder so the user doesn't have to From c8b827af45a2574a429b80731d4894d6d4b64d97 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 15:40:13 -0500 Subject: [PATCH 07/15] fix lint --- cmd/boot/main.go | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/cmd/boot/main.go b/cmd/boot/main.go index 8bfc4d9b..06263a97 100644 --- a/cmd/boot/main.go +++ b/cmd/boot/main.go @@ -15,32 +15,31 @@ func main() { // Add standalone Windows .exe support (create data folder next to .exe) if s := os.Getenv("DATA_DIR"); s != "" { - // Get the directory of the running .exe - ex, err := os.Executable() - if err != nil { - panic("Could not get executable path: " + err.Error()) - } - exePath := filepath.Dir(ex) - - // Force the app to look for data next to the .exe - if err := os.Setenv("DATA_DIR", filepath.Join(exePath, "data")); err != nil { - panic("Could not set DATA_DIR: " + err.Error()) - } - } + // Get the directory of the running .exe + ex, err := os.Executable() + if err != nil { + panic("Could not get executable path: " + err.Error()) + } + exePath := filepath.Dir(ex) + + // Force the app to look for data next to the .exe + if err := os.Setenv("DATA_DIR", filepath.Join(exePath, "data")); err != nil { + panic("Could not set DATA_DIR: " + err.Error()) + } + } - // 2. Set default Database Path if env var is missing - if s := os.Getenv("DB_DSN"); s != "" { - dataDir := os.Getenv("DATA_DIR") - if err := os.Setenv("DB_DSN", filepath.Join(dataDir, "tronbyt.db")); err != nil { + // 2. Set default Database Path if env var is missing + if s := os.Getenv("DB_DSN"); s != "" { + dataDir := os.Getenv("DATA_DIR") + if err := os.Setenv("DB_DSN", filepath.Join(dataDir, "tronbyt.db")); err != nil { panic("Could not set DB_DSN: " + err.Error()) } + } - } - - // 3. Auto-create the data folder so the user doesn't have to - if err := os.MkdirAll(os.Getenv("DATA_DIR"), 0755); err != nil { - panic("Could not create data directory: " + err.Error()) - } + // 3. Auto-create the data folder so the user doesn't have to + if err := os.MkdirAll(os.Getenv("DATA_DIR"), 0755); err != nil { + panic("Could not create data directory: " + err.Error()) + } if s := os.Getenv("PUID"); s != "" { if i, err := strconv.Atoi(s); err != nil { From c494ccb15f8702b885b6f40ec81b74f7df5cbcd5 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 16:16:39 -0500 Subject: [PATCH 08/15] add windows build to build.yml workflow --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fc73acd..8858bc11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,6 +59,9 @@ jobs: build-and-test: runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash strategy: matrix: include: @@ -70,15 +73,34 @@ jobs: goos: linux goarch: arm64 artifact_name: tronbyt-server-linux-arm64 - - os: macos-26 + - os: macos-latest goos: darwin goarch: arm64 artifact_name: tronbyt-server-darwin-arm64 + - os: windows-latest + goos: windows + goarch: amd64 + artifact_name: tronbyt-server-windows-amd64.exe steps: - uses: actions/checkout@v6 + # Windows specific setup + # Install GCC and Libwebp + - name: Setup MSYS2 + if: matrix.goos == 'windows' + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + install: >- + mingw-w64-x86_64-gcc + mingw-w64-x86_64-libwebp + pkg-config + + # Linux/Mac specific setup - name: Install system dependencies + if: matrix.goos != 'windows' run: | if [ "$RUNNER_OS" == "Linux" ]; then sudo apt-get update @@ -96,19 +118,29 @@ jobs: run: go mod download - name: Test - # CGO required for pixlet - run: CGO_ENABLED=1 go test -v ./... + env: + CGO_ENABLED: 1 # CGO required for pixlet + run: go test -v ./... - name: Build env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} + CGO_ENABLED: 1 run: | VERSION=${GITHUB_REF_NAME} COMMIT=${GITHUB_SHA} DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + + # Base flags LDFLAGS="-w -s -X 'tronbyt-server/internal/version.Version=${VERSION}' -X 'tronbyt-server/internal/version.Commit=${COMMIT}' -X 'tronbyt-server/internal/version.BuildDate=${DATE}'" - CGO_ENABLED=1 go build -v -ldflags "${LDFLAGS}" -o ${{ matrix.artifact_name }} ./cmd/server + + # Add static flags ONLY for Windows to avoid DLL dependency + if [ "${{ matrix.goos }}" == "windows" ]; then + LDFLAGS="${LDFLAGS} -extldflags '-static'" + fi + + go build -v -ldflags "${LDFLAGS}" -tags gzip_fonts -o ${{ matrix.artifact_name }} ./cmd/server - name: Upload Release Artifacts uses: actions/upload-artifact@v6 From 612faa05c49e3fdf5c528aee090064c256997956 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 18:42:23 -0500 Subject: [PATCH 09/15] rm main.go changes, fix build issue --- .github/workflows/build.yml | 2 +- cmd/boot/main.go | 30 ++---------------------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8858bc11..83d2bc03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,7 +96,7 @@ jobs: install: >- mingw-w64-x86_64-gcc mingw-w64-x86_64-libwebp - pkg-config + mingw-w64-x86_64-pkgconf # Linux/Mac specific setup - name: Install system dependencies diff --git a/cmd/boot/main.go b/cmd/boot/main.go index 06263a97..3d03809d 100644 --- a/cmd/boot/main.go +++ b/cmd/boot/main.go @@ -1,3 +1,5 @@ +//go:build !windows + package main import ( @@ -13,34 +15,6 @@ func main() { uid := 1000 gid := 1000 - // Add standalone Windows .exe support (create data folder next to .exe) - if s := os.Getenv("DATA_DIR"); s != "" { - // Get the directory of the running .exe - ex, err := os.Executable() - if err != nil { - panic("Could not get executable path: " + err.Error()) - } - exePath := filepath.Dir(ex) - - // Force the app to look for data next to the .exe - if err := os.Setenv("DATA_DIR", filepath.Join(exePath, "data")); err != nil { - panic("Could not set DATA_DIR: " + err.Error()) - } - } - - // 2. Set default Database Path if env var is missing - if s := os.Getenv("DB_DSN"); s != "" { - dataDir := os.Getenv("DATA_DIR") - if err := os.Setenv("DB_DSN", filepath.Join(dataDir, "tronbyt.db")); err != nil { - panic("Could not set DB_DSN: " + err.Error()) - } - } - - // 3. Auto-create the data folder so the user doesn't have to - if err := os.MkdirAll(os.Getenv("DATA_DIR"), 0755); err != nil { - panic("Could not create data directory: " + err.Error()) - } - if s := os.Getenv("PUID"); s != "" { if i, err := strconv.Atoi(s); err != nil { slog.Warn("Invalid PUID value, using default", "puid", s, "error", err) From 4cfe5c1d1366897170f9561d57ec9e38228d92be Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 18:55:41 -0500 Subject: [PATCH 10/15] add cgo flags --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83d2bc03..3b226196 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,6 +98,12 @@ jobs: mingw-w64-x86_64-libwebp mingw-w64-x86_64-pkgconf + - name: Set CGO Flags (windows) + if: matrix.goos == 'windows' + run: | + echo "CGO_CFLAGS=-IC:/msys64/mingw64/include" >> $GITHUB_ENV + echo "CGO_LDFLAGS=-LC:/msys64/mingw64/lib -lwebp" >> $GITHUB_ENV + # Linux/Mac specific setup - name: Install system dependencies if: matrix.goos != 'windows' From 360bd48512ee28a5ad7686e9b8c35eaa933e94d7 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 19:07:08 -0500 Subject: [PATCH 11/15] fix windows build --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b226196..c7e0b9ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,6 +92,7 @@ jobs: uses: msys2/setup-msys2@v2 with: msystem: MINGW64 + path-type: inherit update: true install: >- mingw-w64-x86_64-gcc @@ -100,9 +101,15 @@ jobs: - name: Set CGO Flags (windows) if: matrix.goos == 'windows' + shell: bash run: | - echo "CGO_CFLAGS=-IC:/msys64/mingw64/include" >> $GITHUB_ENV - echo "CGO_LDFLAGS=-LC:/msys64/mingw64/lib -lwebp" >> $GITHUB_ENV + MSYS_ROOT=$(cygpath -m /) + echo "Detected MSYS2 Root: $MSYS_ROOT" + + echo "PKG_CONFIG_PATH=${MSYS_ROOT}mingw64/lib/pkgconfig" >> $GITHUB_ENV + + echo "CGO_CFLAGS=-I${MSYS_ROOT}mingw64/include" >> $GITHUB_ENV + echo "CGO_LDFLAGS=-L${MSYS_ROOT}mingw64/lib" >> $GITHUB_ENV # Linux/Mac specific setup - name: Install system dependencies From 6e89fdebedd53093ca9b53036738965b85985a55 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 22:15:38 -0500 Subject: [PATCH 12/15] fix: windows build --- .github/workflows/build.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7e0b9ca..5f106193 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,13 +103,17 @@ jobs: if: matrix.goos == 'windows' shell: bash run: | - MSYS_ROOT=$(cygpath -m /) - echo "Detected MSYS2 Root: $MSYS_ROOT" + # Retrieve the install location from the previous step + MSYS_ROOT="${{ steps.msys2.outputs.msys2-location }}" - echo "PKG_CONFIG_PATH=${MSYS_ROOT}mingw64/lib/pkgconfig" >> $GITHUB_ENV + echo "Using MSYS2 at: $MSYS_ROOT" - echo "CGO_CFLAGS=-I${MSYS_ROOT}mingw64/include" >> $GITHUB_ENV - echo "CGO_LDFLAGS=-L${MSYS_ROOT}mingw64/lib" >> $GITHUB_ENV + # Convert backslashes to forward slashes just in case + MSYS_ROOT=$(echo "$MSYS_ROOT" | sed 's/\\/\//g') + + # Set flags using the clean path (No "Program Files"!) + echo "CGO_CFLAGS=-I${MSYS_ROOT}/mingw64/include" >> $GITHUB_ENV + echo "CGO_LDFLAGS=-L${MSYS_ROOT}/mingw64/lib" >> $GITHUB_EN # Linux/Mac specific setup - name: Install system dependencies From de153988b021bee5b2ca035898f76e2191396857 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 22:21:23 -0500 Subject: [PATCH 13/15] add msys2 id --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f106193..bf2bbebc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,6 +88,7 @@ jobs: # Windows specific setup # Install GCC and Libwebp - name: Setup MSYS2 + id: msys2 if: matrix.goos == 'windows' uses: msys2/setup-msys2@v2 with: From e9c290b0cea23fe165570dac7c39b3795873692a Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 22:27:00 -0500 Subject: [PATCH 14/15] fix: env vars --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf2bbebc..c240f917 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -113,8 +113,8 @@ jobs: MSYS_ROOT=$(echo "$MSYS_ROOT" | sed 's/\\/\//g') # Set flags using the clean path (No "Program Files"!) - echo "CGO_CFLAGS=-I${MSYS_ROOT}/mingw64/include" >> $GITHUB_ENV - echo "CGO_LDFLAGS=-L${MSYS_ROOT}/mingw64/lib" >> $GITHUB_EN + export CGO_CFLAGS="-I${MSYS_ROOT}/mingw64/include" + export CGO_LDFLAGS="-L${MSYS_ROOT}/mingw64/lib # Linux/Mac specific setup - name: Install system dependencies From d671c655a80f65e3e8d15e9e840a7e5074135c9c Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 23 Jan 2026 22:32:39 -0500 Subject: [PATCH 15/15] fix: build --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c240f917..661f8fe5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -109,12 +109,15 @@ jobs: echo "Using MSYS2 at: $MSYS_ROOT" - # Convert backslashes to forward slashes just in case + # Convert backslashes to forward slashes for GCC compatibility MSYS_ROOT=$(echo "$MSYS_ROOT" | sed 's/\\/\//g') - # Set flags using the clean path (No "Program Files"!) - export CGO_CFLAGS="-I${MSYS_ROOT}/mingw64/include" - export CGO_LDFLAGS="-L${MSYS_ROOT}/mingw64/lib + # Write to GITHUB_ENV so following steps (like 'go build') can see them + echo "CGO_CFLAGS=-I${MSYS_ROOT}/mingw64/include" >> "$GITHUB_ENV" + echo "CGO_LDFLAGS=-L${MSYS_ROOT}/mingw64/lib" >> "$GITHUB_ENV" + + # Optional: Add the mingw64 bin folder to PATH so dlls are found during tests + echo "${MSYS_ROOT}/mingw64/bin" >> "$GITHUB_PATH" # Linux/Mac specific setup - name: Install system dependencies