Windows (MSYS2) support #778
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#778
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'd like to do and why
A few people are using borg with MSYS2 (or Cygwin) in Windows.
Currently, there are a few things that have to be modified on borgmatic to make it run (although I did not really tried everything yet, I just successfully ran
generate-borgmatic-config
and called it a day :-)):signal.SIGHUP
,signal.SIGUSR1
,signal.SIGUSR2
do not exist in Windows-Python. There are just no such attributes.jsonschema
must be<4.18
as they introduced somerust
dependencies which do not (yet?) work on MSYS2. (Also there are no wheels for the MSYS2 architecture, so the whole building toolchain would have to work.)Notes:
pacman -S --needed --noconfirm mingw-w64-ucrt-x86_64-{toolchain,python,python-pip}
SETUPTOOLS_USE_DISTUTILS=stdlib pip install .
due to some setuptools bug on MSYS2. (see https://www.msys2.org/docs/python/)I'd absolutely understand if making borgmatic working on MSYS2 has low to no priority and this issue gets closed.
Other notes / implementation ideas
No response
Thank you for taking the time to file this and provide details on some of the outstanding issues on Windows! Here's my take on this: I don't have a Windows machine, and I personally don't really have an interest in getting one... However, if someone wants to submit a PR or two that adds Windows/MSYS2 support to borgmatic, and it doesn't break support of existing platforms, I'd be happy to take a look (and merge it if it works out).
This is actually how the systemd support in borgmatic started. I knew next to nothing about systemd at the time, but other folks submitted PRs until the sample system service was at a decent enough state. The difference here is that without a Windows machine, I probably wouldn't be able to test that Windows stuff continues working. But then again, I don't have a FreeBSD box either, and borgmatic "supports" FreeBSD in that I know some folks run borgmatic on it!
Some thoughts on the particular issues you brought up:
Are there equivalents? The whole point of the signal code in borgmatic is just to pass signals on from borgmatic to Borg.
borgmatic doesn't have an official dependency on a particular version of jsonschema, so this should hopefully be fine.
You might also/instead try installing borgmatic with pipx, which is among the officially supported means of installation. (Plain pip also works, but has issues on some platforms, which is what caused me to move to pipx.)
Anyway, let me know your thoughts!
Update:
jsonschema
If you just want to use MSYS2 with their "base packages" (which is basically Cygwin), we just need to pin
jsonschema<4.18
. This is needed as they introduced some Rust dependency stuff which does not work yet on MSYS2.It does not look like jsonschema maintainers want to remove this dependency again or to add a native Python fallback: https://github.com/python-jsonschema/jsonschema/issues?q=rust
signals
Handling those signals differently is not required by MSYS2 with "base packages" (i.e. the
msys2
environment): Thispython
works as it would on a Linux and therefore knows those signals.If the
ucrt64
environment (or probably others which produce native Windows binaries) is used, thepython
does not know about those signals. Special treatment would be required (probably also if one wants to useborgmatic
on a default (native) Windows Python distribution). But asborg
is pretty much useless on (native) Windows right now (does not work with ssh repositories, only local ones), this does not make too much sense for now.