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

Support .textproto extension for output files in Protobuf Text Format #4066

Closed
smolkaj opened this issue Jul 14, 2023 · 2 comments · Fixed by #4352
Closed

Support .textproto extension for output files in Protobuf Text Format #4066

smolkaj opened this issue Jul 14, 2023 · 2 comments · Fixed by #4352
Labels
control-plane Topics related to the control-plane or P4Runtime. enhancement This topic discusses an improvement to existing compiler code.

Comments

@smolkaj
Copy link
Member

smolkaj commented Jul 14, 2023

The official file extension for Protobuf Text Format files is .textproto: https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files

But IIUC, currently p4c requires .txt instead in a bunch of places, e.g. to generate P4infos or table entry files.

Today:

    p4test --arch v1model \
        --p4runtime-files p4info.txt \
        --p4runtime-entries-files entries.txt \
        table-entries-ternary-bmv2.p4

Proposed:

    p4test --arch v1model \
        --p4runtime-files p4info.textproto \
        --p4runtime-entries-files entries.textproto \
        table-entries-ternary-bmv2.p4

The proposal is to start supporting .textproto and, optionally, to slowly phase out support for .txt, e.g. by initially giving a warning and eventually failing with an error.

@jafingerhut for visibility, as this came up in my review of p4lang/p4runtime#432.

@fruffy fruffy added enhancement This topic discusses an improvement to existing compiler code. p4runtime control-plane Topics related to the control-plane or P4Runtime. labels Jul 19, 2023
@qobilidop
Copy link
Member

Just one minor update. It seems the official recommendation has become .txtpb (from the same source: https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files).

@smolkaj
Copy link
Member Author

smolkaj commented Oct 21, 2023

Thanks for the update!

(I do wonder how many times more we will decide to change this recommendation.....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control-plane Topics related to the control-plane or P4Runtime. enhancement This topic discusses an improvement to existing compiler code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants