Namespaced nested imports not being found
thoraxe opened this issue · 2 comments
All protobuf files are here:
https://github.com/OpenShiftDemos/srt-godot-test/tree/main/proto
Snippet:
DualStickRawInputCommandBuffer.proto
syntax = "proto2";
package redhatgamedev.srt;
import "box2d.proto";
message DualStickRawInputCommandBuffer
{
required box2d.PbVec2 pbv2Move = 1;
required box2d.PbVec2 pbv2Shoot = 2;
}
box2d.proto
syntax = "proto2";
package box2d;
message PbVec2 {
required float x = 1;
required float y = 2;
}
Results in compilation error:
/home/thoraxe/Red_Hat/openshift/srt-godot-test/proto/DualStickRawInputCommandBuffer.proto: analysis.
/home/thoraxe/Red_Hat/openshift/srt-godot-test/proto/DualStickRawInputCommandBuffer.proto:9:5: error: Type 'box2d.PbVec2' of the 'pbv2Move' field undefined
/home/thoraxe/Red_Hat/openshift/srt-godot-test/proto/DualStickRawInputCommandBuffer.proto:10:5: error: Type 'box2d.PbVec2' of the 'pbv2Shoot' field undefined
/home/thoraxe/Red_Hat/openshift/srt-godot-test/proto/DualStickRawInputCommandBuffer.proto: analysis error.
It appears that import parsing may not be working correctly. PbVec2
is defined in box2d.proto
which is imported by DualStickRawInputCommandBuffer.proto
.
This appears to be a namespacing type issue.
godobuf doesn't namespace items imported. So, because box2d.proto
defines PbVec2
and not box2d.PbVec2
, it's not found.
If I change the required
statements:
{
required PbVec2 pbv2Move = 1;
required PbVec2 pbv2Shoot = 2;
}
This successfully compiles.
I'm not sure if this is a Godobuf bug, a feature, or something bad about our implementation of Protobuf definitions.
Hi, Erik.
Packages is not supported (see readme.md). Maybe this is the problem?