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

The typheous Faraday Middleware emits a circular dep warning #1143

Open
olleolleolle opened this issue Apr 3, 2020 · 0 comments
Open

The typheous Faraday Middleware emits a circular dep warning #1143

olleolleolle opened this issue Apr 3, 2020 · 0 comments
Labels

Comments

@olleolleolle
Copy link
Member

olleolleolle commented Apr 3, 2020

Basic Info

  • Faraday Version: 1.0.1
  • Ruby Version: any

Issue description

The typheous middleware emits a circular dependency warning.

Stacktrace
/home/travis/.rvm/gems/ruby-2.6.4/gems/faraday-1.0.0/lib/faraday/dependency_loader.rb:11: warning: /home/travis/.rvm/gems/ruby-2.6.4/gems/faraday-1.0.0/lib/faraday/dependency_loader.rb:11: warning: loading in progress, circular require considered harmful - /home/travis/build/typhoeus/typhoeus/lib/typhoeus/adapters/faraday.rb
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/exe/rspec:4:in  `<main>'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:45:in  `invoke'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:71:in  `run'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:86:in  `run'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:102:in  `setup'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/lib/rspec/core/configuration.rb:1581:in  `load_spec_files'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/lib/rspec/core/configuration.rb:1581:in  `each'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/lib/rspec/core/configuration.rb:1583:in  `block in load_spec_files'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/lib/rspec/core/configuration.rb:2076:in  `load_file_handling_errors'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/rspec-core-3.9.1/lib/rspec/core/configuration.rb:2076:in  `load'
	from /home/travis/build/typhoeus/typhoeus/spec/typhoeus/adapters/faraday_spec.rb:3:in  `<top (required)>'
	from /home/travis/build/typhoeus/typhoeus/spec/typhoeus/adapters/faraday_spec.rb:3:in  `require'
	from /home/travis/build/typhoeus/typhoeus/lib/typhoeus/adapters/faraday.rb:3:in  `<top (required)>'
	from /home/travis/build/typhoeus/typhoeus/lib/typhoeus/adapters/faraday.rb:4:in  `<module:Faraday>'
	from /home/travis/build/typhoeus/typhoeus/lib/typhoeus/adapters/faraday.rb:21:in  `<class:Adapter>'
	from /home/travis/build/typhoeus/typhoeus/lib/typhoeus/adapters/faraday.rb:21:in  `require'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/faraday-1.0.0/lib/faraday/adapter/typhoeus.rb:3:in  `<top (required)>'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/faraday-1.0.0/lib/faraday/adapter/typhoeus.rb:4:in  `<module:Faraday>'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/faraday-1.0.0/lib/faraday/adapter/typhoeus.rb:7:in  `<class:Adapter>'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/faraday-1.0.0/lib/faraday/adapter/typhoeus.rb:12:in  `<class:Typhoeus>'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/faraday-1.0.0/lib/faraday/dependency_loader.rb:11:in  `dependency'
	from /home/travis/.rvm/gems/ruby-2.6.4/gems/faraday-1.0.0/lib/faraday/dependency_loader.rb:11:in  `require'

It seems like https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/adapters/faraday.rb#L21 triggers a class-loading of the adapter in Faraday, which in turns reloads the typhoeus adapter.

Steps to reproduce

Example of what it looks like in the wild:
https://travis-ci.org/github/typhoeus/typhoeus/jobs/658867808#L264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant