-
Notifications
You must be signed in to change notification settings - Fork 409
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
Infinite recursion under certain configurations on Windows #722
Comments
This is not hardly the only issue on Windows, which certainly complicates fixing it. |
So I'm not sure I understand. What exactly is the infinite recursion here? What do you notice when running that config? (does mockery spin infinitely and not give any output?) |
I admit, I have spent 0 mental energy making mockery work for Windows. It hasn't been a huge priority because most people use unix-like systems. I'm honestly surprised mockery works at all on windows TBH because there are a lot of underlying things like in |
It's a little difficult to get a good working output because the YAML encoder seems to run out of memory before it can print anything. Inferring from what I can see from spew.Dump, what seems to happen is that the configuration gets turned into something like the following (ignoring the parts that aren't broken): packages:
github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2/subpkg3:
packages:
github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2\subpkg3:
packages:
github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2/subpkg3:
packages:
github.com/vektra/mockery/v2/pkg/fixtures/example_project/pkg_with_subpkgs/subpkg2\subpkg3:
... |
Oh, so you are saying that |
I haven't tried generating mocks using the problematic configuration yet, so I don't know if mock generation is broken or not. I can test that later when I'm back on Windows. So far, this only arose for me in mockery's own tests. |
That's fair, it may not be worth the time or effort if nobody really uses it on Windows. If the right answer is just to use Mac/WSL/Linux instead, maybe the right solution to this is just to add a note to the README that Windows isn't supported and move on. |
Got it, so I think that this config would work fine for actual mock generation. The problem lies with the fact that when using I did try fixing this like a year ago but obviously I gave up... I think the solution would be to nil out the |
There does seem to be something especially bad about it on Windows, where the path separator discrepancy ( |
FWIW, my latest patch (that closed this issue) fixes the behavior of
|
Description
In certain recursive configuration scenarios on Windows only, there is infinite recursion in the
(pkg/config).Config.Initialize
method.Offending configuration:
Discovered while fixing #718 in PR #720
Mockery Version
master @ 9d79f3a
Golang Version
Installation Method
Steps to Reproduce
TestConfig_Initialize/test_with_one_subpackage,_config_not_defined
in packagepkg/config
TestConfig_Initialize/test_with_subpackage's_interfaces_defined
The text was updated successfully, but these errors were encountered: