Erin is correct.

For #2, the command-line syntax to have the compiler echo back capnp format
(with all type IDs defined explicitly) is:

    capnp compile -ocapnp foo.capnp

This of course requires that `capnp` and the generator plugin
`capnpc-capnp` are in your $PATH, which they should be after installing
Cap'n Proto globally. If you haven't installed it globally, you can do:

    path/to/capnp compile -opath/to/capnpc-capnp foo.capnp

In any case, the output will go to the terminal (no files are generated).

-Kenton

On Wed, Nov 25, 2020 at 1:52 PM Erin Shepherd <erin.sheph...@e43.eu> wrote:

> 1. This depends. The only places that the IDs get used "behind the scenes"
> are (a) those on interfaces are used in RPC calls to identify the interface
> and (b) when encoding schema annotations
>
> On the other hand, someone might be explicitly reading the ID from the
> schema file or the constant from the generated code
>
> 2. capnpc can be asked to generate capnp format output. In that case,
> it'll emit a copy of the schema with comments stripped and all
> automatically generated IDs inserted. You can grab the ID (and syntax) from
> there
>
> - Erin
>
> On Wed, 25 Nov 2020, at 20:39, Matt Stern wrote:
>
> Hi all,
>
> Suppose I have a simple schema file:
>
> 0xabbeabbeabbeabbe;
>
> struct Foo {
>   val @0 : UInt32;
> };
> struct Bar {
>   val @1 : UInt32;
> };
>
> I would like to move Bar into a separate schema file. If I understand the
> docs <https://capnproto.org/language.html#unique-ids> correctly, then
> this will change Bar's unique ID.
>
> I have two questions about that:
>
>    1. Will changing Bar's unique ID cause backwards incompatibility with
>    old messages that are serialized with the old ID?
>    2. If so, what can I do to prevent this? I would like my change to
>    have no side-effects (a pure no-op).
>
> Thanks!
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capnproto+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/capnproto/aa247efb-ca69-40fa-97a7-415792fd0c1dn%40googlegroups.com
> <https://groups.google.com/d/msgid/capnproto/aa247efb-ca69-40fa-97a7-415792fd0c1dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capnproto+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/capnproto/a98c4968-c814-4c16-a7ed-a299b3d10688%40www.fastmail.com
> <https://groups.google.com/d/msgid/capnproto/a98c4968-c814-4c16-a7ed-a299b3d10688%40www.fastmail.com?utm_medium=email&utm_source=footer>
> .
>

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

Reply via email to