sourcenetwork / defradb

DefraDB is a Peer-to-Peer Edge Database. It's the core data storage system for the Source Network Ecosystem, built with IPLD, LibP2P, CRDTs, and Semantic open web properties.
436 stars 42 forks source link

DefraDB as a library requires module replacement #2007

Open nasdf opened 12 months ago

nasdf commented 12 months ago

When using DefraDB as a library the following module replacements must be copied to the project's go.mod in order for it to compile.

replace (
    github.com/dgraph-io/badger/v4 => github.com/sourcenetwork/badger/v4 v4.0.0-20230801145501-d3a57bd4c2ec
    github.com/graphql-go/graphql => github.com/sourcenetwork/graphql-go v0.7.10-0.20230511091704-fe7085512c23
    github.com/textileio/go-libp2p-pubsub-rpc => github.com/sourcenetwork/go-libp2p-pubsub-rpc v0.0.0-20230209220544-e16d5e34c4fc
)
fredcarle commented 12 months ago

This means that we should import the forks instead of the original.

nasdf commented 12 months ago

This means that we should import the forks instead of the original.

How does that work with different module paths?

fredcarle commented 12 months ago

How does that work with different module paths?

For example, we replace all instances of github.com/dgraph-io/badger/v4 in the import statements to github.com/sourcenetwork/badger/v4

nasdf commented 12 months ago

How does that work with different module paths?

For example, we replace all instances of github.com/dgraph-io/badger/v4 in the import statements to github.com/sourcenetwork/badger/v4

I thought the import paths and module names had to match.

fredcarle commented 12 months ago

I thought the import paths and module names had to match.

I'm not sure how they would be different even with the change?

github.com/sourcenetwork/badger/v4 still has badger as it's module name.

nasdf commented 12 months ago

I thought the import paths and module names had to match.

I'm not sure how they would be different even with the change?

github.com/sourcenetwork/badger/v4 still has badger as it's module name.

Getting this error if I try to change the imports.

go: github.com/sourcenetwork/badger/v4@v4.0.0-20230801145501-d3a57bd4c2ec: parsing go.mod:
    module declares its path as: github.com/dgraph-io/badger/v4
            but was required as: github.com/sourcenetwork/badger/v4
fredcarle commented 12 months ago

Ah yes I see. We need to update our forks module names to match the path of the fork's repos

alipostaci2001 commented 11 months ago

go: github.com/sourcenetwork/badger/v4@v4.0.0-20230801145501-d3a57bd4c2ec: parsing go.mod: module declares its path as: github.com/dgraph-io/badger/v4 but was required as: github.com/sourcenetwork/badger/v4

        same to me , as well
fredcarle commented 11 months ago
        same to me , as well

@alipostaci2001, if you update to v0.8 this should be fixed. Let me know if you still get the problem with that version.