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

Add empty Operations module to fix spurious loading issues #97

Closed
wants to merge 1 commit into from

Conversation

robhanlon22
Copy link
Member

@robhanlon22 robhanlon22 commented Aug 9, 2022

Ran into this load error when trying to run tests in a bespoke CI environment:

LoadError:
  cannot load such file -- .../lib/dry/logic/operations
  # .../lib/dry/logic/operators.rb:7:in `require'
  # .../lib/dry/logic/operators.rb:7:in `and'

I believe that this has to do with Zeitwerk loading and the order that things get loaded. It's trying to load the operations file but it's not there. Adding this file with a module declaration fixes this issue, and seems most consistent with Ruby patterns (a file named the same as a directory that declares the directory's module).

@robhanlon22 robhanlon22 requested a review from solnic as a code owner August 9, 2022 16:32
@robhanlon22 robhanlon22 changed the title Add empty operations module to fix spurious loading issues Add empty Operations module to fix spurious loading issues Aug 9, 2022
@flash-gordon
Copy link
Member

I'm pretty sure it's not a proper fix. I have very similar issues with specs in dry-system that reloaded zetwerk's context in tests. The solution was to fix the helper. Please check out that repo, the fix may be in a non-main branch (I'm on mobile atm).

@flash-gordon
Copy link
Member

By the way, it took me some time to figure it out. I used debugging tips from zeitwerk repo (you can set a custom logger for zeitwerk operations).

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 this pull request may close these issues.

2 participants