bazelbuild / rules_proto

Protocol buffer rules for Bazel
Apache License 2.0
167 stars 69 forks source link

How to define new proto_lang_toolchains? #40

Open prestonvanloon opened 4 years ago

prestonvanloon commented 4 years ago

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

Related:

Yannic commented 4 years ago

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.

ribrdb commented 4 months ago

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.