whyrusleeping / gx

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

ERROR: from shell.Get(): symlink not supported by windows #182

Open ivan386 opened 6 years ago

ivan386 commented 6 years ago

I can't build ipfs with that.

..\github.com\ipfs\go-ipfs>gx install --global --nofancy
[get ] [fetch]   go-multihash                  QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8
ERROR: from shell.Get(): symlink ../bin \src\gx\ipfs\QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8.part\go-multihash\test\sharness\bin: not supported by windows
retrying fetch QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8 after a second...
ERROR: from shell.Get(): symlink ../bin \src\gx\ipfs\QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8.part\go-multihash\test\sharness\bin: not supported by windows
retrying fetch QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8 after a second...
ERROR: from shell.Get(): symlink ../bin \src\gx\ipfs\QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8.part\go-multihash\test\sharness\bin: not supported by windows
[err ] [fetch]   go-multihash                  QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8 symlink ../bin G:\Develop\go\src\gx\ipfs\QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fK
ERROR: install deps: failed to fetch dependencies
Stebalien commented 6 years ago

@djdv gx uses the API and then extracts the tar files itself. Do we need to register a path sanitizer?

djdv commented 6 years ago

@Stebalien Yes, once https://github.com/ipfs/go-ipfs/pull/4956 is finalized/merged, I'll replicate the behaviour here: https://github.com/ipfs/go-ipfs-api/pull/90 This still requires that users have symlink creation privileges though, or in Go 1.11 on Windows 10, enable "Developer Mode".

djdv commented 6 years ago

Actually @ivan386

not supported by windows

This appears to be the error returned on Windows XP, which does not support symlinks officially. The proposed fix always tries to create links first, so if you can successfully create them (by using unofficial patches), it should work. However Go is explicitly inserting this error on the platform so it would have to be dealt with upstream in Go's os.Symlink.

ivan386 commented 6 years ago

workaround

ipfs get -a QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8

Unpack tar to \src\gx\ipfs