Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ibc-go-sdk-50-simapp #151

Closed
wants to merge 12 commits into from
Closed

Add ibc-go-sdk-50-simapp #151

wants to merge 12 commits into from

Conversation

romac
Copy link
Member

@romac romac commented Aug 18, 2023

Not for merge, only testing for now.

Had to update the flake inputs to get Go 1.20 final instead of pre-release, but had to remove old packages whose source can't be found anymore for it to work.

@romac
Copy link
Member Author

romac commented Aug 24, 2023

@JonathanLorimer Any idea what might be causing this error? Haven't been able to reproduce it outside of Nix, whether on macOS or Linux...

       > Building subPackage ./modules/apps/29-fee/client/cli
       > Building subPackage ./modules/apps/29-fee/keeper
       > Building subPackage ./modules/apps/29-fee/types
       > Building subPackage ./modules/apps/transfer
       > Building subPackage ./modules/apps/transfer/client/cli
       > Building subPackage ./modules/apps/transfer/keeper
       > Building subPackage ./modules/apps/transfer/simulation
       > Building subPackage ./modules/apps/transfer/types
       > Building subPackage ./modules/capability
       > main module (github.com/cosmos/ibc-go/v7) does not contain package github.com/cosmos/ibc-go/v7/modules/capability

@JonathanLorimer
Copy link
Collaborator

@romac
https://github.com/cosmos/ibc-go/tree/v1.0.0-rc3/modules (which the top-level go mod is pointing to) does not contain /modules/capability
but that is what is being required here: https://github.com/cosmos/ibc-go/blob/upgrade-sdk-v0.50-alpha1/go.mod#L24
I have no idea how this ever worked?

@JonathanLorimer
Copy link
Collaborator

This is probably my lack of understanding of the go module system, but maybe nix things that require is pointing to the link I posted, but its actually meant to resolve to this https://github.com/cosmos/ibc-go/tree/modules/capability/v1.0.0-rc3/modules

@JonathanLorimer
Copy link
Collaborator

forgive my ignorance, but if you are actually supposed to split tags like that in the go.mod file and its supposed to map to modules/capability/v1.0.0-rc3 that seems a little crazy to me.

@JonathanLorimer
Copy link
Collaborator

The error message is kinda true main module (github.com/cosmos/ibc-go/v7) does not contain package github.com/cosmos/ibc-go/v7/modules/capability

the module name doesn't match up https://github.com/cosmos/ibc-go/blob/upgrade-sdk-v0.50-alpha1/modules/capability/go.mod#L1

TBH I am having a really hard time following what version of go everything in this repo is on / what uses go.mod and what doesn't.

And when I tree vendor/github.com/cosmos and find ibc-go I see this:

simd-v8.0.0-pre.sdk> |-- ibc-go
simd-v8.0.0-pre.sdk> |   `-- modules
simd-v8.0.0-pre.sdk> |       `-- capability
simd-v8.0.0-pre.sdk> |           |-- LICENSE
simd-v8.0.0-pre.sdk> |           |-- README.md
simd-v8.0.0-pre.sdk> |           |-- genesis.go
simd-v8.0.0-pre.sdk> |           |-- keeper
simd-v8.0.0-pre.sdk> |           |   `-- keeper.go
simd-v8.0.0-pre.sdk> |           |-- module.go
simd-v8.0.0-pre.sdk> |           |-- simulation
simd-v8.0.0-pre.sdk> |           |   |-- decoder.go
simd-v8.0.0-pre.sdk> |           |   `-- genesis.go
simd-v8.0.0-pre.sdk> |           `-- types
simd-v8.0.0-pre.sdk> |               |-- capability.pb.go
simd-v8.0.0-pre.sdk> |               |-- errors.go
simd-v8.0.0-pre.sdk> |               |-- genesis.go
simd-v8.0.0-pre.sdk> |               |-- genesis.pb.go
simd-v8.0.0-pre.sdk> |               |-- keys.go
simd-v8.0.0-pre.sdk> |               `-- types.go

@crodriguezvega
Copy link

Thanks for the investigation on this issue, @JonathanLorimer. It's very weird: ibc-go imports the capability module and the capability module has its own go.mod so there shouldn't be any github.com/cosmos/ibc-go/v7/modules/capability, but instead github.com/cosmos/ibc-go/modules/capability (v7 applies only to ibc-go). I don't understand why it's trying to look for github.com/cosmos/ibc-go/v7/modules/capability...

@romac romac closed this Sep 7, 2023
@romac romac deleted the ibc-go-sdk-50 branch September 7, 2023 12:28
@romac
Copy link
Member Author

romac commented Sep 7, 2023

Superseded by #160 for IBC Go v8-alpha.1.

Unfortunately the build still fails with a similar error: #160 (comment)

@soareschen
Copy link
Collaborator

Subdirectories that contain their own go.mod have to be manually excluded from the Nix package definition using excludedPackages. Otherwise Nix would assume that all Go code in the source belong to the same Go module, hence why the build failed.

I think this is more of an issue of code organization in Go projects like ibc-go. Ideally, each Go module should be placed in their own subdirectory within the project, instead of nesting one module within the subdirectory of another. Doing so would also make it easier for external users to discover what Go modules are offered by a Go project by simply scanning a root directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants