whyrusleeping / gx

A package management tool
MIT License
1.88k stars 110 forks source link

why "inner import" of go-ipfs package published by gx contain hash value #234

Closed zyfrank closed 5 years ago

zyfrank commented 5 years ago

for example for 0.4.18 go-ipfs (hash is QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r)

I noticed in $GOPATH/src/gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/repo/repo.go

an import is filestore "gx/ipfs/QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r/go-ipfs/filestore

why this import contain "QmUJYo4etAQqFfSS2rarFAE97eNGB8ej64YkRT2SmsYD4r" is it changed by gx or gx-go?

I think in original 0.4.18. this import should be github.com/ipfs/go-ipfs/filestore . Because before publish this hash value is unknown.

I'm not familiar with gx. sorry for bothering.

Stebalien commented 5 years ago

When we install a gx package into $GOPATH/src/gx/..., we rewrite it's internal import paths to use gx/ipfs/... because that's where we've installed it. If we used github.com/ipfs/go-ipfs/filestore, we'd need to put the source files in github.com/ipfs/go-ipfs.

(closing for tracking, feel free to ask followup questions)

zyfrank commented 5 years ago

Thanks for reply. I'm doing an experimental plugin for ipfs, supporting storj as data store. problem I met is I make change to go-ipfs (has a dependency on my plugin) go-ipfs-config (make ipfs init working), and gx publish on my test ipfs node, )when I gx-go devscopy under vendor go-ipfs dir. , import is github.com/ipfs/go-ipfs instead of gx/ipfs/Qm....../go-ipfs, I have to sed all these change, other wise I cannot get a new comiled ipfs which can work with my plugin. any good suggest for this practice?

Stebalien commented 5 years ago

Oh dear. So, plugins + gx-go are actually really annoying for this reason. Fortunately, we're switching to go modules in the next release which should help.

So, my current recommendation is: use the latest go-ipfs master.

zyfrank commented 5 years ago

thanks a lot