Closed Thomas-Franklin closed 5 years ago
This seems to be an artefact of your test environment. If I create a new gemset/bundle, cisco_node_utils does not pull in net_http_unix:
david@davids:~/tmp$ mkdir cisco_gem_test
david@davids:~/tmp$ cd cisco_gem_test/
david@davids:~/tmp/cisco_gem_test$ bundle init
Writing new Gemfile to /home/david/tmp/cisco_gem_test/Gemfile
david@davids:~/tmp/cisco_gem_test$ vi Gemfile
david@davids:~/tmp/cisco_gem_test$ cat Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
# gem "rails"
gem 'cisco_node_utils'
david@davids:~/tmp/cisco_gem_test$ bundle install --path ~/gems
Fetching gem metadata from https://rubygems.org/...
Resolving dependencies...
Using bundler 1.17.3
Fetching cisco_node_utils 2.0.1
Installing cisco_node_utils 2.0.1 with native extensions
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into `/home/david/gems`
david@davids:~/tmp/cisco_gem_test$ bundle list net_http_unix
Could not find gem 'net_http_unix'.
david@davids:~/tmp/cisco_gem_test$
Edit: also looking at the dependencies on https://rubygems.org/gems/cisco_node_utils I don't see what should pull in the net_http_unix gem.
@DavidS What happens if you just issue the gem install cisco_node_utils
by itself to install from rubygems.org?
I think I found it. When installing using gem install
directly, it does pull in net_http_unix
and grpc
through https://github.com/cisco/cisco-network-node-utils/blob/a393fb7d6aecc19b05dbac8879a5485651f8b851/ext/mkrf_conf.rb
When using bundler this fails to make the gem available as bundler is not exposing any randomly installed gems into the development environment.
Since the cisco_node_utils
dependencies are not clearly declared, I'd definitely prefer to be explicit in the install class to avoid future surprises.
Reading the mkrf_conf
code also makes me wonder whether we couldn't simplify this a lot by ripping out the unused(?) XR code. At that point it would be an unconditional install of net_http_unix
and we could lift that to the gemspec and get rid of all that magic.
@DavidS I am fine with being more explicit. We would like to remove the XR code from cisco_node_utils
but that will be a bigger effort to test through all the various NX-OS platforms and ensure we don't break anything in the process.
@Thomas-Franklin Not sure we need to be explicit here. When the
cisco_node_utils
gem is installed from rubygems.org thenet_http_unix
is automatically installed.