ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.18k stars 3.02k forks source link

Windows builds no longer working #2630

Closed slothbag closed 8 years ago

slothbag commented 8 years ago

So I have tried deleting all go dependencies and rebuilding from scratch, I do a gx i which fetches all the deps.

Then following the Windows manual build steps in the doco I get these errors:

# gx/ipfs/QmXDvxcXUYn2DDnGKJwdQPxkJgG83jBTp5UmmNzeHzqbj5/go-libp2p/testutil
c:\src\gx\ipfs\QmXDvxcXUYn2DDnGKJwdQPxkJgG83jBTp5UmmNzeHzqbj5\go-libp2p\testutil\gen.go:103: cannot use p.PrivKey (type "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto".PrivKey) as type "github.com/ipfs/go-libp2p-crypto".PrivKey in argument to p.ID.MatchesPrivateKey:
        "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto".PrivKey does not implement "github.com/ipfs/go-libp2p-crypto".PrivKey (wrong type for Equals method)

and other similar errors

Before v0.4.1 it was building fine.

djdv commented 8 years ago

What commit are you trying to build? On Windows I can build the latest master f1df72b1deefb6321df4bdccc8fe04a549c9bf17 without any problems. Make sure to follow these instructions: https://github.com/ipfs/go-ipfs/blob/master/docs/windows.md I personally am using Windows 10 with Go 1.6 as well as git and make from msys2 so the full process for me is

go get -u github.com/ipfs/go-ipfs
go get -u github.com/whyrusleeping/gx
go get -u github.com/whyrusleeping/gx-go
cd %GOPATH%/src/github.com/ipfs/go-ipfs
gx --verbose install --global
make install

Doing so results in a working ipfs binary in %GOPATH%\bin

You don't actually need to install make if you don't have it, you can use just the Go tool (see the link above).

slothbag commented 8 years ago

I'm using Go1.5, is IPFS no longer compatible with 1.5?

I have been trying to build from v0.4.1 tag all the way till now. I'm not using make but doing the manual method as explained in the doc which had been working for me.

chriscool commented 8 years ago

Go version should be at least 1.5.2. The minimum versions of Go, gx and gx-go that are needed are now at the top of the Makefile in the root directory.

slothbag commented 8 years ago

Thanks, I am now using Go1.6.2. Did a git pull, then a gx i, and followed manual build steps as per doco.. Oh and i'm using latest gx and gx-go.

Same bunch of errors..

# gx/ipfs/QmRHqYZs3Diy8YC3bW16zvs8VDDwS2ARKBuKwALxEMqibc/go-libp2p-transport
c:\go16\src\gx\ipfs\QmRHqYZs3Diy8YC3bW16zvs8VDDwS2ARKBuKwALxEMqibc\go-libp2p-transport\tcp.go:179: cannot use d.laddr (type "gx/ipfs/QmcobAGsCjYt5DXoq9et9L8yR8er7o7Cu3DTvpaq12jYSz/go-multiaddr".Multiaddr) as type "github.com/jbenet/go-multiaddr".Multiaddr in argument to loggables.Dial:
        "gx/ipfs/QmcobAGsCjYt5DXoq9et9L8yR8er7o7Cu3DTvpaq12jYSz/go-multiaddr".Multiaddr does not implement "github.com/jbenet/go-multiaddr".Multiaddr (wrong type for Decapsulate method)
whyrusleeping commented 8 years ago

@slothbag could you try deleting $GOPATH/src/gx and try installing again?

slothbag commented 8 years ago

Yup, that fixed it @whyrusleeping

So what happened there? Was the immutable content wrong or did it simply need to perform a gx hook step?

whyrusleeping commented 8 years ago

What generally has happened when i see this is that a download hung or broke midway through and didnt get to finish downloading all the code and run the post-install hook. I pushed a commit to gx that makes the downloads more 'all or none': https://github.com/whyrusleeping/gx/commit/0d77383b0c966a122134249fed5adbe24b1e6e7a

This should be less likely to happen in the future

slothbag commented 8 years ago

I had experienced in the past if cancelling a download half way through it would leave stale half completed downloads in the folder. Which I presume gx was then assuming on subsequent runs that the content was complete and valid.

What about a -rescan flag that would force gx to recalculate the hash of the package instead of just the existence of the directory?

This issue is resolved.