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

uninitialized constant Dry::Core::ClassAttributes::IDENTITY #75

Closed
poloka opened this issue Oct 17, 2022 · 6 comments · Fixed by #76
Closed

uninitialized constant Dry::Core::ClassAttributes::IDENTITY #75

poloka opened this issue Oct 17, 2022 · 6 comments · Fixed by #76
Labels

Comments

@poloka
Copy link
Contributor

poloka commented Oct 17, 2022

Describe the bug

Release 0.9.0 is broken. Because of the removal of the Constants:
v0.8.1...v0.9.0#diff-96814e9c79807ef64d126407350ffd3011e57aa5406c0625219fda5c6b1c8774L12

Causes error:

/usr/local/bundle/gems/dry-core-0.9.0/lib/dry/core/class_attributes.rb:65:in `defines': uninitialized constant Dry::Core::ClassAttributes::IDENTITY (NameError)

Because of the reference to the constant here:
v0.8.1...v0.9.0#diff-96814e9c79807ef64d126407350ffd3011e57aa5406c0625219fda5c6b1c8774R65

References
https://github.com/dry-rb/dry-core/blob/v0.9.0/lib/dry/core/constants.rb#L30

Expected behavior

Not to get an unexpected constant missing error

My environment

  • Affects my production application: YES
  • Ruby version: 2.7
  • OS: linux, alpine
@opti
Copy link

opti commented Oct 17, 2022

@poloka I was just about to report the same issue. Thanks for posting it.

@poloka
Copy link
Contributor Author

poloka commented Oct 17, 2022

Here was the commit from @solnic that broke things: 96d01e2

@opti
Copy link

opti commented Oct 18, 2022

There is also this discussion on the same issue #73

@solnic
Copy link
Member

solnic commented Oct 18, 2022

Thanks for reporting this. I'm pretty sure it's because there's a cherry-pick require somewhere in your code that loads some file that needs Dry::Core::Constants while dry/core (which is the zeitwerk library entry-point now) is not yet required. Is this the case? If yes, could you remove any requires like that and just have one require "dry/core"?

solnic added a commit that referenced this issue Oct 18, 2022
Correct missing constant for IDENTITY. Fixes #75
@solnic
Copy link
Member

solnic commented Oct 18, 2022

...OK nevermind I just merged #76 and it made me realize that we actually have constants in the list of ignored files by zeitwerk so the require and inclusion of the module were both needed in various situations. Thanks for the fix @poloka - it's now released in 0.9.1.

@poloka
Copy link
Contributor Author

poloka commented Oct 18, 2022

Thanks @solnic for the quick release!!

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

Successfully merging a pull request may close this issue.

3 participants