From 7cd9e6b3613a6e344d0fa7738149dd622248687f Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Mon, 1 Jun 2026 15:51:01 -0700 Subject: [PATCH] Add a minimal stand-alone borgmatic binary in addition to the standard one (#1314). --- NEWS | 2 ++ binary_requirements.in | 3 --- binary_requirements.txt | 11 ----------- docs/how-to/inspect-your-backups.md | 6 ++++-- docs/how-to/install-borgmatic.md | 2 +- scripts/release | 17 +++++++++++++---- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/NEWS b/NEWS index bbcec3ad..eed648ac 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,8 @@ * #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 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 documentation for more information: https://torsion.org/borgmatic/how-to/inspect-your-backups/#browsing-backups diff --git a/binary_requirements.in b/binary_requirements.in index af6f4163..985a50f8 100644 --- a/binary_requirements.in +++ b/binary_requirements.in @@ -1,7 +1,6 @@ . apprise attrs -binaryornot certifi charset-normalizer click @@ -15,8 +14,6 @@ pyyaml referencing requests requests-oauthlib -rich rpds-py ruamel-yaml -textual urllib3 diff --git a/binary_requirements.txt b/binary_requirements.txt index e6567ccc..78c1bfe0 100644 --- a/binary_requirements.txt +++ b/binary_requirements.txt @@ -2,7 +2,6 @@ # uv pip compile --annotation-style line binary_requirements.in -o binary_requirements.txt apprise==1.10.0 # via -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 certifi==2026.5.20 # via apprise, 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 jsonschema==4.26.0 # via borgmatic, -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-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 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 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-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 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 diff --git a/docs/how-to/inspect-your-backups.md b/docs/how-to/inspect-your-backups.md index 797d965f..ef5f94db 100644 --- a/docs/how-to/inspect-your-backups.md +++ b/docs/how-to/inspect-your-backups.md @@ -152,8 +152,10 @@ contents of your backups when you're feeling too lazy to type out a full borgmatic command-line. 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 -originally [installed borgmatic with +necessary Python libraries to support the browse action. (borgmatic's +[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 to install the libraries needed for the browse action: diff --git a/docs/how-to/install-borgmatic.md b/docs/how-to/install-borgmatic.md index 49881ed2..f92455f3 100644 --- a/docs/how-to/install-borgmatic.md +++ b/docs/how-to/install-borgmatic.md @@ -98,7 +98,7 @@ installing borgmatic: #### 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) * [pipx](https://pipx.pypa.io/stable/) diff --git a/scripts/release b/scripts/release index 670ccdf0..21ff023f 100755 --- a/scripts/release +++ b/scripts/release @@ -43,15 +43,19 @@ twine upload -r pypi --username __token__ "$wheel_path" scripts/export-docs-from-image docs_path=dist/borgmatic-docs.tar.gz -# Build stand-alone binary. +# Build stand-alone binaries. uv venv --python 3.13 --clear binary source binary/bin/activate 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 -deactivate -rm -fr binary borgmatic.build borgmatic.dist +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 +rm -fr borgmatic.build borgmatic.dist standalone_binary_path="dist/borgmatic-${version}-binary-linux-glibc-x86_64" 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. release_changelog="$(cat NEWS | sed '/^$/q' | grep -v '^\S')" @@ -83,6 +87,11 @@ curl --silent --request POST \ --header "Authorization: token $projects_token" \ --header "Accept: application/json" \ --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" \ --name="borgmatic $version" --body="$release_changelog"