tbenz9 / siasync

miniscule utility to sync a folder with Sia
MIT License
67 stars 10 forks source link

Adopt to Sia 1.4.7 #22

Closed chrsch closed 4 years ago

chrsch commented 4 years ago

This PR provides fixes to use Siasync with Sia 1.4.7

tbenz9 commented 4 years ago

Hey @chrsch great to hear from you and thanks for submitting this! Have you got a screenshot or asciinema showing it works with 1.4.7? I really need to get some automated testing for Siasync but I'm not quite there yet...

chrsch commented 4 years ago

Hi @tbenz9, I'll provide a video or asciinema, not yet sure what illustrates in a nicer way. Also, I will update this PR so siasync will also properly support empty directories ;-)

capusta commented 4 years ago
root@0c8ab15a5972:/src# make
go build -o siasync *.go
# command-line-arguments
./main.go:147:16: cannot use *address (type string) as type client.Options in argument to client.New
make: *** [Makefile:10: build] Error 2
root@0c8ab15a5972:/src# go version
go version go1.14.2 linux/amd64

Is there a standard way of building I'm missing ? Thank you.

chrsch commented 4 years ago

@tbenz9

@capusta It's pretty much the way to build it. Or simply "go build".

capusta commented 4 years ago
root@51d21a0fba08:/src# make dependencies
go get -u github.com/sirupsen/logrus
go get -u gitlab.com/NebulousLabs/Sia/node/api/client
go get -u github.com/fsnotify/fsnotify
go get -u gitlab.com/NebulousLabs/Sia/modules
go get -u gitlab.com/NebulousLabs/Sia/build
root@51d21a0fba08:/src# echo $?
0
root@51d21a0fba08:/src# git log -1 --format=format:%H
1a59025b4d2bde9584b3b1ae557df8af0e687de0
root@51d21a0fba08:/src# go build
# _/src
./main.go:149:16: cannot use *address (type string) as type client.Options in argument to client.New
root@51d21a0fba08:/src# echo $?
2
root@51d21a0fba08:/src# make
go build -o siasync *.go
# command-line-arguments
./main.go:149:16: cannot use *address (type string) as type client.Options in argument to client.New
make: *** [Makefile:10: build] Error 2
root@51d21a0fba08:/src# echo $?
2
root@51d21a0fba08:/src# go version
go version go1.14.2 linux/amd64
root@51d21a0fba08:/src# echo $GOPATH
/go
root@51d21a0fba08:/src# ls /go
bin  pkg  src
root@51d21a0fba08:/src# ls /go/pkg/*/*
/go/pkg/linux_amd64/github.com:
fsnotify  sirupsen

/go/pkg/linux_amd64/gitlab.com:
NebulousLabs

i hope im not being fancy here

on my mac> git log -1 --format=format:%H
1a59025b4d2bde9584b3b1ae557df8af0e687de0

and i hope im not running those fancy commands from a non-documented env. docker run -v $(pwd):/src -ti golang:1.14.2 bash

chrsch commented 4 years ago

@capusta Tried it using docker and it works also well for me (running cmd from the repository dir)

docker run --rm -v "$PWD":/usr/src/siasync -w /usr/src/siasync golang:1.14 make dependencies && go build -v

tbenz9 commented 4 years ago

Thank you so much for these improvements! Let me do a little testing and I'll roll a new release with your name on it.

capusta commented 4 years ago

we-e-e-i-r-d.

~/siasync$ docker run --rm -v "$PWD":/usr/src/siasync -w /usr/src/siasync golang:1.14 sh -c "make dependencies; make"
go get -u github.com/sirupsen/logrus
go get -u gitlab.com/NebulousLabs/Sia/node/api/client
go get -u github.com/fsnotify/fsnotify
go get -u gitlab.com/NebulousLabs/Sia/modules
go get -u gitlab.com/NebulousLabs/Sia/build
go build -o siasync *.go
# command-line-arguments
./main.go:149:16: cannot use *address (type string) as type client.Options in argument to client.New
make: *** [Makefile:10: build] Error 2

well ... either one i guess ...

 docker run --rm -v "$PWD":/usr/src/siasync -w /usr/src/siasync golang:1.14 sh -c "make dependencies; go build -v"
go get -u github.com/sirupsen/logrus
go get -u gitlab.com/NebulousLabs/Sia/node/api/client
go get -u github.com/fsnotify/fsnotify
go get -u gitlab.com/NebulousLabs/Sia/modules
go get -u gitlab.com/NebulousLabs/Sia/build
_/usr/src/siasync
# _/usr/src/siasync
./main.go:149:16: cannot use *address (type string) as type client.Options in argument to client.New
chrsch commented 4 years ago

@capusta eventually I found the error when compiling arm64 binaries. I provided a fix to compile with Sia v1.4.8 here https://github.com/vcomtec/siasync master branch. PR here will follow.