Fix #143 - Childprocess v1.0.0 failing to install.#144
Conversation
|
Thanks for the fix, @farkasmate. Given your comment in the issue this seems like the correct way forward. One additional clarification (not specifically directed at you): any reason we need to limit |
|
The limit is there so that we don't get bitten by a major version bump from |
| s.add_development_dependency 'rake', '< 12.0' | ||
| s.add_development_dependency 'coveralls', '< 1.0' | ||
|
|
||
| s.add_runtime_dependency 'rake', '< 12.0' |
There was a problem hiding this comment.
Yes, this eliminates the situation where installation is broken when rake is missing.
But it also propagates rake as a runtime dependency of any app that includes childprocess and returns any app that uses childprocess on any platform to a state where rake is always available at runtime. For users who are concerned about the surface area of their applications for security or performance reasons, this is less than desirable.
Since we have a known workaround (pin to 0.9.x), I advocate for taking the time to find a solution that doesn't add runtime dependencies that aren't actually necessary at runtime, or at least reduces the effect to platforms on which they are needed for the installation.
There was a problem hiding this comment.
The change came from a desire to not have ffi be a dependency. So...it's kind of a 'pick your poison' situation. Between the two, I'd guess that more places are fine having rake installed than ffi. If there is yet another solution that doesn't require either gem as a mandatory dependency, then that would be even better.
There was a problem hiding this comment.
@enkessler If a conditional dependency (ffi on Windows) is all you want, you can remove ext/mkrf_conf.rb and do a conditional instead in childprocess.gemspec:
- s.extensions = 'ext/mkrf_conf.rb'
+ s.add_runtime_dependency 'ffi', '~> 1.0', '>= 1.0.11' if Gem.win_platform?
With this you don't need rake at runtime. As you pointed out, that generated Rakefile has no use at the moment.
What do you think?
There was a problem hiding this comment.
@farkasmate conditionals in the gemspec don't quite work in this case, because they are evaluated at gem build, before the gem is uploaded to rubygems.
There was a problem hiding this comment.
I've looked at alternative extensions we could implement, but the introduction of rake as a dependency is the only way to do this in a platform-agnostic way. Other extensions require the existence of make or other tools, which may not be installed on some systems.
For this reason, and given the fact that rake is usually (but not always) installed by default on Ruby systems, it seems reasonable to add a dependency on rake for sake of removing the ffi dependency for all non-Windows systems.
|
Followed up with a PR to relax the |
|
Following up here to say we've removed the magic |
Update ruby-childprocessto 3.0.0. ### Version 3.0.0 / 2019-09-20 * [#156](enkessler/childprocess#156 unused `rubyforge_project` from gemspec * [#160](enkessler/childprocess#160): Remove extension to conditionally install `ffi` gem on Windows platforms * [#160](enkessler/childprocess#160): Remove runtime dependency on `rake` gem ### Version 2.0.0 / 2019-07-11 * [#148](enkessler/childprocess#148): Drop support for Ruby 2.0, 2.1, and 2.2 * [#149](enkessler/childprocess#149): Fix Unix fork reopen to be compatible with Ruby 2.6 * [#152](https://github.com/enkessler/childprocess/pull/152)/[#154](https://github.com/enkessler/childprocess/pull/154): Fix hangs and permission errors introduced in Ruby 2.6 for leader processes of process groups ### Version 1.0.1 / 2019-02-03 * [#143](enkessler/childprocess#144): Fix installs by adding `rake` gem as runtime dependency * [#147](enkessler/childprocess#147): Relax `rake` gem constraint from `< 12` to `< 13` ### Version 1.0.0 / 2019-01-28 * [#134](enkessler/childprocess#134): Add support for non-ASCII characters on Windows * [#132](enkessler/childprocess#132): Install `ffi` gem requirement on Windows only * [#128](enkessler/childprocess#128): Convert environment variable values to strings when `posix_spawn` enabled * [#141](enkessler/childprocess#141): Support JRuby on Java >= 9
Update ruby-childprocessto 3.0.0. ### Version 3.0.0 / 2019-09-20 * [NetBSD#156](enkessler/childprocess#156 unused `rubyforge_project` from gemspec * [NetBSD#160](enkessler/childprocess#160): Remove extension to conditionally install `ffi` gem on Windows platforms * [NetBSD#160](enkessler/childprocess#160): Remove runtime dependency on `rake` gem ### Version 2.0.0 / 2019-07-11 * [NetBSD#148](enkessler/childprocess#148): Drop support for Ruby 2.0, 2.1, and 2.2 * [NetBSD#149](enkessler/childprocess#149): Fix Unix fork reopen to be compatible with Ruby 2.6 * [NetBSD#152](https://github.com/enkessler/childprocess/pull/152)/[#154](https://github.com/enkessler/childprocess/pull/154): Fix hangs and permission errors introduced in Ruby 2.6 for leader processes of process groups ### Version 1.0.1 / 2019-02-03 * [NetBSD#143](enkessler/childprocess#144): Fix installs by adding `rake` gem as runtime dependency * [NetBSD#147](enkessler/childprocess#147): Relax `rake` gem constraint from `< 12` to `< 13` ### Version 1.0.0 / 2019-01-28 * [NetBSD#134](enkessler/childprocess#134): Add support for non-ASCII characters on Windows * [NetBSD#132](enkessler/childprocess#132): Install `ffi` gem requirement on Windows only * [NetBSD#128](enkessler/childprocess#128): Convert environment variable values to strings when `posix_spawn` enabled * [NetBSD#141](enkessler/childprocess#141): Support JRuby on Java >= 9
Update ruby-childprocessto 3.0.0. ### Version 3.0.0 / 2019-09-20 * [#156](enkessler/childprocess#156 unused `rubyforge_project` from gemspec * [#160](enkessler/childprocess#160): Remove extension to conditionally install `ffi` gem on Windows platforms * [#160](enkessler/childprocess#160): Remove runtime dependency on `rake` gem ### Version 2.0.0 / 2019-07-11 * [#148](enkessler/childprocess#148): Drop support for Ruby 2.0, 2.1, and 2.2 * [#149](enkessler/childprocess#149): Fix Unix fork reopen to be compatible with Ruby 2.6 * [#152](https://github.com/enkessler/childprocess/pull/152)/[#154](https://github.com/enkessler/childprocess/pull/154): Fix hangs and permission errors introduced in Ruby 2.6 for leader processes of process groups ### Version 1.0.1 / 2019-02-03 * [#143](enkessler/childprocess#144): Fix installs by adding `rake` gem as runtime dependency * [#147](enkessler/childprocess#147): Relax `rake` gem constraint from `< 12` to `< 13` ### Version 1.0.0 / 2019-01-28 * [#134](enkessler/childprocess#134): Add support for non-ASCII characters on Windows * [#132](enkessler/childprocess#132): Install `ffi` gem requirement on Windows only * [#128](enkessler/childprocess#128): Convert environment variable values to strings when `posix_spawn` enabled * [#141](enkessler/childprocess#141): Support JRuby on Java >= 9
No description provided.