That is true that there is a cyclical dependency between protoc and some
generated code such as descriptor.pb.cc. The way we get around this is that
we check the generated pb.cc and pb.h files into version control, and the
generate_descriptor_proto.sh
<https://github.com/protocolbuffers/protobuf/blob/master/generate_descriptor_proto.sh>
script rebuilds them.

On Thu, Sep 17, 2020 at 6:25 PM Yakov Prager <ypra...@gmail.com> wrote:

> Hello friends,
>
> When building the Protobuf (version 3.13.0) solution in the Microsoft
> Visual Studio, I noticed that a generated file any.pb.cc is compiled
> _before_ the protoc executable is created.  (The same is true for multiple
> other generated files.)  -- At first sight, that dependency looks like a
> vicious cycle: a file that can only be generated by protoc.exe is used in
> building protoc.exe.  If that is true, then how, for example, can one make
> a change to the protoc code that would somehow influence the structure of
> the resulting generated files? -- You need the updated any.pb.cc file in
> order to build the new protoc.exe, but in order to build the latter you
> need the updated version of the former!
>
> Does anybody here know the internals of Protobuf well enough to explain
> that?
>
> Many thanks in advance,
>
> -Yakov
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/c776ffb7-3f26-4fd4-92a4-4cf9ff9520cen%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/c776ffb7-3f26-4fd4-92a4-4cf9ff9520cen%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CADqAXr7hcX53Z9NqPEJwLoxGSf7e9FoRKo_OE97LTSwWrDgHfQ%40mail.gmail.com.

Reply via email to