Skip to content

Kitex does not guarantee that generated dependency package aliases will be unique #1892

@shanezhiu

Description

@shanezhiu

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions