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

Codegen plugins from system search path no longer work #699

Closed
ateirney opened this issue May 2, 2023 · 5 comments · Fixed by #675
Closed

Codegen plugins from system search path no longer work #699

ateirney opened this issue May 2, 2023 · 5 comments · Fixed by #675

Comments

@ateirney
Copy link
Contributor

ateirney commented May 2, 2023

After upgrading from 0.8.19 to 0.9.X I was no longer able to use codegen plugins that should be located using the system path.

The error that was given was the following.

ExecutableLocator with name 'bq-schema' not found.

@YifeiZhuang
Copy link
Collaborator

The system search path is not working for me either. I got this error:

 Caused by: org.gradle.api.GradleException: protoc: stdout: . stderr: protoc-gen-grpc: program not found or is not executable
    --grpc_out: protoc-gen-grpc: Plugin failed with status code 1.

looking at the command generated it seems not correct: --plugin=protoc-gen-grpc=protoc-gen-grpc,

reproduction using direct protoc call:

$ protoc --grpc_out=/tmp --plugin=protoc-gen-grpc=protoc-gen-grpc src/grpc/proto/io/grpc/testing/integration/empty.proto
protoc-gen-grpc: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.

@YifeiZhuang
Copy link
Collaborator

The error in #699 (comment) is gone when the the plugin executable is in the current build directory! But if the plugin in the system search PATH, it fails with program not found or is not executable.

@andrew-teirney could you show your configuration and more detailed gradle build error? I can't reproduce your error.

@ateirney
Copy link
Contributor Author

ateirney commented May 9, 2023

I have just created a sample project that I believe reproduces my error.

https://github.com/ateirney/google-protobuf-issue.git is the repository with the replication of the issue.

If I attempt to add an executable locator using the below construct I get the error you encountered above. Historically I have not had to provide an executable locator.

protobuf {
    ...
    plugins {
        id("bq-schema") {
        }
    }
    ...
}

@ateirney
Copy link
Contributor Author

ateirney commented May 9, 2023

Further to the above, in an older version of the plugin (specifically 0.8.2) without providing an executable locator the following would be emitted.

protoc plugin 'bq-schema' not defined. Trying to use 'protoc-gen-bq-schema' from system path

@YifeiZhuang
Copy link
Collaborator

Thank you @ateirney, I can also reproduce and verify your fix.

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

Successfully merging a pull request may close this issue.

3 participants