ignite/modules

`ignite c serve`: Import "gogoproto/gogo.proto" was not found or had errors

lumtis opened this issue · 1 comments

Happens after config upgrade in #69

gogoproto/gogo.proto is not found or has error which doesn't occur on other chains

May it be a version issue in go.mod introduced in the PR?

cannot build app:

	cannot build app:

	error while running command /var/folders/6n/c3hb98tx2sjdxbz0cg5fy2gm0000gn/T/protoc1869618543 -I /var/folders/6n/c3hb98tx2sjdxbz0cg5fy2gm0000gn/T/3443123781 -I /Users/lucas/go/src/github.com/ignite/modules/proto -I /Users/lucas/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.46.3/proto -I /Users/lucas/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.46.3/third_party/proto --gocosmos_out=plugins=interfacetype+grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. /Users/lucas/go/src/github.com/ignite/modules/proto/claim/claim_record.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/events.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/genesis.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/initial_claim.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/mission.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/params.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/query.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/tx.proto: gogoproto/gogo.proto: File not found.
claim/claim_record.proto:6:1: Import "gogoproto/gogo.proto" was not found or had errors.
: exit status 1

Reopened as #74 didn't fix the issue

The issue still persist but it seems relate to the cache of Ignite CLI proto functionality

If proto are built on spn https://github.com/tendermint/spn

ignite generate proto-go --clear-cache
Your saved project changes have not been committed.
To enable reverting to your current state, commit your saved changes.
Do you want to proceed without committing your saved changes: y
✔ Generated Go code

Proto files can be built in modules:

ignite generate proto-go
Your saved project changes have not been committed.
To enable reverting to your current state, commit your saved changes.
Do you want to proceed without committing your saved changes: y
✔ Generated Go code

However, if proto are built and cache is cleared, the error occur:

 ignite generate proto-go --clear-cache
Your saved project changes have not been committed.
To enable reverting to your current state, commit your saved changes.
Do you want to proceed without committing your saved changes: y
Cannot build app:

error while running command /var/folders/6n/c3hb98tx2sjdxbz0cg5fy2gm0000gn/T/protoc3839553153 -I /var/folders/6n/c3hb98tx2sjdxbz0cg5fy2gm0000gn/T/1174681659 -I /Users/lucas/go/src/github.com/ignite/modules/proto -I /Users/lucas/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.46.4/proto -I /Users/lucas/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.46.4/third_party/proto --gocosmos_out=plugins=interfacetype+grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. /Users/lucas/go/src/github.com/ignite/modules/proto/claim/claim_record.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/events.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/genesis.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/initial_claim.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/mission.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/params.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/query.proto /Users/lucas/go/src/github.com/ignite/modules/proto/claim/tx.proto: gogoproto/gogo.proto: File not found.
claim/claim_record.proto:4:1: Import "gogoproto/gogo.proto" was not found or had errors.
: exit status 1

At this point even on spn proto build will fail

ignite generate proto-go
Your saved project changes have not been committed.
To enable reverting to your current state, commit your saved changes.
? Do you want to proceed without committing your saved changes? [y/N] y█
Cannot build app:

error while running command /var/folders/6n/c3hb98tx2sjdxbz0cg5fy2gm0000gn/T/protoc3111082513 -I /var/folders/6n/c3hb98tx2sjdxbz0cg5fy2gm0000gn/T/1681982844 -I /Users/lucas/go/src/github.com/tendermint/spn/proto -I /Users/lucas/go/pkg/mod/github.com/tendermint/fundraising@v0.3.1/proto -I /Users/lucas/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.46.4/proto -I /Users/lucas/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.46.4/third_party/proto -I /Users/lucas/go/pkg/mod/github.com/ignite/modules@v0.0.0-20220912090139-7c325cae763a/proto --gocosmos_out=plugins=interfacetype+grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/chain.proto /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/events.proto /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/genesis.proto /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/genesis_account.proto /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/genesis_validator.proto /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/params.proto /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/query.proto /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/request.proto /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/tx.proto /Users/lucas/go/src/github.com/tendermint/spn/proto/launch/vesting_account.proto: gogoproto/gogo.proto: File not found.
cosmos/base/v1beta1/coin.proto:4:1: Import "gogoproto/gogo.proto" was not found or had errors.
launch/chain.proto:4:1: Import "gogoproto/gogo.proto" was not found or had errors.
launch/chain.proto:6:1: Import "cosmos/base/v1beta1/coin.proto" was not found or had errors.
launch/chain.proto:35:12: "cosmos.base.v1beta1.Coin" is not defined.
: exit status 1

You need to clear cache on spn for proto build to be successful again on spn and modules

ignite generate proto-go --clear-cache
Your saved project changes have not been committed.
To enable reverting to your current state, commit your saved changes.
Do you want to proceed without committing your saved changes: y
✔ Generated Go code

-> Building proto and clearing cache in modules makes proto build failing everywhere

cc @Pantani