Skip to content

Add runtime dependency for windows instead of mentioning it in README - #171

Closed
ojab wants to merge 1 commit into
enkessler:masterfrom
ojab:master
Closed

ojab wants to merge 1 commit into
enkessler:masterfrom
ojab:master

Conversation

@ojab

@ojab ojab commented Nov 18, 2020

Copy link
Copy Markdown

No description provided.

@sds sds left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Closing as this is not possible.

Comment thread childprocess.gemspec

s.required_ruby_version = '>= 2.4.0'

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@sds sds closed this Nov 18, 2020
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.

2 participants