From e3a94b791df5444d28274e3047c482a9df1b94b2 Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Fri, 13 Nov 2026 01:22:40 +0200 Subject: [PATCH 1/3] ci: move the Cygwin build from AppVeyor to GitHub Actions The Cygwin job took 4-6 minutes of each AppVeyor build, and AppVeyor runs one build at a time. The new windows-cygwin job runs the same autotools build on GitHub Actions, in parallel with the other jobs, and also builds with -Werror, checks the installed files and smoke-tests hidtest. AppVeyor keeps the Visual Studio 2015 MSBuild jobs. Assisted-by: claude-code:claude-opus-5-5 --- .appveyor.yml | 37 ++++++------------------ .github/workflows/builds.yml | 56 ++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 28 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index fa2d0c281..eb1d1382a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,13 +4,15 @@ # the VERSION file plus the short commit hash (see below). version: '{build}' +# AppVeyor builds the Visual Studio solution with the Visual Studio 2015 +# toolchain, the oldest MSVC in CI. Everything else, including the Cygwin +# build, runs on GitHub Actions (.github/workflows/builds.yml). +os: Visual Studio 2015 + environment: matrix: - - BUILD_ENV: msbuild - arch: x64 - - BUILD_ENV: msbuild - arch: Win32 - - BUILD_ENV: cygwin + - arch: x64 + - arch: Win32 # Derive the build version from the repo: -., # e.g. 0.16.0-1a2b3c4.42. The build number keeps it unique even if the same @@ -21,26 +23,5 @@ before_build: $short = git rev-parse --short HEAD Update-AppveyorBuild -Version "$base-$short.$env:APPVEYOR_BUILD_NUMBER" -for: - - - matrix: - only: - - BUILD_ENV: msbuild - - os: Visual Studio 2015 - - build_script: - - cmd: msbuild .\windows\hidapi.sln /p:Configuration=Release /p:Platform=%arch% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - - - - matrix: - only: - - BUILD_ENV: cygwin - - os: Visual Studio 2022 - - install: - - cmd: C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages autoconf,automake - - build_script: - - cmd: C:\cygwin64\bin\bash -exlc "cd $APPVEYOR_BUILD_FOLDER; ./bootstrap; ./configure; make" +build_script: + - cmd: msbuild .\windows\hidapi.sln /p:Configuration=Release /p:Platform=%arch% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index a48cdf5f3..2bf5899f1 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -386,6 +386,62 @@ jobs: run: ctest --no-compress-output --output-on-failure + windows-cygwin: + + runs-on: windows-latest + + defaults: + run: + # A login shell with CYGWIN_NOWINPATH set gets a Cygwin-only PATH, so + # no toolchain preinstalled on the runner (MinGW gcc, Strawberry Perl, + # ...) leaks into the build. CHERE_INVOKING keeps the step's working + # directory; igncr because the runner writes step scripts with CRLF. + shell: C:\cygwin\bin\bash.exe --login -o igncr -eo pipefail '{0}' + + env: + CYGWIN_NOWINPATH: 1 + CHERE_INVOKING: 1 + + steps: + # The autotools under Cygwin need LF line endings, not the runner's + # default core.autocrlf=true checkout. + - name: Check out with LF line endings + shell: pwsh + run: git config --global core.autocrlf input + - uses: actions/checkout@v4 + - name: Install Cygwin + uses: cygwin/cygwin-install-action@v7 + with: + add-to-path: false + packages: autoconf automake libtool make gcc-core pkg-config + - name: Configure Automake + run: | + ./bootstrap + ./configure + - name: Build Automake + run: | + # Warning flags go to make rather than configure, where -Werror would + # break configure's own feature tests. + make CFLAGS="-g -O2 ${GNU_COMPILE_FLAGS}" + make DESTDIR="${PWD}/install" install + - name: Check artifacts + uses: andstor/file-existence-action@v2 + with: + files: "install/usr/local/bin/cyghidapi-0.dll, \ + install/usr/local/lib/libhidapi.dll.a, \ + install/usr/local/include/hidapi/hidapi.h, \ + install/usr/local/lib/pkgconfig/hidapi.pc, \ + install/usr/local/lib/pkgconfig/hidapi-winapi.pc" + fail: true + - name: Run hidtest + timeout-minutes: 2 + run: | + # Runtime smoke test of the Cygwin build: hid_init() and hid_enumerate() + # must work. No test device is attached, so hidtest ends with + # "unable to open device" and exit code 1. + ./hidtest/hidtest || test $? -eq 1 + + windows-msbuild: runs-on: windows-latest From f95d8c116bedd12e07be29ffb1076725c854e6d6 Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Fri, 13 Nov 2026 01:26:17 +0200 Subject: [PATCH 2/3] ci: install g++ for the Cygwin autotools build configure.ac runs AC_PROG_CXX; without a C++ compiler libtool's C++ preprocessor check fails configure under Cygwin. Assisted-by: claude-code:claude-opus-5-5 --- .github/workflows/builds.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 2bf5899f1..736cce94d 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -409,11 +409,13 @@ jobs: shell: pwsh run: git config --global core.autocrlf input - uses: actions/checkout@v4 + # gcc-g++ too: configure.ac runs AC_PROG_CXX, and without a C++ compiler + # libtool's C++ preprocessor check fails configure. - name: Install Cygwin uses: cygwin/cygwin-install-action@v7 with: add-to-path: false - packages: autoconf automake libtool make gcc-core pkg-config + packages: autoconf automake libtool make gcc-core gcc-g++ pkg-config - name: Configure Automake run: | ./bootstrap From a0f39a3bb12b14589ee11a3bfbc0340e980ce501 Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Fri, 13 Nov 2026 01:29:53 +0200 Subject: [PATCH 3/3] ci: show the compiler command lines in the Cygwin build log Assisted-by: claude-code:claude-opus-5-5 --- .github/workflows/builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 736cce94d..35b518c56 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -424,7 +424,7 @@ jobs: run: | # Warning flags go to make rather than configure, where -Werror would # break configure's own feature tests. - make CFLAGS="-g -O2 ${GNU_COMPILE_FLAGS}" + make V=1 CFLAGS="-g -O2 ${GNU_COMPILE_FLAGS}" make DESTDIR="${PWD}/install" install - name: Check artifacts uses: andstor/file-existence-action@v2