Skip to content

v0.2.0 — Cross-platform metadata parity

Choose a tag to compare

@flawme flawme released this 31 Aug 19:03
· 15 commits to master since this release

Varn now captures and restores the same classes of filesystem state on Linux, macOS, and Windows. No more second-class Windows support.

What's new

  • Full Unix permission mode — rwx bits plus setuid/setgid/sticky are captured on Linux/macOS and fully restored. Previously only the readonly bit was restored; a 755 script restored as 644. Older snapshots without a captured mode fall back to the old readonly behavior.
  • Windows file attributes — READONLY, HIDDEN, SYSTEM, ARCHIVE are captured and restored via SetFileAttributesW.
  • macOS BSD file flagsuchg (user immutable), hidden, and friends are captured via st_flags and restored via lchflags. Privileged flags are skipped with a warning rather than failing the restore (borg's best-effort practice).
  • Windows hard links — detected via GetFileInformationByHandle (NTFS link counts) and restored as real hard links. Previously Windows restored hard-linked files as independent copies, silently breaking the link relationship.
  • Windows security descriptors — owner, group, and DACL are captured in SDDL form and restored via SetNamedSecurityInfoW, best-effort with warnings (the restic/rsync approach).
  • Directory metadata restored correctly — creating/deleting children updates a directory's own mtime, so restore now applies directory metadata in a post-order pass (deepest first) after all child operations. Previously a restored directory mtime could be silently clobbered and verification would fail.
  • Metadata drift detection — restore plans metadata-only updates when mode/flags/attributes/ACL differ but content is unchanged.
  • Honest verification — post-restore verification checks the new metadata fields, so a failed mode or mtime restore is reported instead of silently passing.

Upgrade notes

No storage-format migration needed: the new fields are optional with serde defaults, so snapshots written by 0.1.x load unchanged. New checkpoints simply capture more.

New target-gated dependencies, pinned to exact versions (windows-sys =0.59.0, libc =0.2.189) so a fresh cargo update cannot silently pull an API-incompatible 0.x minor. Linux builds gain no new dependencies.

Verification

  • 306 tests passing (cargo test), including deterministic directory-mtime regression tests and snapshot backward-compatibility tests
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • cargo fmt --check clean
  • CI green on ubuntu, macos, and windows (all platform code paths compile and test)
  • Live smoke tests: 755 mode drift restored to 755; directory mtime restored to a fixed 2001 timestamp after child create/delete

Full changelog: https://github.com/flawme/varn/blob/master/CHANGELOG.md