Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows CI #1000

Closed
wants to merge 3 commits into from
Closed

Add Windows CI #1000

wants to merge 3 commits into from

Conversation

MSP-Greg
Copy link
Contributor

Adds a GitHub Actions workflow that only runs bundle exec rake compile. It has code to always pass, so it won't 'fail' a PR.

Several errors/warnings are shown, some were fixed in #966.

Notes:

  1. This is only using a Ruby built with the MSYS2 UCRT64 gcc tool chain. I believe additional code is needed to even try to build with a mswin (MSVC) Ruby.
  2. First time this runs, installing/compiling Nokogiri takes several minutes. Subsequent builds can make use of the cache, so they're much quicker.
  3. Once it compiles, addtional code is needed to load librubyparser.dll. Something similar to the below:
require 'fiddle'
kernel32 = Fiddle.dlopen 'kernel32'
load_library = Fiddle::Function.new(
  kernel32['LoadLibraryW'], [Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT,
)
dll_path = File.absolute_path('../build/librubyparser.dll', __dir__)
if load_library.call(dll_path.encode('utf-16le')).zero?
  abort "Failed to load librubyparser.dll from\n  #{dll_path}"
end

@flavorjones
Copy link
Contributor

FWIW I also have a branch in progress with windows support that is also going to introduce static linking of the ruby C extension.

@kddnewton
Copy link
Collaborator

Thank you so much for the help @MSP-Greg! I see that Mike credited you on some of the commits he added recently. I'm going to close this one in favor of that other one.

@kddnewton kddnewton closed this Jun 20, 2023
@MSP-Greg MSP-Greg deleted the 00-windows-ci branch June 22, 2023 17:26
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.

3 participants