Add a minimal stand-alone borgmatic binary in addition to the standard one (#1314).

This commit is contained in:
Dan Helfman
2026-06-01 15:51:01 -07:00
parent 4ee057a909
commit 7cd9e6b361
6 changed files with 20 additions and 21 deletions
+2
View File
@@ -10,6 +10,8 @@
* #1303: For the MariaDB hook, include only a subset of system data when dumping the "mysql" system * #1303: For the MariaDB hook, include only a subset of system data when dumping the "mysql" system
database (or "all" databases), so the dump is actually restorable. See the documentation for more database (or "all" databases), so the dump is actually restorable. See the documentation for more
information: https://torsion.org/borgmatic/reference/configuration/data-sources/mariadb/ information: https://torsion.org/borgmatic/reference/configuration/data-sources/mariadb/
* #1314: Add a minimal stand-alone borgmatic binary in addition to the standard one. The minimal
binary omits support for the Apprise monitoring hook.
* Add an experimental "browse" action providing a console UI for browsing your backups. See the * Add an experimental "browse" action providing a console UI for browsing your backups. See the
documentation for more information: documentation for more information:
https://torsion.org/borgmatic/how-to/inspect-your-backups/#browsing-backups https://torsion.org/borgmatic/how-to/inspect-your-backups/#browsing-backups
-3
View File
@@ -1,7 +1,6 @@
. .
apprise apprise
attrs attrs
binaryornot
certifi certifi
charset-normalizer charset-normalizer
click click
@@ -15,8 +14,6 @@ pyyaml
referencing referencing
requests requests
requests-oauthlib requests-oauthlib
rich
rpds-py rpds-py
ruamel-yaml ruamel-yaml
textual
urllib3 urllib3
-11
View File
@@ -2,7 +2,6 @@
# uv pip compile --annotation-style line binary_requirements.in -o binary_requirements.txt # uv pip compile --annotation-style line binary_requirements.in -o binary_requirements.txt
apprise==1.10.0 # via -r binary_requirements.in apprise==1.10.0 # via -r binary_requirements.in
attrs==26.1.0 # via jsonschema, referencing, -r binary_requirements.in attrs==26.1.0 # via jsonschema, referencing, -r binary_requirements.in
binaryornot==0.6.0 # via -r binary_requirements.in
. # via -r binary_requirements.in . # via -r binary_requirements.in
certifi==2026.5.20 # via apprise, requests, -r binary_requirements.in certifi==2026.5.20 # via apprise, requests, -r binary_requirements.in
charset-normalizer==3.4.7 # via requests, -r binary_requirements.in charset-normalizer==3.4.7 # via requests, -r binary_requirements.in
@@ -10,23 +9,13 @@ click==8.4.1 # via apprise, -r binary_requirements.in
idna==3.16 # via requests, -r binary_requirements.in idna==3.16 # via requests, -r binary_requirements.in
jsonschema==4.26.0 # via borgmatic, -r binary_requirements.in jsonschema==4.26.0 # via borgmatic, -r binary_requirements.in
jsonschema-specifications==2025.9.1 # via jsonschema, -r binary_requirements.in jsonschema-specifications==2025.9.1 # via jsonschema, -r binary_requirements.in
linkify-it-py==2.1.0 # via markdown-it-py
markdown==3.10.2 # via apprise, -r binary_requirements.in markdown==3.10.2 # via apprise, -r binary_requirements.in
markdown-it-py==4.2.0 # via mdit-py-plugins, rich, textual
mdit-py-plugins==0.6.1 # via textual
mdurl==0.1.2 # via markdown-it-py
oauthlib==3.3.1 # via requests-oauthlib, -r binary_requirements.in oauthlib==3.3.1 # via requests-oauthlib, -r binary_requirements.in
packaging==26.2 # via borgmatic, -r binary_requirements.in packaging==26.2 # via borgmatic, -r binary_requirements.in
platformdirs==4.9.6 # via textual
pygments==2.20.0 # via rich, textual
pyyaml==6.0.3 # via apprise, -r binary_requirements.in pyyaml==6.0.3 # via apprise, -r binary_requirements.in
referencing==0.37.0 # via jsonschema, jsonschema-specifications, -r binary_requirements.in referencing==0.37.0 # via jsonschema, jsonschema-specifications, -r binary_requirements.in
requests==2.34.2 # via apprise, borgmatic, requests-oauthlib, -r binary_requirements.in requests==2.34.2 # via apprise, borgmatic, requests-oauthlib, -r binary_requirements.in
requests-oauthlib==2.0.0 # via apprise, -r binary_requirements.in requests-oauthlib==2.0.0 # via apprise, -r binary_requirements.in
rich==15.0.0 # via textual, -r binary_requirements.in
rpds-py==0.30.0 # via jsonschema, referencing, -r binary_requirements.in rpds-py==0.30.0 # via jsonschema, referencing, -r binary_requirements.in
ruamel-yaml==0.19.1 # via borgmatic, -r binary_requirements.in ruamel-yaml==0.19.1 # via borgmatic, -r binary_requirements.in
textual==8.2.7 # via -r binary_requirements.in
typing-extensions==4.15.0 # via textual
uc-micro-py==2.0.0 # via linkify-it-py
urllib3==2.7.0 # via requests, -r binary_requirements.in urllib3==2.7.0 # via requests, -r binary_requirements.in
+4 -2
View File
@@ -152,8 +152,10 @@ contents of your backups when you're feeling too lazy to type out a full
borgmatic command-line. borgmatic command-line.
Depending on how you installed borgmatic, it may not have come with the Depending on how you installed borgmatic, it may not have come with the
necessary Python libraries to support the browse action. For instance, if you necessary Python libraries to support the browse action. (borgmatic's
originally [installed borgmatic with [stand-alone
binary](https://projects.torsion.org/borgmatic-collective/borgmatic/releases)
does not currently include them.) If you originally [installed borgmatic with
uv](https://torsion.org/borgmatic/how-to/install-borgmatic/), run the following uv](https://torsion.org/borgmatic/how-to/install-borgmatic/), run the following
to install the libraries needed for the browse action: to install the libraries needed for the browse action:
+1 -1
View File
@@ -98,7 +98,7 @@ installing borgmatic:
#### Etc. #### Etc.
* [stand-alone Linux binary](https://projects.torsion.org/borgmatic-collective/borgmatic/releases) (This is a beta feature!) * [stand-alone Linux binary](https://projects.torsion.org/borgmatic-collective/borgmatic/releases) (This is a beta feature! The minimal binary omits [Apprise support](https://torsion.org/borgmatic/reference/configuration/monitoring/apprise/).)
* [Ansible role](https://github.com/borgbase/ansible-role-borgbackup) * [Ansible role](https://github.com/borgbase/ansible-role-borgbackup)
* [pipx](https://pipx.pypa.io/stable/) * [pipx](https://pipx.pypa.io/stable/)
+13 -4
View File
@@ -43,15 +43,19 @@ twine upload -r pypi --username __token__ "$wheel_path"
scripts/export-docs-from-image scripts/export-docs-from-image
docs_path=dist/borgmatic-docs.tar.gz docs_path=dist/borgmatic-docs.tar.gz
# Build stand-alone binary. # Build stand-alone binaries.
uv venv --python 3.13 --clear binary uv venv --python 3.13 --clear binary
source binary/bin/activate source binary/bin/activate
uv pip install -r binary_requirements.txt nuitka[onefile] uv pip install -r binary_requirements.txt nuitka[onefile]
nuitka --mode=onefile --enable-plugin=upx --include-package-data=borgmatic --include-data-dir=borgmatic.egg-info=borgmatic.egg-info --include-package=borgmatic.hooks --include-package=apprise --include-package=textual --no-deployment-flag=self-execution borgmatic/commands/borgmatic.py nuitka --mode=onefile --enable-plugin=upx --include-package-data=borgmatic --include-data-dir=borgmatic.egg-info=borgmatic.egg-info --include-package=borgmatic.hooks --include-package=apprise --no-deployment-flag=self-execution borgmatic/commands/borgmatic.py
deactivate rm -fr borgmatic.build borgmatic.dist
rm -fr binary borgmatic.build borgmatic.dist
standalone_binary_path="dist/borgmatic-${version}-binary-linux-glibc-x86_64" standalone_binary_path="dist/borgmatic-${version}-binary-linux-glibc-x86_64"
mv borgmatic.bin "$standalone_binary_path" mv borgmatic.bin "$standalone_binary_path"
nuitka --mode=onefile --enable-plugin=upx --include-package-data=borgmatic --include-data-dir=borgmatic.egg-info=borgmatic.egg-info --include-package=borgmatic.hooks --no-deployment-flag=self-execution borgmatic/commands/borgmatic.py
rm -fr binary borgmatic.build borgmatic.dist
deactivate
standalone_minimal_binary_path="dist/borgmatic-${version}-minimal-binary-linux-glibc-x86_64"
mv borgmatic.bin "$standalone_minimal_binary_path"
# Set release changelogs on projects.torsion.org and GitHub. # Set release changelogs on projects.torsion.org and GitHub.
release_changelog="$(cat NEWS | sed '/^$/q' | grep -v '^\S')" release_changelog="$(cat NEWS | sed '/^$/q' | grep -v '^\S')"
@@ -83,6 +87,11 @@ curl --silent --request POST \
--header "Authorization: token $projects_token" \ --header "Authorization: token $projects_token" \
--header "Accept: application/json" \ --header "Accept: application/json" \
--form attachment=@"$standalone_binary_path" --form attachment=@"$standalone_binary_path"
curl --silent --request POST \
"https://projects.torsion.org/api/v1/repos/borgmatic-collective/borgmatic/releases/$release_id/assets?name=$(basename $standalone_minimal_binary_path)" \
--header "Authorization: token $projects_token" \
--header "Accept: application/json" \
--form attachment=@"$standalone_minimal_binary_path"
github-release create --token="$github_token" --owner=witten --repo=borgmatic --tag="$version" --target_commit="main" \ github-release create --token="$github_token" --owner=witten --repo=borgmatic --tag="$version" --target_commit="main" \
--name="borgmatic $version" --body="$release_changelog" --name="borgmatic $version" --body="$release_changelog"