-
Notifications
You must be signed in to change notification settings - Fork 131
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
gitignoringGlob exceeding call stack - add explicit package globs to workspace? #1231
Comments
…h-package-globs into add-included-packages-and-regular-glob-purescript#1231
Let's unpack this a little:
I'd consider this a bug. Can we rewrite
Can I ask you what's the usecase for generating packages? In any case, you should be able to include them in the build as extra packages (i.e. not autodetected), by pointing at their path, e.g. workspace:
extraPackages:
some-package:
path: "generated-packages/some-package" |
I recently touched the gitignoringglob implementation and have a hunch that it's a traverse that i added, i'll look now and add a stack-safe PR |
Here's the fork with the bundle ( |
If it's possible to do this and keep it reasonably performant on a large project, sounds good to me.
They are for graphql schema Your example using |
@cakekindel Sorry, this was due to a mistake on my part. We had our Your changes did prevent the call stack being exceeded but it took too long to run and after a few minutes of waiting I cancelled the compilation. @f-f I still think that allowing explicit package globs would be useful in our case as we prefer not to have multiple |
@roryc89 I am interested in learning about your usecase because often it's possible to arrange the build in a way that can be addressed by existing features. That's preferrable to adding features to precisely address any given build, since in the long term it leads to a situation where there are many switches that address overlapping concerns. For example, would it be possible for you to generate all the sources in a single project instead of creating 100s of different projects? Is there a reason for avoiding multiple gitignores? I would consider these few lines of gitignore worthwhile if they would avoid implementing an entirely new feature in spago. |
@f-f sure thing.
We have many apps that have quite fine grained permissions on what parts of the Graphql APIs they can access. We prefer to not to have unnecessary dependencies (for faster packages builds) so we have split out the generated schema files into quite a few packages. Most of the packages are shared dependencies of the various schema packages and we typically install a few schema packages per app.
We originally found it easier to manage all our gitignore paths in a single file. With multiple I think that allowing spago workspaces to be decoupled from git could be useful for other users but I also understand that it may not worth building/maintaining the extra config option if it's only useful to a few users. |
Ah, this makes a lot of sense - thanks for the context!
Indeed - I've been trying to keep this part of Spago as hands-free for the user as possible, but the line between "it's magic so I don't have to worry about it" and "it's magic so I don't understand how to bend it to do my thing" is very fine sometimes. Re git coupling: I think "parsing the gitignore" is the sweet spot here; we used to call |
On a very large monorepo project we find that
Glob.gitignoringGlob
exceeds the maximum callstack.We can work around this by increasing the maximum stack size on node but we would rather not have to do this.
Another possible solution would be to allow explicit setting of globs to find packages and to not examine
.gitignore
files.This would also allow generated, gitignored packages to be part of a workspace.
The text was updated successfully, but these errors were encountered: