rsync icon indicating copy to clipboard operation
rsync copied to clipboard

Please provide precompiled binaries

Open Richie765 opened this issue 3 years ago • 11 comments

Compiling from source isn't trivial and build instructions are underdocumented and requires root access to install required dev packages. Updating such a basic utility doesn't justify the amount of work involved.

The latest of the major distro's ship with older versions of rsync that contain trivial bugs.

  • ubuntu 20.04 - v3.1.3
  • centos - v3.1.2
  • Debian 10 - 3.1.3

It would help a lot if latest precompiled static binary and/or rpm/deb packages were made available.

Richie765 avatar Jul 19 '20 15:07 Richie765

I won't be making any statically linked binaries available in order to make sure that we are on the right side of any license issues distributing openssl crypto & xxhash in a GPL app. Someone is free to produce their own (non redistributed) statically linked version though (or to leave out xxhash & libcrypto).

I did make the CI builds save off their (dynamically linked) rsync builds in github Artifacts. You can click on the Actions tab and look at the most recent build to see them.

I also made a few builds from the testing build farm available here: https://download.samba.org/pub/rsync/binaries/

I don't have control over the configuration of most of those hosts, though, so a lot of them are sadly lacking xxhash, zstd, etc.

WayneD avatar Jul 21 '20 02:07 WayneD

I did not know about those binaries, that is helpful.

Richie765 avatar Jul 21 '20 13:07 Richie765

I came across this because lately rsync has been just hanging and never finishes a backup. So I tried to double check args to ensure nothing was conflicting...nope all should be good...hell let's just build from source, package is very old, perhaps this is fixed in a newer. ./configure just spits out missing dependency warnings but never actually says what it needs. So I do best guessing trying to find what it's actually after...to no avail.

I guess the best middle ground to avoid said licensing issues is just update/improve the build instructions. I've got a VM I'm ruining with "kitchen sink" style installs trying to find the stupid libs it wants rather than --disable-EVERYTHING! heh.

nPHYN1T3 avatar Jul 23 '20 01:07 nPHYN1T3

After some hairpulling I got it working like this. It can be used as a starting point for the docs. Not sure if it is the complete story though.

# centos
sudo yum install libcrypto
sudo yum install openssl-devel
sudo yum install xxhash-devel
sudo yum install lz4-devel
sudo yum install libzstd-devel

# ubuntu
sudo apt install libssl-dev
sudo apt install libxxhash-dev
sudo apt install libzstd-dev
sudo apt install liblz4-dev

# both
./configure
make
sudo make install

Richie765 avatar Jul 23 '20 13:07 Richie765

No need to pull your hair out but I appreciate the heads up. Part of what makes this a suck fest is what you've illustrated. One distro calls is libXXX the other calls it XXX-del-lib. The lack of consistency in packages can make tracking this down a PITA unless you're already in the know. I can see why I couldn't find the ssl, because I was looking for OPENssl but the package is just libssl. This is one of those times I want to say "Can't we just agree on a naming convention?!" but then a obnoxious voice comes from behind "Similarity breeds in weakness." It would be nice if the build process had some interface to track the dependencies down on a specific platform to give the user a better picture to complete the build. Alternately package maintainers for distros could just leave build dependencies and flags in the package description. Might not be perfect if something changes between the old distro binary and a new source version but every breadcrumb helps.

Sadly tried sudo apt install libssl-dev libxxhash-dev liblz4-dev libzstd-dev and much like when I was hunting there is no xxhash in 18.04.04.

nPHYN1T3 avatar Jul 23 '20 17:07 nPHYN1T3

I wrote up some package details in the latest INSTALL.md file. You can see the html version here: https://download.samba.org/pub/rsync/INSTALL

If folks have hints for other OSes, let me know.

WayneD avatar Jul 24 '20 00:07 WayneD

Oh wow, the install instructions look very clear now! 👍

Richie765 avatar Jul 24 '20 07:07 Richie765

So I just tried to build again, no dice. I suspect this is an issue because I'm building on 18.04.5 and despite the packages being installed there is no aclocal in path. I tried to add the full path to prepare-source.mak but still no dice...

I noticed on the https://download.samba.org/pub/rsync/INSTALL page the commands are wrong for debian. I suspect the syntax is again for a newer build as the -y flag does not work with apt in 18.04 only apt-get.

acl is already the newest version (2.2.52-3build1). libacl1-dev is already the newest version (2.2.52-3build1).

aclocal -I m4 make: aclocal: Command not found prepare-source.mak:7: recipe for target 'aclocal.m4' failed make: *** [aclocal.m4] Error 127 Failed to build configure.sh and/or config.h.in -- giving up.

Looks like my knowledge is too limited to build for 18.XX.XX period. Which is frustrating as I have been testing and it's always the same. (v3.1.2) rsync -vvv --progress --stats --update --delete-after --info=progress2 --debug=ALL either hangs for insanely long times (think days) and/or just completely stops giving me any output to judge things by. I'd expect with all those flags the thing should be flooding me with more info than I can fathom but it just outputs for a while...then goes silent with no error/warning.

As a note I'm not sending huge files where the hang might be checksums being calculated over a slow network or something. Network is all internal 1gb and we're talking mp3's, pictures, odt's, svg's. Where there are a few larger files when it syncs say my raw DAW files these hangs happen long before it gets there on small crap. Files that at most might be 20mb a pop. It rockets through a few hundred...then stops dead...or seems to. Sorry if this is off topic from compiled bins. However the need for current bins is because of problems like this and the inability to build. Catch 22...Catch 22!

As a secondary note there was a bug (it's been a while and I don't have the # or link) that looked like I was getting that should have been fixed in the newer binary hence why I've been fishing to build or find a newer compiled version. However I also found another note somewhere that seems to be why my "ultra verbose" settings were actually working against me. Some interim memory used can become overwhelmed with logs and I think that was triggering the deaths. Things would work fine until that memory or buffer filled, then it died/hung leaving me with no output as to why. I sure hope this is fixed in future versions because it's ironic that debug output to debug can kill the debug process. Never mind with my workstation having a meager 64gigs of RAM it's insane to think the application doesn't have enough "memory" to continue logging or outputting.

nPHYN1T3 avatar Aug 25 '20 03:08 nPHYN1T3

I know this is an old issue, but I just posted an issue where we tracked the same thing down to the third v. If we just have one or two v it works fine.

dr-who avatar Sep 28 '21 00:09 dr-who

You can use the nix package manager with its nixpkgs package repository to get static rsync executables.

I've done this here for 64-bit Linux: rsync-v3.2.3-static download

Nixpkgs makes it easy to override declared packages programmatically, which enables switching from the default linkage (dynamic, glibc) to other modes (static, musl libc). In nixpkgs, pkgsStatic is a sub package tree that does this for lots of software.

Some examples:

  • nix-shell -p pkgsStatic.rsync - drops you into a shell where a statically linked rsync is available.
    Click to expand rsync version info ``` $ rsync --version rsync version 3.2.3 protocol version 31 Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others. Web site: https://rsync.samba.org/ Capabilities: 64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints, no socketpairs, hardlinks, no hardlink-specials, symlinks, no IPv6, atimes, batchfiles, inplace, append, ACLs, xattrs, optional protect-args, iconv, symtimes, prealloc, stop-at, no crtimes Optimizations: no SIMD, asm, openssl-crypto Checksum list: xxh128 xxh3 xxh64 (xxhash) md5 md4 none Compress list: zstd lz4 zlibx zlib none ```
  • nix-build --no-out-link '<nixpkgs>' -A pkgsStatic.rsync - Just builds a statically linked rsync, and prints is path to stdout. The binary is in the bin/rsync subdir.

The nix package for rsync is defined here (stable link). It has options at the top for easy overriding. You can use this to disable enableOpenSSL and enableXXHash to address licensing concerns as expressed in https://github.com/WayneD/rsync/issues/72#issuecomment-661576295. I've done that for my download above.

Example:

  • nix-build --no-out-link --expr 'with import <nixpkgs> {}; pkgsStatic.rsync.overrideAttrs (old: { configureFlags = (old.configureFlags or []) ++ [ "--disable-openssl" "--disable-xxhash" ]; })'
    Click to expand rsync version info ``` rsync version 3.2.3 protocol version 31 Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others. Web site: https://rsync.samba.org/ Capabilities: 64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints, no socketpairs, hardlinks, no hardlink-specials, symlinks, no IPv6, atimes, batchfiles, inplace, append, ACLs, xattrs, optional protect-args, iconv, symtimes, prealloc, stop-at, no crtimes Optimizations: no SIMD, asm, no openssl-crypto Checksum list: md5 md4 none Compress list: zstd lz4 zlibx zlib none ```
  • Soon you can also use this simpler expression: nix-build --no-out-link --expr 'with import <nixpkgs> {}; pkgsStatic.rsync.override (old: { enableOpenSSL = false; enableXXHash = false; })'

After you have built a static binary with nix, you can of course copy it off-system, and it will run standalone on all Linux distributions by nature of being a static binary.

nh2 avatar Dec 27 '21 16:12 nh2