-
Notifications
You must be signed in to change notification settings - Fork 132
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
Reading Spago workspace configuration hangs "forever" #1140
Comments
I think it'd be worth investigating more about your current setup before going for a configurable option - after all Spago is certainly not the first tool attempting this, e.g. Bazel works in the same way, and it handles Google-sized repos so I'm certain it's possible to make it work. A few questions:
|
Well I manged to reduce it by adding |
Could you provide a reproducible repo? The details provided thus far aren't very helpful for tracking down the source of this problem (if any). As an example, what is the output of |
Spago will ignore the same things as It would be helpful to include a reproducible repo as Jordan mentioned, or at least the log of an invocation of |
I'm not sure what you mean by reproducible, I have a project with quite a bit of node dependencies, also the reason may be in using PNPM as a package manager that uses symlinks. Why should spago even search for packages inside |
I mean something I can |
I think the problem is quite clear, there may be some "unexpected" content that is not very friendly to the fast traversing, inside the project dir for any reason a user needs it. So you ask the user: why do you have it there, the user answers: why not, I need it here, at least for now. What is the reason not to have it, are the projects that want to have |
@wclr you opened a ticket because you think you encountered an issue with this software - that's good and I appreciate that.
We don't know. So in order to figure out what we're dealing with here we would either need:
I'm afraid that without either of these things there's not much we can do. |
I am just not sure how to implement a viable repro here, should I recreate a structure of my real-life project, and all al the deps there? I don't think it is a good or possible option. Even it doesn't "hang for ever" but takes several seconds to run on this step, it is absolutely not nice. What problem are you expecting to discover here? Glogging as any a massive fs operation can be quite expensive depending on the content eps. if you run on some not very fast fs. Why ignore or include pattern is needed?
From bazel docs: https://bazel.build/run/bazelrc
On the other issue you mentioned:
You didn't exclude ignored locations from globbing (though you have excluded them later byanalyzing in the code), so it is not a very performance wise solution. |
Sure. It doesn't have to be exactly as your current project, it can approximate it as long as it reliably demonstrates the problem. A few seconds of runtime are normal (the compiler takes as much to startup on big projects), a minute starts to become problematic.
If there's a problem I would like to explore the failure condition, instead of just implementing whatever suggested solution without much thinking. |
I can tell you the problem, it is that globbing is not always cheap. Solution is make finding the needed files as cheap as possible. As I pointed out above in the issue #918 solution to exclude patterns from gitignore files is not the most efficient one. Although this capability is not implemented in the fast-glob, there is an issue: mrmlnc/fast-glob#265. the solution proposed is to use Also there is and issue about discussed glob performance problems sindresorhus/globby#50, it stays though:
|
Rereading this thread, it sounds like @wclr has a repo with top-level folders that have a lot of content within them. And since AFAIK Spago doesn't assume that any subpackages are only one-level deep (e.g. @wclr, is that correct? And arguably, if we wrote a script that produced a whole lot of such directories and subdirectories, we'd be able to produce this "Reading Spago workspace configuration..." hang issue that you've described? |
Right, it is quite an old project with lots of different content, but gradually migrating to PS as the foundation. Anyway, there may be different situations and user contexts why a project (its directory) may have a lot of non-related to PS code/packages content.
There is no need to spend time on this, really. The current method of finding nested And as it is not obvious how to correctly convert |
I got a repro on my Window 10 machine. It doesn't take forever, but failed to make some network request. I got the following error in about 1 minute.
When I used
This some is some times blocked by my ISP. I use a proxy to workaround this, but it seems the It's strange that the
|
@wewei you are seeing a different issue: the original ticked is about how quickly we traverse the tree of directories while your issue is about Spago being slow on a network request. The node runtime doesn't seem to have support for system defined proxies, so this is a separate feature we'd need to implement separately. Please open a new ticket if you're still interested in having such feature |
Maybe? I am personally not going to have a look at this unless we have a benchmark that demonstrates the problem. |
Closing this in favor of #1182, since that one has some level of detail and is more actionable. |
I have a big (?), not actually that big, project. Spago hangs with the
Reading Spago workspace configuration...
message (for ages? - I could not wait). I have added dirs with a lot of content to the ignore pattern (in the bundle code), then it passes.So, I think that this step of searching for
spago.yaml
with glob throughout the whole content may be a bit excessive? I would prefer this to be configured and not spend any time searching especially in unknown environments.The text was updated successfully, but these errors were encountered: