Skip to content

Commit

Permalink
(FACT-3423) Add ffi as development dependency
Browse files Browse the repository at this point in the history
The ffi gem is a dependency for the FFI module in Facter. However, the
dependency on the ffi gem is only met as a transitive dependency through
sys-filesystem.

This commit adds the ffi gem as a development dependency to the gemspec.

The ffi gem is being added as a development dependency, as opposed to a
runtime dependency, because it contains native extensions. The original
intent was to allow users to install Facter without a compiler to be as
portable as possible, and native extensions would prevent that from
happening.
  • Loading branch information
mhashizume committed Sep 5, 2023
1 parent b512e96 commit 98d77ff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions facter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

# While we require sys-filesystem in filesystem_helpers we leave it as a
# development, not runtime, dependency. We do this so we do not also pull in
# sys-filesystem's dependency ffi, which contains native extensions which in
# turn would mean Facter would require a compiler to install as a gem.
# While we require both ffi and sys-filesystem in parts of Facter, we specify
# them as development, not runtime, dependencies. Both gems either directly
# or indirectly contain native extensions. The intent behind excluding these
# gems from runtime dependencies is to allow users to be able to install
# Facter without a compiler.
spec.add_development_dependency 'ffi'
spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop', '~> 0.81.0'
Expand Down

0 comments on commit 98d77ff

Please sign in to comment.