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

Expose ProtoToolchainInfo to Starlark #13732

Closed
wants to merge 2 commits into from

Conversation

Yannic
Copy link
Contributor

@Yannic Yannic commented Jul 22, 2021

@Yannic Yannic requested a review from lberki as a code owner July 22, 2021 22:26
@google-cla google-cla bot added the cla: yes label Jul 22, 2021
@Yannic
Copy link
Contributor Author

Yannic commented Jul 22, 2021

@katre PTAL

Copy link
Member

@katre katre left a comment

Choose a reason for hiding this comment

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

Looks good, only one question I'm curious about.

private final Object protoCommon;
private final StarlarkAspectApi protoRegistryAspect;
private final ProviderApi protoRegistryProvider;

public ProtoBootstrap(
ProtoInfoProviderApi protoInfoApiProvider,
ProtoToolchainInfoApi.Provider protoToolchainInfoApi,
Copy link
Member

Choose a reason for hiding this comment

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

ProtoInfo is passing the actual Api class, not the Api.Provider. Why the difference here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ProtoInfo also passes the provider, but they named it ProtoInfoApi.ProtoInfoProviderApi

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see. Thanks for clarifying.

Copy link
Member

@katre katre left a comment

Choose a reason for hiding this comment

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

I'll merge this today.

@katre
Copy link
Member

katre commented Jul 23, 2021

Okay, apparently our internal Java toolchain is stricter than what we have externally. Can you investigate and fix these warning/errors:

src/main/java/com/google/devtools/build/lib/starlarkbuildapi/proto/ProtoBootstrap.java:42: warning: [rawtypes] found raw type: Provider
      ProtoToolchainInfoApi.Provider protoToolchainInfoApi,
                           ^
  missing type arguments for generic class Provider<FilesToRunProviderApiT>
  where FilesToRunProviderApiT is a type-variable:
    FilesToRunProviderApiT extends FilesToRunProviderApi<? extends FileApi> declared in interface Provider
error: warnings found and -Werror specified
Target //src/main/java/com/google/devtools/build/lib/starlarkbuildapi/proto:proto failed to build

@Yannic
Copy link
Contributor Author

Yannic commented Jul 23, 2021

cannot repro locally, but I added the missing type parameters. Let me know if there are more errors

@bazel-io bazel-io closed this in d5eeb04 Jul 27, 2021
bazel-io pushed a commit that referenced this pull request Nov 15, 2021
*** Reason for rollback ***

Starlarkification of proto_library is making progress faster than its toolchainization effort. As such adding JavaToolchainInfo directly to the Starlark implementation will be much easier than adding a native support for it (it's 2 lines of code vs. this PR).

*** Original change description ***

Expose ProtoToolchainInfo to Starlark

Progress on https://docs.google.com/document/d/1go3UMwm2nM8JHhI3MZrtyoFEy3BYg5omGqQmOwcjmNE/edit

Closes #13732.

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

Successfully merging this pull request may close these issues.

2 participants