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

Circular require warning in verbose mode #388

Closed
jeremyevans opened this issue Feb 18, 2023 · 0 comments · Fixed by #389
Closed

Circular require warning in verbose mode #388

jeremyevans opened this issue Feb 18, 2023 · 0 comments · Fixed by #389

Comments

@jeremyevans
Copy link

$ ruby -w -r webauthn -e ''
<internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88: warning: <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88: warning: loading in progress, circular require considered harmful - /usr/local/lib/ruby/gems/3.2/gems/webauthn-3.0.0/lib/webauthn/relying_party.rb
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:152:in  `require'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:162:in  `rescue in require'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:162:in  `require'
        from /usr/local/lib/ruby/gems/3.2/gems/webauthn-3.0.0/lib/webauthn.rb:3:in  `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88:in  `require'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88:in  `require'
        from /usr/local/lib/ruby/gems/3.2/gems/webauthn-3.0.0/lib/webauthn/configuration.rb:4:in  `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88:in  `require'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88:in  `require'
        from /usr/local/lib/ruby/gems/3.2/gems/webauthn-3.0.0/lib/webauthn/relying_party.rb:4:in  `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88:in  `require'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88:in  `require'
        from /usr/local/lib/ruby/gems/3.2/gems/webauthn-3.0.0/lib/webauthn/credential.rb:7:in  `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88:in  `require'
        from <internal:/usr/local/lib/ruby/3.2/rubygems/core_ext/kernel_require.rb>:88:in  `require'

webauthn/relying_party requires webauthn/credential requires webauthn/relying_party. If there is a true mutual dependency, and you want to allow users to require either independently, one option is to move the require calls to the end of the files, then guard them (e.g. require "webauthn/relying_party" unless defined?(Webauth::RelyingParty)). If you don't need to allow users to require each independently, then you can probably drop one of the requires.

On the plus side, congratulations on the 3.0.0 release! Works fine with Rodauth's webauthn feature, and allows the use of the default openssl gem in Ruby 3.1 and 3.2.

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 a pull request may close this issue.

1 participant