Open duskmoon314 opened 1 month ago
@jonathan-dilorenzo, I believe you recently added this field. I suspect the optional
qualifier may have slipped in by acident?
Thanks for reporting the issue, @duskmoon314.
optional
support was added in proto 3.15
I think we discussed this at the time and decided to keep it.
@duskmoon314 is using protoc v3.12.4 which is very old.
Even the "p4lang toolchain", which is not updated frequently, is using v3.18
Nonetheless, good question. No idea why I put the optional qualifier in there. Let me take an AI to get rid of it (and add a comment about when the field was introduced at the same time).
@duskmoon314 is using protoc v3.12.4 which is very old.
This one is installed via apt, and it is v3.12.4 on Ubuntu 22.04.
But I also see the error when using update.sh
. It uses the image p4lang/third-party
. There may still be some version issues that need to be fixed.
Oh, I didn't notice that the last build of that image was two years ago. Should the image be updated, or should I use Bazel to build the proto instead of codegen/
?
But I also see the error when using update.sh. It uses the image p4lang/third-party. There may still be some version issues that need to be fixed.
That sounds unlikely. The script is run every time the main branch is updated. This is the latest run, from last week: https://github.com/p4lang/p4runtime/actions/runs/8991480949
Oh, I didn't notice that the last build of that image was two years ago.
This is accurate, but it still comes with protoc v3.18.1:
$ docker run -ti p4lang/third-party:latest protoc --version
libprotoc 3.18.1
It's unlikely anyone is going to update this image unless it is required (e.g., for some CI purposes).
Em, I think I got the wrong image. I need to check what's wrong with docker.
Here is the output when I run p4lang/third-party
on my machine:
❯ docker pull p4lang/third-party
Using default tag: latest
latest: Pulling from p4lang/third-party
4f53fa4d2cf0: Already exists
6af7c939e38e: Already exists
903d0ffd64f6: Already exists
04feeed388b7: Already exists
fda0447a2aef: Already exists
d542ede27a5b: Already exists
b51b1233ed05: Already exists
c82aee7e3df0: Already exists
dfbd36aecb5f: Already exists
e4a0a292616b: Already exists
2a545cc6126f: Already exists
fddeaa06596f: Already exists
f9b99e89d373: Already exists
4e7b4af9333f: Already exists
a87f1c53893b: Already exists
11b7960c4654: Already exists
846e5f482b63: Already exists
5c787c58e206: Already exists
34599a8d9776: Already exists
a6c7643c8f08: Already exists
Digest: sha256:a0f2e9a741bab06cc8dd478183541c1260ca4e174d954a21af3eb7e63559dd8b
Status: Downloaded newer image for p4lang/third-party:latest
docker.io/p4lang/third-party:latest
❯ docker run -it --rm p4lang/third-party bash
root@aee361934b1f:/# protoc --version
libprotoc 3.6.1
For some unknown reason, the image I got via docker pull p4lang/third-party
is one built four years ago. Once I explicitly pulled the latest one via digest, I got the correct one with protoc v3.18.1.
This is not the correct sha for the current p4lang/third-party:latest
image.
The correct one is sha256:9c5f3218965dc63c0a03023721a44ea9920067de0ff8a2c69a2d8baac34b1818
, as per https://hub.docker.com/repository/docker/p4lang/third-party/general
I am able to pull the same image as you if I provide the same sha explicilty: docker image pull p4lang/third-party@sha256:a0f2e9a741bab06cc8dd478183541c1260ca4e174d954a21af3eb7e63559dd8b
. It must be an older version of the image that is still present in the Docker registry, but without a tag.
You could try pulling with the correct sha.
Looks like I replied just as you edited the post. Not sure why you are seeing a stale image by default when you use latest
... Does your employer / university use a proxy cache for docker access?
Does your employer / university use a proxy cache for docker access?
I'm using the machine of our lab and the manager added a register-mirror
several month ago before granting access to me. I delete that config and can pull the correct image now.
I'm testing update.sh
now. Hopes everything works fine.
Thanks for your help. No error occurs now!
I assume the use of this keyword in intentional and close this issue for now.
Let's keep this open until we have also resolved https://github.com/p4lang/p4runtime/issues/482#issuecomment-2108305494. The optional
keyword was not intentional here.
@jonathan-dilorenzo, would you be able to send a quick follow-up so we can close this?
I'm trying to add scripts to generate rust code and encountered this error.
In
proto/p4/config/v1/p4info.proto
, anoptional
is used at L314:When generating codes with protoc, an error occurs (no matter what language is targeted):
I'm not very familiar with protobuf. Should this
optional
be removed, or should the flag--experimental_allow_proto3_optional
be used after all protoc usage?