Skip to content

Add GitHub Actions workflow to build Windows binaries via MSYS2#1

Closed
Copilot wants to merge 4 commits intomasterfrom
copilot/create-github-actions-windows
Closed

Add GitHub Actions workflow to build Windows binaries via MSYS2#1
Copilot wants to merge 4 commits intomasterfrom
copilot/create-github-actions-windows

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 21, 2026

No CI existed for building native Windows binaries. This adds a GitHub Actions workflow that compiles scws, scws-gen-dict, and libscws on Windows using MSYS2/MinGW64 and autotools.

Workflow: .github/workflows/build-windows.yml

  • Triggers: push, pull request, published release, workflow_dispatch
  • Runner: windows-latest with MSYS2 MINGW64 shell
  • Toolchain: GCC + autoconf/automake/libtool via MSYS2 packages
  • Build: autoreconf -fiv./configure --disable-shared --enable-staticmakemake install
  • Artifact: uploads scws.exe, scws-gen-dict.exe, and .a static libs as scws-windows-x64; fails explicitly if any expected binary is missing
  • Permissions: contents: read (least-privilege)

@siujamo
Copy link
Copy Markdown

siujamo commented Apr 21, 2026

@copilot Error occurred while generate build system, error logs are as follows:

autoreconf-2.73: export WARNINGS=
autoreconf-2.73: Entering directory '.'
autoreconf-2.73: configure.ac: no obvious need to run autopoint
autoreconf-2.73: running: aclocal --force 
autoreconf-2.73: configure.ac: tracing
autoreconf-2.73: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf-2.73: configure.ac: not using Intltool
autoreconf-2.73: configure.ac: not using Gtkdoc
autoreconf-2.73: configure.ac: no need to run autopoint (confirmed)
autoreconf-2.73: running: aclocal --force 
autoreconf-2.73: running: /usr/bin/autoconf-2.73 --force
configure.ac:29: warning: The macro 'AC_PROG_LIBTOOL' is obsolete.
configure.ac:29: You should run autoupdate.
aclocal.m4:122: AC_PROG_LIBTOOL is expanded from...
configure.ac:29: the top level
configure.ac:41: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:41: You should run autoupdate.
../autoconf-2.73/lib/autoconf/general.m4:205: AC_HELP_STRING is expanded from...
configure.ac:41: the top level
configure.ac:60: warning: The macro 'AC_HELP_STRING' is obsolete.
configure.ac:60: You should run autoupdate.
../autoconf-2.73/lib/autoconf/general.m4:205: AC_HELP_STRING is expanded from...
configure.ac:60: the top level
configure.ac:73: warning: The macro 'AC_HEADER_TIME' is obsolete.
configure.ac:73: You should run autoupdate.
../autoconf-2.73/lib/autoconf/headers.m4:703: AC_HEADER_TIME is expanded from...
configure.ac:73: the top level
configure.ac:80: warning: The macro 'AC_TRY_COMPILE' is obsolete.
configure.ac:80: You should run autoupdate.
../autoconf-2.73/lib/autoconf/general.m4:2903: AC_TRY_COMPILE is expanded from...
configure.ac:80: the top level
autoreconf-2.73: running: /usr/bin/autoheader-2.73 --force
autoreconf-2.73: running: automake --add-missing --copy --force-missing
configure.ac:23: installing './compile'
configure.ac:29: installing './config.guess'
configure.ac:29: installing './config.sub'
configure.ac:9: installing './install-sh'
configure.ac:9: installing './missing'
Makefile.am:24: error: '#' comment at start of rule is unportable
Makefile.am: installing './INSTALL'
cli/Makefile.am:8: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
cli/Makefile.am: installing './depcomp'
autoreconf-2.73: error: automake failed with exit status: 1
Error: Process completed with exit code 1.

Copy link
Copy Markdown
Author

Copilot AI commented Apr 21, 2026

@copilot Error occurred while generate build system, error logs are as follows:

...

Fixed in commit 3a2337e. The root cause was a # comment character after a tab inside the sync-web recipe body in Makefile.am (line 24). Newer automake rejects this as unportable. Removed the dead commented-out #unison line — the rsync command below it remains intact.

Copilot AI requested a review from siujamo April 21, 2026 08:31
@siujamo siujamo marked this pull request as ready for review April 21, 2026 08:32
@siujamo
Copy link
Copy Markdown

siujamo commented Apr 21, 2026

@copilot Error occurred when Build, error logs are as follows:

make  all-recursive
make[1]: Entering directory '/d/a/scws/scws'
Making all in .
make[2]: Entering directory '/d/a/scws/scws'
make[2]: Leaving directory '/d/a/scws/scws'
Making all in libscws
make[2]: Entering directory '/d/a/scws/scws/libscws'
/bin/sh ../libtool --preserve-dup-deps   --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT charset.lo -MD -MP -MF .deps/charset.Tpo -c -o charset.lo charset.c
/bin/sh ../libtool --preserve-dup-deps   --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT crc32.lo -MD -MP -MF .deps/crc32.Tpo -c -o crc32.lo crc32.c
/bin/sh ../libtool --preserve-dup-deps   --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT pool.lo -MD -MP -MF .deps/pool.Tpo -c -o pool.lo pool.c
/bin/sh ../libtool --preserve-dup-deps   --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT scws.lo -MD -MP -MF .deps/scws.Tpo -c -o scws.lo scws.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT charset.lo -MD -MP -MF .deps/charset.Tpo -c charset.c -o charset.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT pool.lo -MD -MP -MF .deps/pool.Tpo -c pool.c -o pool.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT scws.lo -MD -MP -MF .deps/scws.Tpo -c scws.c -o scws.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT crc32.lo -MD -MP -MF .deps/crc32.Tpo -c crc32.c -o crc32.o
mv -f .deps/crc32.Tpo .deps/crc32.Plo
/bin/sh ../libtool --preserve-dup-deps   --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT xdict.lo -MD -MP -MF .deps/xdict.Tpo -c -o xdict.lo xdict.c
mv -f .deps/pool.Tpo .deps/pool.Plo
/bin/sh ../libtool --preserve-dup-deps   --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT darray.lo -MD -MP -MF .deps/darray.Tpo -c -o darray.lo darray.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT xdict.lo -MD -MP -MF .deps/xdict.Tpo -c xdict.c -o xdict.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT darray.lo -MD -MP -MF .deps/darray.Tpo -c darray.c -o darray.o
mv -f .deps/darray.Tpo .deps/darray.Plo
/bin/sh ../libtool --preserve-dup-deps   --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT rule.lo -MD -MP -MF .deps/rule.Tpo -c -o rule.lo rule.c
In file included from scws.c:13:
config_win32.h:19:23: error: expected identifier or '(' before 'float'
   19 | #define logf(x)     ((float)log((double)(x)))
      |                       ^~~~~
config_win32.h:19:29: error: expected ')' before 'log'
   19 | #define logf(x)     ((float)log((double)(x)))
      |                             ^~~
scws.c: In function '_tops_cmp':
scws.c:1293:12: warning: old-style function definition [-Wold-style-definition]
 1293 | static int _tops_cmp(a, b)
      |            ^~~~~~~~~
make[2]: *** [Makefile:452: scws.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/charset.Tpo .deps/charset.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT rule.lo -MD -MP -MF .deps/rule.Tpo -c rule.c -o rule.o
mv -f .deps/xdict.Tpo .deps/xdict.Plo
mv -f .deps/rule.Tpo .deps/rule.Plo
make[2]: Leaving directory '/d/a/scws/scws/libscws'
make[1]: *** [Makefile:406: all-recursive] Error 1
make[1]: Leaving directory '/d/a/scws/scws'
make: *** [Makefile:338: all] Error 2
Error: Process completed with exit code 2.

…standard function

Agent-Logs-Url: https://github.com/quanta-tech-cn/scws/sessions/e7102747-cc67-40d7-9b0e-cc8636a1e032

Co-authored-by: siujamo <168176399+siujamo@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Apr 21, 2026

@copilot Error occurred when Build, error logs are as follows:

...

Fixed in commit ad1511e. The issue was in libscws/config_win32.h: the #ifndef logf guard only checks for a preprocessor macro, but MinGW provides logf as a standard library function (not a macro). This caused the macro definition to be injected, and when <math.h> was later included in scws.c, the preprocessor tried to expand the logf function prototype through the macro — producing invalid syntax. Changed the guard to #if !defined(__MINGW32__) && !defined(logf) so the fallback macro is only defined on MSVC, where older versions lacked logf.

@siujamo siujamo closed this Apr 28, 2026
@siujamo siujamo deleted the copilot/create-github-actions-windows branch April 28, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants