From 4d7fb105d529f1f6b1f98f10828d3ba4e57a4dd0 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Sun, 23 Aug 2026 14:47:54 +0800 Subject: [PATCH 1/2] ci(windows): test libxml adapter on Windows via MSYS2 libxml2 Adds a dedicated Windows workflow that installs libxml2, ragel, and the UCRT64 toolchain from MSYS2, configures libxml-ruby's extension build against them, prepares the vendored oga/ruby-ll forks, and runs the adapter spec suite (which includes the libxml adapter contract). Replaces the exploratory state of this branch: the commented-out pull_request trigger, debug.rb workflow step, and vcpkg-based before-setup-ruby on the metanorma/ci generic workflow are all dropped in favor of this self-contained workflow matching the structure of rake.yml. --- .github/workflows/windows.yml | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..79d10ce4 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,62 @@ +name: windows + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + adapters: + name: Adapter specs on Windows (libxml) + runs-on: windows-latest + + steps: + - uses: actions/checkout@v6 + with: + submodules: "recursive" + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + bundler-cache: false + + - name: Install libxml2 and build tools via MSYS2 + shell: cmd + run: | + C:\msys64\usr\bin\pacman.exe -S --needed --noconfirm ^ + mingw-w64-ucrt-x86_64-libxml2 ^ + mingw-w64-ucrt-x86_64-libiconv ^ + mingw-w64-ucrt-x86_64-zlib ^ + mingw-w64-ucrt-x86_64-ragel ^ + mingw-w64-ucrt-x86_64-make ^ + mingw-w64-ucrt-x86_64-gcc + + - name: Put MSYS2 UCRT64 toolchain on PATH + shell: pwsh + run: | + "PATH=C:\msys64\ucrt64\bin;C:\msys64\usr\bin;$env:PATH" >> $env:GITHUB_ENV + + - name: Configure libxml-ruby build + shell: pwsh + run: | + bundle config build.libxml-ruby --with-xml2-include=C:/msys64/ucrt64/include/libxml2 --with-xml2-lib=C:/msys64/ucrt64/lib --with-iconv-include=C:/msys64/ucrt64/include --with-iconv-lib=C:/msys64/ucrt64/lib + + - name: Generate ragel / ruby-ll outputs in vendored forks + shell: pwsh + run: | + gem install ruby-ll --no-document + rake vendor:prepare + + - name: Install dependencies + run: bundle install --jobs 4 + + - name: Compile vendored native extensions + run: bundle exec rake vendor:compile + + - name: Run adapter specs + run: bundle exec rake spec:adapter From a012aba8955fd3e672c85005001443e2b8fb185e Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Sun, 23 Aug 2026 14:54:31 +0800 Subject: [PATCH 2/2] fix(gemfile): skip stackprof on Windows stackprof's native extension uses SIGPROF/sigaction, which do not exist on Windows, so bundle install fails there. --- Gemfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 778c54f6..04dc4395 100644 --- a/Gemfile +++ b/Gemfile @@ -30,7 +30,8 @@ gem "rubocop-performance" gem "rubocop-rake" gem "rubocop-rspec" gem "simplecov", require: false -gem "stackprof" +# stackprof relies on POSIX signals (SIGPROF/sigaction) unavailable on Windows +gem "stackprof" unless Gem.win_platform? gem "tempfile" # Needed by get_process_mem on Windows