Kitex does not guarantee that generated dependency package aliases will be unique
Author: shanezhiuCreated Dec 5, 2025Updated Apr 3, 2026
Labelsbugtool
Describe the bug There is a Project Structure: reporoot/ idl │ └── protobuffer │ ├── base │ │ ├── packagea │ │ │ └── v1 │ │ │ └── examplea.proto │ │ └── packageb │ │ └── v1 │ │ └── exampleb.proto │ └── example │ └── v1 │ └── combine.proto
the file conbine.proto imports examplea.proto and exampleb.proto both.
after I do a generate action, kitex -type protobuf -I . idl/protobuffer/example/v1/combine.proto,
there are import package conflicts in generated stubs, like this:
client.go
import (
"context"
client "github.com/cloudwego/kitex/client"
callopt "github.com/cloudwego/kitex/client/callopt"
v1 "kitexidltest/kitex_gen/base/packagea/v1"
v1 "kitexidltest/kitex_gen/example/v1"
)combine.pb.go
import (
"context"
"kitexidltest/kitex_gen/base/packagea/v1"
"kitexidltest/kitex_gen/base/packageb/v1"
"github.com/cloudwego/prutal"
)
To Reproduce ReproduceRepo
Expected behavior
the genertor guarantee that generated dependency package aliases will be unique
Source: cloudwego/kitex