Conversation
.github/workflows/test.yml
Outdated
| fail-fast: false | ||
| matrix: | ||
| os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | ||
| ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0'] |
There was a problem hiding this comment.
Could you use https://github.com/ruby/actions/blob/master/.github/workflows/ruby_versions.yml like https://github.com/ruby/strscan/blob/3592c390540a57ed9d2491596207d4059208a439/.github/workflows/ci.yml#L11-L27 ? We can use cruty for engine:.
.github/workflows/test.yml
Outdated
| - name: Replace libcurl.dll | ||
| if: runner.os == 'Windows' | ||
| run: | | ||
| # The `libcurl.dll` bundled with Ruby on Windows (MSYS2) has missing dependencies and cannot be loaded by `ethon` out of the box. (Ref: https://github.com/typhoeus/typhoeus/issues/720) | ||
| choco install curl --no-progress | ||
|
|
||
| $curlTools = "C:\ProgramData\chocolatey\lib\curl\tools" | ||
| $srcDll = Get-ChildItem -Path $curlTools -Filter "libcurl*.dll" -Recurse | Select-Object -First 1 | ||
|
|
||
| $rubyBin = Split-Path (Get-Command ruby.exe).Source | ||
| $destDll = Join-Path $rubyBin "libcurl.dll" | ||
| Copy-Item -Path $srcDll.FullName -Destination $destDll -Force |
There was a problem hiding this comment.
It seems that this is a wrong fix.
MSYS2 ships libcurl-4.dll not libcurl.dll:
https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-curl
/ucrt64/bin/libcurl-4.dll
I confirmed that ruby -r ethon -e; works with the following patch without copying libcurl.dll:
diff --git a/lib/ethon/curls/settings.rb b/lib/ethon/curls/settings.rb
index 8c0161b..e878c1a 100644
--- a/lib/ethon/curls/settings.rb
+++ b/lib/ethon/curls/settings.rb
@@ -7,6 +7,9 @@ module Ethon
callback :debug_callback, [:pointer, :debug_info_type, :pointer, :size_t, :pointer], :int
callback :progress_callback, [:pointer, :long_long, :long_long, :long_long, :long_long], :int
ffi_lib_flags :now, :global
- ffi_lib ['libcurl', 'libcurl.so.4']
+ # 'libcurl-4' is for MSYS2. MSYS2 uses libcurl-4.dll not libcurl.dll.
+ # See also "Files:" in
+ # https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-curl .
+ ffi_lib ['libcurl', 'libcurl.so.4', 'libcurl-4']
end
end
There was a problem hiding this comment.
An issue has already been filed for a similar case.
typhoeus/ethon#270
There was a problem hiding this comment.
How about removing this workaround and jobs on Windows until the issue is resolved?
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Fix #9
Thanks Travis CI for providing free CI resource so far!