Skip to content

Commit 0301451

Browse files
Merge branch 'master' into enhancements/issue-6656
2 parents e69fbe9 + 1e1c922 commit 0301451

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+800
-120
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ jobs:
6565
python-version: '3.11'
6666
toxenv: py311-fuse3
6767
- os: macos-12
68-
python-version: '3.9'
69-
toxenv: py39-none # note: no fuse testing, due to #6099, see also #6196.
68+
python-version: '3.11'
69+
toxenv: py311-none # note: no fuse testing, due to #6099, see also #6196.
7070

7171
env:
7272
# Configure pkg-config to use OpenSSL from Homebrew
7373
PKG_CONFIG_PATH: "/usr/local/opt/[email protected]/lib/pkgconfig:$PKG_CONFIG_PATH"
7474
TOXENV: ${{ matrix.toxenv }}
7575

7676
runs-on: ${{ matrix.os }}
77-
timeout-minutes: 40
77+
timeout-minutes: 60
7878

7979
steps:
8080
- uses: actions/checkout@v3

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev
5353
# Initializes the CodeQL tools for scanning.
5454
- name: Initialize CodeQL
55-
uses: github/codeql-action/init@v1
55+
uses: github/codeql-action/init@v2
5656
with:
5757
languages: ${{ matrix.language }}
5858
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -66,4 +66,4 @@ jobs:
6666
pip3 install -r requirements.d/development.txt
6767
pip3 install -e .
6868
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@v1
69+
uses: github/codeql-action/analyze@v2

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 23.1.0
4+
hooks:
5+
- id: black
6+
- repo: https://github.com/pycqa/flake8
7+
rev: 6.0.0
8+
hooks:
9+
- id: flake8
10+
files: '(src|scripts|conftest.py)'

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) 2015-2022 The Borg Collective (see AUTHORS file)
1+
Copyright (C) 2015-2023 The Borg Collective (see AUTHORS file)
22
Copyright (C) 2010-2014 Jonas Borgström <[email protected]>
33
All rights reserved.
44

Vagrantfile

Lines changed: 107 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def packages_debianoid(user)
1515
apt-get -y -qq update
1616
apt-get -y -qq dist-upgrade
1717
# for building borgbackup and dependencies:
18-
apt install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev pkg-config
18+
apt install -y pkg-config
19+
apt install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev || true
1920
apt install -y libfuse-dev fuse || true
2021
apt install -y libfuse3-dev fuse3 || true
2122
apt install -y locales || true
@@ -136,9 +137,95 @@ def packages_openindiana
136137
EOF
137138
end
138139

140+
141+
# Build and install borg dependencies from source
142+
def install_source_dependencies(user)
143+
return <<-EOF
144+
set -e -o pipefail
145+
146+
# Install in /usr/local
147+
export PREFIX=/usr/local
148+
149+
# Make PKG_CONFIG_PATH explicit, even if /usr/local/lib/pkgconfig is enabled per default
150+
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
151+
echo 'export PKG_CONFIG_PATH="'${PKG_CONFIG_PATH}'"' >> ~#{user}/.bash_profile
152+
153+
# All source packages integrate with pkg-config, remove any previous overrides
154+
sed -i '/BORG_.*_PREFIX/d' ~#{user}/.bash_profile
155+
156+
# Setup pyenv to pick up the custom openssl version (python >= 3.9 requires openssl >= 1.1.1)
157+
echo 'export PYTHON_CONFIGURE_OPTS="--with-openssl='"${PREFIX}"' --with-openssl-rpath=auto"' >> ~#{user}/.bash_profile
158+
echo 'export LDFLAGS=-Wl,-rpath,'"${PREFIX}"'/lib' >> ~#{user}/.bash_profile
159+
160+
# Silence git warning about shallow clones
161+
git config --global advice.detachedHead false
162+
163+
# libattr
164+
VERSION_LIBATTR=2.5.1
165+
curl -s -L https://download.savannah.nongnu.org/releases/attr/attr-${VERSION_LIBATTR}.tar.gz | tar xvz --strip-components=1 --one-top-level=attr -f - -C ${PREFIX}/src
166+
cd ${PREFIX}/src/attr
167+
./configure --prefix=${PREFIX}
168+
make -j$(nproc) install
169+
170+
# libacl
171+
VERSION_LIBACL=2.3.1
172+
curl -s -L https://download.savannah.nongnu.org/releases/acl/acl-${VERSION_LIBACL}.tar.gz | tar xvz --strip-components=1 --one-top-level=acl -f - -C ${PREFIX}/src
173+
cd ${PREFIX}/src/acl
174+
./configure --prefix=${PREFIX}
175+
make -j$(nproc) install
176+
177+
# liblz4
178+
VERSION_LIBLZ4=1.9.4
179+
git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_LIBLZ4} https://github.com/lz4/lz4.git
180+
cd ${PREFIX}/src/lz4
181+
make -j$(nproc) install PREFIX=${PREFIX}
182+
183+
# libzstd
184+
VERSION_LIBZSTD=1.5.4
185+
git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_LIBZSTD} https://github.com/facebook/zstd.git
186+
cd ${PREFIX}/src/zstd
187+
make -j$(nproc) install PREFIX=${PREFIX}
188+
189+
# xxHash
190+
VERSION_LIBXXHASH=0.8.1
191+
git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_LIBXXHASH} https://github.com/Cyan4973/xxHash.git
192+
cd ${PREFIX}/src/xxHash
193+
make -j$(nproc) install PREFIX=${PREFIX}
194+
195+
# openssl
196+
VERSION_OPENSSL=1_1_1t
197+
git -C ${PREFIX}/src clone --depth 1 --branch OpenSSL_${VERSION_OPENSSL} https://github.com/openssl/openssl.git
198+
cd ${PREFIX}/src/openssl
199+
./config --prefix=${PREFIX} --openssldir=${PREFIX}/lib/ssl
200+
make -j$(nproc)
201+
make -j$(nproc) install
202+
203+
# libfuse3 requires ninja
204+
VERSION_NINJA=1.11.1
205+
git -C ${PREFIX}/src clone --depth 1 --branch v${VERSION_NINJA} https://github.com/ninja-build/ninja.git
206+
cd ${PREFIX}/src/ninja
207+
python3 configure.py --bootstrap
208+
install --mode=755 --target-directory=${PREFIX}/bin ninja
209+
210+
# libfuse3 requires meson >= 0.50; python3.5 support is dropped in meson >= 0.57
211+
VERSION_MESON=0.56.2
212+
git -C ${PREFIX}/src clone --depth 1 --branch ${VERSION_MESON} https://github.com/mesonbuild/meson.git
213+
ln -s ${PREFIX}/src/meson/meson.py ${PREFIX}/bin/meson
214+
215+
# libfuse3
216+
VERSION_LIBFUSE=3.14.0
217+
git -C ${PREFIX}/src clone --depth 1 --branch fuse-${VERSION_LIBFUSE} https://github.com/libfuse/libfuse.git
218+
cd ${PREFIX}/src/libfuse
219+
mkdir build; cd build
220+
meson setup --prefix ${PREFIX} --libdir ${PREFIX}/lib ..
221+
ninja
222+
ninja install
223+
EOF
224+
end
225+
139226
def install_pyenv(boxname)
140227
return <<-EOF
141-
echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
228+
echo 'export PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS} --enable-shared"' >> ~/.bash_profile
142229
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
143230
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
144231
. ~/.bash_profile
@@ -160,6 +247,7 @@ end
160247
def install_pythons(boxname)
161248
return <<-EOF
162249
. ~/.bash_profile
250+
echo "PYTHON_CONFIGURE_OPTS: ${PYTHON_CONFIGURE_OPTS}"
163251
pyenv install 3.11.2 # tests, binary build
164252
pyenv install 3.10.1 # tests
165253
pyenv install 3.9.1 # tests
@@ -330,6 +418,23 @@ Vagrant.configure(2) do |config|
330418
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("buster64", ".*none.*")
331419
end
332420

421+
config.vm.define "stretch64" do |b|
422+
b.vm.box = "debian/stretch64"
423+
b.vm.provider :virtualbox do |v|
424+
v.memory = 1024 + $wmem
425+
end
426+
b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
427+
b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
428+
b.vm.provision "install source dependencies", :type => :shell, :privileged => true, :inline => install_source_dependencies("vagrant")
429+
b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("stretch64")
430+
b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("stretch64")
431+
b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("stretch64")
432+
b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg("llfuse")
433+
b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
434+
b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("stretch64")
435+
b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("stretch64", ".*none.*")
436+
end
437+
333438
config.vm.define "freebsd64" do |b|
334439
b.vm.box = "generic/freebsd13"
335440
b.vm.provider :virtualbox do |v|

docs/changes.rst

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ This section provides information about security and corruption issues.
1212
Change Log 2.x
1313
==============
1414

15-
Version 2.0.0b5 (2023-02-27)
16-
----------------------------
15+
Version 2.0.0b6 (not released yet)
16+
----------------------------------
1717

1818
Please note:
1919

@@ -108,7 +108,59 @@ Compatibility notes:
108108

109109
Option --filter=... might need an update, if you filter for the status chars
110110
that were changed.
111+
- borg is now more strict and disallows giving some options multiple times -
112+
if that makes no sense. Highlander options, see #6269. That might make scripts
113+
fail now that somehow "worked" before (but maybe didn't work as intended due to
114+
the contradicting options).
115+
116+
New features:
117+
118+
- diff: include changes in ctime and mtime, #7248
119+
- diff: sort JSON output alphabetically
120+
- diff --content-only: option added to ignore metadata changes
121+
- import-tar --ignore-zeros: new option to support importing concatenated tars, #7432
122+
- debug id-hash / parse-obj / format-obj: new debug commands, #7406
111123

124+
Fixes:
125+
126+
- do not retry on permission errors (pointless)
127+
- transfer: verify chunks we get using assert_id, #7383
128+
- fix config/cache dir compatibility issues, #7445
129+
- xattrs: fix namespace processing on FreeBSD, #6997
130+
- ProgressIndicatorPercent: fix space computation for wide chars, #3027
131+
- delete: remove --cache-only option, #7440.
132+
for deleting the cache only, use: borg rdelete --cache-only
133+
- borg debug get-obj/put-obj: fixed chunk id
134+
135+
Other changes:
136+
137+
- allow msgpack 1.0.5 also
138+
- clarify platformdirs requirements, #7393.
139+
3.0.0 is only required for macOS due to breaking changes.
140+
2.6.0 was the last breaking change for Linux/UNIX.
141+
- mount: improve mountpoint error msgs, see #7496
142+
- more Highlander options, #6269
143+
- Windows: simplify building (just use pip)
144+
- docs:
145+
146+
- add installation instructions for Windows
147+
- improve --one-file-system help and docs (macOS APFS), #5618 #4876
148+
- BORG_KEY_FILE: clarify docs, #7444
149+
- installation: add link to OS dependencies, #7356
150+
- update FAQ about locale/unicode issues, #6999
151+
- improve mount options rendering, #7359
152+
- make timestamps in manual pages reproducible.
153+
- CI / tests / vagrant:
154+
155+
- added pre-commit for linting purposes, #7476
156+
- resolved mode bug and added sleep clause for darwin systems, #7470
157+
- "auto" compressor tests: do not assume zlib is better than lz4, #7363
158+
- add stretch64 VM with deps built from source
159+
- misc. other CI / test fixes and updates
160+
161+
162+
Version 2.0.0b5 (2023-02-27)
163+
----------------------------
112164

113165
New features:
114166

docs/development.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@ virtual env and run::
179179
pip install -r requirements.d/development.txt
180180

181181

182+
This project utilizes pre-commit to format and lint code before it is committed.
183+
Although pre-commit is installed when running the command above, the pre-commit hooks
184+
will have to be installed separately. Run this command to install the pre-commit hooks::
185+
186+
pre-commit install
187+
188+
182189
Running the tests
183190
-----------------
184191

docs/usage/general/environment.rst.inc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ General:
104104
caused EROFS. You will need this to make archives from volume shadow copies
105105
in WSL1 (Windows Subsystem for Linux 1).
106106

107+
Output formatting:
108+
BORG_LIST_FORMAT
109+
Giving the default value for ``borg list --format=X``.
110+
BORG_RLIST_FORMAT
111+
Giving the default value for ``borg rlist --format=X``.
112+
BORG_PRUNE_FORMAT
113+
Giving the default value for ``borg prune --format=X``.
114+
107115
Some automatic "answerers" (if set, they automatically answer confirmation questions):
108116
BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=no (or =yes)
109117
For "Warning: Attempting to access a previously unknown unencrypted repository"
@@ -145,7 +153,16 @@ Directories and files:
145153
Defaults to ``$BORG_CONFIG_DIR/keys``.
146154
This directory contains keys for encrypted repositories.
147155
BORG_KEY_FILE
148-
When set, use the given filename as repository key file.
156+
When set, use the given path as repository key file. Please note that this is only
157+
for rather special applications that externally fully manage the key files:
158+
159+
- this setting only applies to the keyfile modes (not to the repokey modes).
160+
- using a full, absolute path to the key file is recommended.
161+
- all directories in the given path must exist.
162+
- this setting forces borg to use the key file at the given location.
163+
- the key file must either exist (for most commands) or will be created (``borg rcreate``).
164+
- you need to give a different path for different repositories.
165+
- you need to point to the correct key file matching the repository the command will operate on.
149166
TMPDIR
150167
This is where temporary files are stored (might need a lot of temporary space for some
151168
operations), see tempfile_ for details.

requirements.d/development.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ pytest-cov
1010
pytest-benchmark
1111
Cython
1212
twine
13+
pre-commit

src/borg/archive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ def make_parent(path):
885885
item_size = item.size
886886
if item_size != item_chunks_size:
887887
raise BackupError(
888-
"Size inconsistency detected: size {}, chunks size {}".format(item_size, item_chunks_size)
888+
f"Size inconsistency detected: size {item_size}, chunks size {item_chunks_size}"
889889
)
890890
if has_damaged_chunks:
891891
raise BackupError("File has damaged (all-zero) chunks. Try running borg check --repair.")

0 commit comments

Comments
 (0)