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

Fix missing include clause in the gRPC proto compilation #36153

Merged

Conversation

cescoffier
Copy link
Member

Fix missing include statements in the proto compilation and also improve the syntax of the proto include/exclude clauses (comma-separated list accepting spaces)

Fix #36078

Fix missing include statements in the proto compilation and also improve the syntax of the proto include/exclude clauses (comma-separated list accepting spaces)
var pathToProtoFile = files.normalize().toAbsolutePath();
var pathToParentDir = files.getParent();
// Add the proto file to the list of proto to compile, but also add the directory containing the
// proto file to the list of directories to include (it's a set, so no duplicate).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why also the dir?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if you don't, it cannot resolve import statements from proto files included in the application. That was the bug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. B/c the paths are probably relative to the file (it's dir) that imports them?

@github-actions
Copy link

github-actions bot commented Sep 26, 2023

🙈 The PR is closed and the preview is expired.

@quarkus-bot

This comment has been minimized.

@cescoffier
Copy link
Member Author

The failure is related, investigating...

@quarkus-bot
Copy link

quarkus-bot bot commented Sep 26, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@cescoffier
Copy link
Member Author

I fixed the problem. It was more a CI issue than a real issue.

We were computing a directory location. With our CI we had 2 distinct locations (one from the first build and one from the IT build) leading to duplicate proto files. I fixed it to generate unique but conservative locations.

@cescoffier cescoffier requested review from alesj and geoand September 28, 2023 06:01
@cescoffier cescoffier merged commit 26f491b into quarkusio:main Sep 28, 2023
35 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.5 - main milestone Sep 28, 2023
@cescoffier cescoffier deleted the fix-include-in-grpc-proto-compilation branch October 2, 2023 05:55
@gsmet
Copy link
Member

gsmet commented Oct 3, 2023

@cescoffier should we consider backporting this for 3.4.2?

@cescoffier
Copy link
Member Author

No I think it's fine. Also, this Pr introduced a regression I fixed in another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

gRPC: Built in quarkus-maven compiler doesn't seem to handle subfolders of protos in external dependency
4 participants