From 54df38b22b1ee437a01fc1cc52fb1607db48b132 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Mon, 12 May 2025 21:18:40 +0100 Subject: [PATCH 1/7] Install gperf for all windows builds --- .github/workflows/test.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8df1c92..d7313b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,10 +42,16 @@ jobs: - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 + if: matrix.os != 'windows-latest' with: ruby-version: ${{ matrix.ruby }} bundler-cache: true # 'bundle install' and cache - - run: choco install gperf - if: ${{ matrix.ruby == 'mswin' }} + - name: Install gperf for MinGW/UCRT builds + uses: ruby/setup-ruby-pkgs@v1 + if: matrix.os == 'windows-latest' + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + mingw: gperf - name: Run test run: bundle exec rake compile test From 617e6e0862d2c7cf516c372c94699073c94560c4 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Mon, 12 May 2025 22:04:12 +0100 Subject: [PATCH 2/7] Test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7313b6..b53d58b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,6 +52,6 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - mingw: gperf + mingw: gperf _upgrade_ - name: Run test run: bundle exec rake compile test From 397513cc1221a4c74e4b7e40955d3edab6d98398 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Mon, 12 May 2025 22:27:48 +0100 Subject: [PATCH 3/7] Add debugging steps --- .github/workflows/test.yml | 42 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b53d58b..4b04401 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,5 +53,43 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true mingw: gperf _upgrade_ - - name: Run test - run: bundle exec rake compile test + - name: Compile extension + run: bundle exec rake compile + - name: Diagnose DLLs (mingw on windows-latest) + if: matrix.os == 'windows-latest' && matrix.ruby == 'mingw' + shell: msys2 {0} # Use MSYS2 shell for objdump and consistent PATH + run: | + echo "--- Ruby Version --- " + ruby -v + echo "--- Finding date_core.so --- " + # Construct the path based on Rakefile logic: lib/RUBY_VERSION/platform/date_core.so + # RUBY_VERSION e.g., 3.3.8; platform e.g., x64-mingw-ucrt + RUBY_VERSION_OUTPUT=$(ruby -e 'print RUBY_VERSION') + # For mingw builds, ext.platform from Rake::ExtensionTask usually becomes something like x64-mingw-ucrt + # We'll use the platform string directly from the error message if it matches RUBY_VERSION_OUTPUT + SO_DIR_PLATFORM="x64-mingw-ucrt" + SO_PATH="${GITHUB_WORKSPACE}/lib/${RUBY_VERSION_OUTPUT}/${SO_DIR_PLATFORM}/date_core.so" + + echo "Checking for .so file at: $SO_PATH" + if [ ! -f "$SO_PATH" ]; then + echo "ERROR: date_core.so not found at $SO_PATH" + echo "Listing content of ${{ github.workspace }}/lib/${RUBY_VERSION_OUTPUT}/ to debug:" + ls -R "${{ github.workspace }}/lib/${RUBY_VERSION_OUTPUT}/" + exit 1 + fi + echo "Found .so file: $SO_PATH" + echo "--- objdump -p output (DLL dependencies) --- " + objdump -p "$SO_PATH" | grep "DLL Name" + echo "--- PATH variable --- " + echo "$PATH" + # Prepare for artifact upload by copying to a predictable name + cp "$SO_PATH" ./date_core.so.diagnostic + - name: Upload diagnostic .so (mingw on windows-latest) + if: matrix.os == 'windows-latest' && matrix.ruby == 'mingw' + uses: actions/upload-artifact@v4 + with: + name: date_core_mingw_ucrt_${{ matrix.ruby }}.so + path: ./date_core.so.diagnostic + if-no-files-found: error + - name: Run test (execute tests) + run: bundle exec rake test From 3b0f942a3e56844872fe55f63545e43f9abb27cd Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Mon, 12 May 2025 22:30:07 +0100 Subject: [PATCH 4/7] Don't fail fast --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b04401..795235e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,7 @@ jobs: name: build (${{ matrix.ruby }} / ${{ matrix.os }}) needs: ruby-versions strategy: + fail-fast: false matrix: ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} os: [ ubuntu-latest, macos-latest, windows-latest ] From b1b6bf48d50ea44108a31ee3471e3e60407bc775 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Mon, 12 May 2025 22:33:00 +0100 Subject: [PATCH 5/7] Fix --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 795235e..46c870e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,7 @@ jobs: - name: Compile extension run: bundle exec rake compile - name: Diagnose DLLs (mingw on windows-latest) - if: matrix.os == 'windows-latest' && matrix.ruby == 'mingw' + if: matrix.os == 'windows-latest' shell: msys2 {0} # Use MSYS2 shell for objdump and consistent PATH run: | echo "--- Ruby Version --- " @@ -86,7 +86,7 @@ jobs: # Prepare for artifact upload by copying to a predictable name cp "$SO_PATH" ./date_core.so.diagnostic - name: Upload diagnostic .so (mingw on windows-latest) - if: matrix.os == 'windows-latest' && matrix.ruby == 'mingw' + if: matrix.os == 'windows-latest' uses: actions/upload-artifact@v4 with: name: date_core_mingw_ucrt_${{ matrix.ruby }}.so From dbdcd84a08954972bc5057b1f705cbd918bd12f0 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 6 Jun 2025 08:50:33 +0900 Subject: [PATCH 6/7] Fix the shell name --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 46c870e..5a992b8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,7 +58,7 @@ jobs: run: bundle exec rake compile - name: Diagnose DLLs (mingw on windows-latest) if: matrix.os == 'windows-latest' - shell: msys2 {0} # Use MSYS2 shell for objdump and consistent PATH + shell: bash run: | echo "--- Ruby Version --- " ruby -v From da8030863263fbcfca05081e46a3bf1c28e6b207 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 26 Jun 2025 13:44:00 +0900 Subject: [PATCH 7/7] Search built binaries --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a992b8..2a74bcd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,8 +68,8 @@ jobs: RUBY_VERSION_OUTPUT=$(ruby -e 'print RUBY_VERSION') # For mingw builds, ext.platform from Rake::ExtensionTask usually becomes something like x64-mingw-ucrt # We'll use the platform string directly from the error message if it matches RUBY_VERSION_OUTPUT - SO_DIR_PLATFORM="x64-mingw-ucrt" - SO_PATH="${GITHUB_WORKSPACE}/lib/${RUBY_VERSION_OUTPUT}/${SO_DIR_PLATFORM}/date_core.so" + SO_PATH=("${GITHUB_WORKSPACE}/lib/${RUBY_VERSION_OUTPUT}"/*/date_core.so) + SO_PATH="${SO_PATH[0]}" echo "Checking for .so file at: $SO_PATH" if [ ! -f "$SO_PATH" ]; then