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

Conversation

ojab
Copy link

@ojab ojab commented Nov 18, 2020

No description provided.

Copy link
Collaborator

@sds sds left a comment

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.

@@ -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.

@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.

None yet

2 participants