mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-io: use hal-win-io for mingw due to lack of fork/waitpid
mingw provides posix file i/o apis but not unix process management functions (fork, waitpid) which are required by hal-posix-io. removed mingw from linux/bsd pattern to let for_windows? predicate select hal-win-io instead. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,13 +10,10 @@ MRuby::Gem::Specification.new('mruby-io') do |spec|
|
||||
# HAL gems must be explicitly specified in build config (recommended) or via auto-selection below
|
||||
spec.build.gems.one? { |g| g.name =~ /^hal-.*-io$/ } or begin
|
||||
# No HAL found - determine appropriate error message or auto-load
|
||||
# MinGW provides POSIX compatibility, so use hal-posix-io
|
||||
suggested_hal = if spec.build.primary_toolchain == 'visualcpp'
|
||||
# Visual C++ on Windows - use native Windows HAL
|
||||
'hal-win-io'
|
||||
elsif RUBY_PLATFORM =~ /linux|darwin|bsd|mingw/ ||
|
||||
(spec.build.kind_of?(MRuby::CrossBuild) && spec.build.host_target =~ /mingw/) ||
|
||||
spec.cc.command.to_s =~ /mingw/
|
||||
elsif RUBY_PLATFORM =~ /linux|darwin|bsd/
|
||||
'hal-posix-io'
|
||||
elsif spec.for_windows?
|
||||
'hal-win-io'
|
||||
|
||||
Reference in New Issue
Block a user