Juniper / warp17

The Stateful Traffic Generator for Layer 1 to Layer 7
BSD 3-Clause "New" or "Revised" License
423 stars 81 forks source link

Enable support for python3 & proto3 #129

Open manuks88 opened 2 years ago

manuks88 commented 2 years ago

Hi team, warp17 doesn't compile with python3 & proto2/proto3. Please enable support for it.

make[1]: Entering directory '/home/localadmin/warp17/warp17-1.8/api' PC-C warp17-app-http.proto [libprotobuf WARNING google/protobuf/compiler/parser.cc:562] No syntax specified for the proto file: warp17-app-http.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.) PC-PY warp17-app-http.proto [libprotobuf WARNING google/protobuf/compiler/parser.cc:562] No syntax specified for the proto file: warp17-app-http.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.) PC-XLATE warp17-app-http.proto [libprotobuf WARNING google/protobuf/compiler/parser.cc:562] No syntax specified for the proto file: warp17-app-http.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.) Traceback (most recent call last): File "./xlate-gen/warp17_xlate_gen.py", line 912, in <module> data = sys.stdin.read() File "/usr/lib/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 34: invalid start byte --custom_out: protoc-gen-custom: Plugin failed with status code 1. make[1]: *** [Makefile.api:124: generated/c/warp17-app-http.pb-c.h] Error 1 make[1]: Leaving directory '/home/localadmin/warp17/warp17-1.8/api' make: *** [Makefile:72: all] Error 2

Adding "syntax = proto2"

make[1]: Entering directory '/home/localadmin/warp17/warp17-1.8/api' PC-C warp17-app-http.proto PC-PY warp17-app-http.proto PC-XLATE warp17-app-http.proto Traceback (most recent call last): File "./xlate-gen/warp17_xlate_gen.py", line 912, in <module> data = sys.stdin.read() File "/usr/lib/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 34: invalid start byte --custom_out: protoc-gen-custom: Plugin failed with status code 1. make[1]: *** [Makefile.api:124: generated/c/warp17-app-http.pb-c.h] Error 1 make[1]: Leaving directory '/home/localadmin/warp17/warp17-1.8/api' make: *** [Makefile:72: all] Error 2

Adding "syntax = proto3"

make[1]: Entering directory '/home/localadmin/warp17/warp17-1.8/api' PC-C warp17-app-http.proto warp17-app-http.proto:84:14: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. warp17-app-http.proto:90:14: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. make[1]: *** [Makefile.api:120: generated/c/warp17-app-http.pb-c.h] Error 1 make[1]: Leaving directory '/home/localadmin/warp17/warp17-1.8/api' make: *** [Makefile:72: all] Error 2

I tried commenting out "optional" but that also failed to compile with a different set of errors.

davvore33 commented 2 years ago

Hi, yes unluckily there's no straight way to support proto3, this project is now orphan the facto so unless some developer will actually fix this no proto3/python3 support will come

manuks88 commented 2 years ago

Thanks @davvore33. For now the src code from git repo works with py3. So no need to download it from release.