-
Notifications
You must be signed in to change notification settings - Fork 162
thread 'rustc' has overflowed its stack #302
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
Comments
Thanks for reporting the bug. I think it has more to do with the query, because we don't recurse much when parsing the schema, as far as I remember. Could you share a schema/query combination that reproduces the crash? |
Hey @tomhoule ! I'm also encountering this issue. The following should reproduce the issue for you.
|
See also rust-lang/rust#75798 for another reproduction of this. |
I'm running into this error as well here |
I've built a simple runnable reproduction in this repo. If you This is what I've figured out so far:
Given this Schema, if you try to compile the
I hope someone has the spare time to take a look, since this is inherently blocking for working with graphql introspection results as input types, and may require us to fork eventually if this can't get resolved |
Does this happen on master, or only on the released version? There is a large refactoring of query processing that hasn't been released yet. |
it seems to work with the master branch!! |
Hey there ! First, thanks for this awesome library ! I happened to face this issue too. I'm using prisma and it generates recursive types for filters. type Query {
hello(filter: Filter): Hello
}
input Filter {
AND: [Filter],
OR: [Filter],
field1: String,
field2: Int
} Which leads to Did someone already have the same issue ? And is there a workaround or maybe something planned for recursive types ? Btw, I tried on |
There is nothing planned because nobody has capacity to work on this crate at the time. I would happily review a PR, though. |
Thanks for your answer ! I dived in, and I'm not sure anymore if it's a recursion error.
quote! {
#variable_derives
pub struct #struct_name {
#(#fields,)*
}
} I have also tried naively boxing the generated modules thinking that this would remove the module from the stack and free up space for the next modules, but this does not work.
for operation in &operations {
let generated = Box::new(
generated_module::GeneratedModule {
query_string: query_string.as_str(),
schema: &schema,
resolved_query: &query,
operation: &operation.1.name,
options: &options,
}
.to_token_stream()?,
);
modules.push(generated);
} I'll keep looking for a fix, and eventually open a PR if I find one. |
I'll help any way I can, thanks for investigating this :) Btw, this is not completely related, but I work at prisma —_are you trying to talk to the query engine directly over the graphql-like internal protocol? |
Well, what a coincidence ! But no, I'm trying to consume the exposed API made with Prisma + Nexus prisma plugin. I had a look to |
With my MR schema exports from Hasura finally work! |
I have a schema generated by a hasura instance that is causing the rust compiler to panic.
Schema and query causing the issue:
rustc_panic.zip
I had some code working successfully with a previous schema, but I added some tables and now I'm getting a stack overflow.
I'm wondering if there's some recursive relationships in my schema that are causing issues, or just the size of the schema itself (hasura generates a ton of schema)... mine is currently 732kb of JSON
The text was updated successfully, but these errors were encountered: