whyrusleeping / gx-go

gx subtool for golang
MIT License
80 stars 28 forks source link

Link to a non-gx package fails #33

Open schomatis opened 6 years ago

schomatis commented 6 years ago

(Edit: I'm rewriting this issue as I did a poor attempt at explaining it the last time.)

When trying to link to a package that doesn't support gx (i.e., it doesn't contain a package.json) the gx-go link command will fail while trying to install it (with gx install).

cd $GOPATH/src/github.com/ipfs/go-ipfs
make install

go get github.com/dgraph-io/badger
export BADGER_HASH=QmdKhi5wUQyV9i3GcTyfUmpfTntWjXu8DcyT9HyNbznYrn
gx-go link $BADGER_HASH
# ERROR: Error: error during gx install: exit status 1

# Temporary workaround: copy `package.json` from the gx release to the cloned repo
wget https://ipfs.io/ipfs/$BADGER_HASH/badger/package.json -O $GOPATH/src/github.com/dgraph-io/badger/package.json
gx-go link $BADGER_HASH
whyrusleeping commented 6 years ago

ooooh, yeah, thats annoying... Maybe we should have gx-go link detect that the target package doesnt have the package.json and perform that step for you automatically.