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 runtime dependency for windows instead of mentioning it in README #171

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ a standalone library.

* Ruby 2.4+, JRuby 9+

Windows users **must** ensure the `ffi` gem (`>= 1.0.11`) is installed in order to use ChildProcess.

# Usage

The object returned from `ChildProcess.build` will implement `ChildProcess::AbstractProcess`.
Expand Down
2 changes: 2 additions & 0 deletions childprocess.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Gem::Specification.new do |s|

s.required_ruby_version = '>= 2.4.0'

s.add_runtime_dependency "ffi", "~> 1.0", ">= 1.0.11" if Gem.win_platform?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't do what you want. Gemspecs are evaluated at build time, so this will only work if the gem is built on a Windows machine.

We don't include the ffi gem intentionally, as the vast majority of users don't need it and it slows down installs due to the time it takes to compile native extensions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, what about RbConfig::CONFIG['target_os'] =~ /mingw32|mswin/ then? It seems strange to require gem, but not have it in deps.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used to do this. Please see #160 for why we removed. There are many good reasons to not do this.


s.add_development_dependency "rspec", "~> 3.0"
s.add_development_dependency "yard", "~> 0.0"
s.add_development_dependency 'coveralls', '< 1.0'
Expand Down