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

Build with GRPC KSP processing fails #10647

Closed
erkieh opened this issue Mar 24, 2024 · 5 comments · Fixed by #10811
Closed

Build with GRPC KSP processing fails #10647

erkieh opened this issue Mar 24, 2024 · 5 comments · Fixed by #10811
Assignees
Labels
lang: kotlin Issues or features specific to Kotlin status: validated An issue that has been validated as being a bug type: bug Something isn't working

Comments

@erkieh
Copy link

erkieh commented Mar 24, 2024

Expected Behavior

Build to succeed or give a good error message

Actual Behaviour

Task :kspKotlin FAILED
e: [ksp] Originating element: meAsParent
e: [ksp] Index 0 out of bounds for length 0
e: [ksp] Originating element: meAsParent
e: [ksp] Index 0 out of bounds for length 0
e: Error occurred in KSP, check log for detail

Steps To Reproduce

gradle build

If I remove
ksp("io.micronaut.validation:micronaut-validation-processor")
from build.gradle.kts it succeeds

Environment Information

windows java 21

Example Application

https://github.com/erkieh/grpc-ksp-fail

Version

4.3.7

@sdelamo sdelamo added the lang: kotlin Issues or features specific to Kotlin label Mar 27, 2024
@timyates timyates added type: bug Something isn't working status: validated An issue that has been validated as being a bug labels Mar 27, 2024
@timyates
Copy link
Member

Confirmed as failing...

meAsParent seems to come from the protocol buffers library... Trying to work out what is going on...

@timyates
Copy link
Member

So it seems to be that Ksp is processing build/generated/source/proto/main/java/com/example/DemoReply.java and then is failing... I'm not sure Ksp processing Java code makes sense...

@timyates
Copy link
Member

timyates commented May 5, 2024

The issue is caused here in our Ksp processing

type.arguments.forEachIndexed { i, typeArgument ->
val variableName = typeParameters[i].name.asString()
typeArguments[variableName] =
resolveTypeArgument(owner, typeArgument, parentTypeArguments, visitedTypes)
}

we are expecting typeParameters and type.arguments to have the same size, which they seemingly do not in this case...

Investigations continue

@timyates
Copy link
Member

timyates commented May 9, 2024

@erkieh Think #10811 fixes it 🤞

Thanks for reporting this!

@erkieh
Copy link
Author

erkieh commented May 10, 2024

Thanks for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: kotlin Issues or features specific to Kotlin status: validated An issue that has been validated as being a bug type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants