cjnaz / rclonesync-V2

A Bidirectional Cloud Sync Utility using rclone
MIT License
355 stars 39 forks source link

Rclone 1.53.1 incompatibility #64

Closed addcninblue closed 4 years ago

addcninblue commented 4 years ago

Hello,

First and foremost, thanks for making this wonderfully useful tool! I wanted to bring to your attention recent changes in rclone that might cause incompatibility issues with rclonesync.

I have upgraded to rclone 1.53.1, but it appears that this version is incompatible with rclonesync because of the rclone version output:

New format:

rclone 1.53.1
- os/arch: linux/amd64
- go version: go1.15.2

Old format:

rclone v1.41
- os/arch: linux/amd64
- go version: go1.10

(Note the difference between the old v1.41 format and the new 1.53.1 format)

Based on the source code here: https://github.com/cjnaz/rclonesync-V2/blob/7f225ce01c5c166adee63e1f4b3a7b619d31c4b8/rclonesync#L782, it appears that the check expects a v which the new version has removed.

I am unsure if there are any breaking changes otherwise, but this is what I discovered due to upgrading.

Thanks again!

cjnaz commented 4 years ago

Damn! I'll make it work with and without the 'v'. Thanks!

addcninblue commented 4 years ago

I think re.compile(r"v?(\d+)\.(\d+).*") should probably work! Here's a testing link.

I haven't tested that there are any breaking changes elsewhere, so I'm not sure this is the only thing that would need to change. Thanks again so much for your work!

cjnaz commented 4 years ago

I pulled rclone 1.53.1 from https://downloads.rclone.org/v1.53.1/.

../../rclone1.53.1/rclone -V
rclone v1.53.1
- os/arch: linux/amd64
- go version: go1.15

The go version is different also. Where did you download your version from?

addcninblue commented 4 years ago

I'm on NixOS, and I believe I'm using this derivation: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/sync/rclone/default.nix

which basically downloads the source and compiles it.

cjnaz commented 4 years ago

I'm guessing that the problem is an artifact of the NixOS build script. It looks like it's working around the 'v' in the version number. Try sticking a 'v' into the buildFlagsArray line to match the rev = "v${version}"; line.

buildGoModule rec {
  pname = "rclone";
  version = "1.53.1";

  src = fetchFromGitHub {
    owner = pname;
    repo = pname;
    rev = "v${version}";
    sha256 = "1yi6n5ip680ydqhz8fnd0igr8dy7zzhpx37mdgahsfac7cwf6k0q";
  };

  ...

  buildFlagsArray = [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];

It's benign to adjust rclonesync to tolerate no 'v', so I'll get to it after some other work. The proper fix may really belongs to the NixOS build script.

cjnaz commented 4 years ago

V3.1.1 adds support for the optional 'v'.

addcninblue commented 4 years ago

thanks a lot! I forgot to reply to this.