-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Description:
Hi 👋
I’ve been following the installation instructions from the official Aalto Scientific Computing page:
👉 https://scicomp.aalto.fi/scicomp/rsynconwindows/
When running the provided installRsync script on Windows 11 (Git Bash), the installation fails during the package extraction phase with errors like:
zstd: /*stdin*: unsupported format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
or sometimes:
zstd: libzstd.tar.zst: unsupported format
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
Root cause
After debugging the script, I found two main issues:
- The script downloads outdated packages from
repo.msys2.orgwhich no longer exist — e.g.
libzstd-1.5.2-2-x86_64.pkg.tar.zstnow returns an HTML 404 page, not a valid.zstfile. - The command
tar -I zstd -xvfis not portable under Git Bash / MinGW on Windows — it doesn’t properly pass the-dflag tozstd, leading to the “unsupported format” errors.
Proposed fix
Below is a working version of the script, successfully tested on Windows 11 (Git Bash).
It uses up-to-date MSYS2 mirrors, a safer extraction method (zstd -d -c | tar -xv), and includes simple integrity checks.
#!/usr/bin/env bash
set -euo pipefail
BASE_URL="https://mirror.msys2.org/msys/x86_64"
PKG_RSYNC="rsync-3.4.1-1-x86_64.pkg.tar.zst"
PKG_ZSTD="libzstd-1.5.7-1-x86_64.pkg.tar.zst"
PKG_XXHASH="libxxhash-0.8.3-1-x86_64.pkg.tar.zst"
PKG_OPENSSL="libopenssl-3.6.0-1-x86_64.pkg.tar.zst"
ZSTD_ZIP_URL="https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-v1.5.0-win64.zip"
say() { printf "\n==> %s\n" "$*" >&2; }
die() { echo "ERROR: $*" >&2; exit 1; }
need_cmd() { command -v "$1" >/dev/null 2>&1 || die "Missing command: $1"; }
download() { curl -fL --retry 3 --retry-delay 1 -o "$2" "$1" || die "Failed to download: $1"; }
cd || die "Failed to enter home directory"
mkdir -p "$HOME/bin" "$HOME/lib"
rm -rf "$HOME/tempinstall"
mkdir -p "$HOME/tempinstall"
cd "$HOME/tempinstall"
say "Downloading zstd"
download "$ZSTD_ZIP_URL" "zstd.zip"
unzip -q zstd.zip
cp -r zstd-v1.5.0-win64/* "$HOME/bin/"
rm -rf zstd.zip zstd-v1.5.0-win64
ZSTD="$HOME/bin/zstd.exe"
[ -x "$ZSTD" ] || die "zstd.exe not found"
say "Downloading packages"
download "$BASE_URL/$PKG_RSYNC" "rsync.tar.zst"
download "$BASE_URL/$PKG_ZSTD" "libzstd.tar.zst"
download "$BASE_URL/$PKG_XXHASH" "libxxhash.tar.zst"
download "$BASE_URL/$PKG_OPENSSL" "libopenssl.tar.zst"
say "Extracting packages"
"$ZSTD" -d -c rsync.tar.zst | tar -xv
"$ZSTD" -d -c libzstd.tar.zst | tar -xv
"$ZSTD" -d -c libxxhash.tar.zst | tar -xv
"$ZSTD" -d -c libopenssl.tar.zst| tar -xv
say "Installing"
cp -r usr/bin/* "$HOME/bin/" || true
cp -r usr/lib/* "$HOME/lib/" || true
cd ..
rm -rf "$HOME/tempinstall"
say "Installation complete. Run 'rsync --version' in a new Git Bash window."Why this works
✅ Uses https://mirror.msys2.org instead of the outdated repo.msys2.org.
✅ Ensures .zst files are actually valid (not HTML).
✅ Uses zstd -d -c | tar -xv for reliable decompression in Git Bash.
✅ Installs locally in ~/bin and ~/lib, no admin rights needed.
✅ Tested successfully on Windows 11, Git Bash
Environment
- OS: Windows 11
- Shell: Git Bash
- Architecture: x86_64
- Tested in: clean user environment, no MSYS2 preinstalled
Summary
The script on the Aalto “Rsync on Windows” page currently breaks due to outdated packages and extraction issues under Git Bash.
The proposed fix above works reliably and could replace the current version in the documentation.
Would you consider updating the script on the page (or the referenced repository) accordingly?
It would make the setup process much smoother for Windows 11 users.
Thanks a lot for your work and documentation — it’s been really helpful! 🙌