rules_proto icon indicating copy to clipboard operation
rules_proto copied to clipboard

How to define new proto_lang_toolchains?

Open prestonvanloon opened this issue 5 years ago • 2 comments

I'm wondering how to write and use new proto_lang_toolchains. Are there any examples or a design doc?

Related:

  • https://github.com/bazelbuild/rules_go/issues/2266
  • https://github.com/grpc-ecosystem/grpc-gateway/issues/1094#issuecomment-562910981

prestonvanloon avatar Dec 09 '19 15:12 prestonvanloon

We don't have a new proto_lang_toolchain yet (and there probably won't be a proto_lang_toolchain as we know it from native after the migration because it's insufficient in some [maybe most] cases). We'll provide docs/guides how to write proto rules when we start implementing the functionality (Currently planing to get the plumbing done in Q1).

Design doc for the migration is here: https://docs.google.com/document/d/1u95vlQ1lWeQNR4bUw5T4cMeHTGJla2_e1dHHx7v4Dvg/edit#

TL;DR: Create proto_toolchain that exposes the proto-related commandline options, migrate {cc,java,java_lite}_proto_library to Starlark (in parallel, migrate other rules like go_proto_library to the "framework"), and then figure out how to migrate proto_library. Everything will be as compatible as possible to the current status-quo, there'll be no "flag-day" where we migrate everyone from native to Starlark.

Yannic avatar Dec 09 '19 16:12 Yannic

I think the docs are supposed to be here: https://docs.google.com/document/d/1CE6wJHNfKbUPBr7-mmk_0Yo3a4TaqcTPE0OWNuQkhPs/edit#heading=h.5mcn15i0e1ch

But it's still not clear how I write a foo_proto_library rule using the new toolchains.

ribrdb avatar Jul 19 '24 15:07 ribrdb