316 Commits

Author SHA1 Message Date
Thomas Waldmann b35a76dd3c adapt for OpenBSD 7.8 (CI and setup.py) 2026-03-13 00:39:13 +01:00
Suryansh Pal ba6706395a use xxhash from PyPI, fixes #6535 2026-03-08 13:06:01 +01:00
defnvary 4344eb37d1 use zstd from python stdlib or backport.zstd, closes #9261 2026-02-23 00:33:21 +05:30
Thomas Waldmann 0286fb6dc4 NetBSD: copy xattr implementation of FreeBSD, fixes #1332 2025-11-21 12:42:05 +01:00
Thomas Waldmann 3120f9cd1c fixed typos and grammar (AI)
this was done by Junie AI.
2025-09-23 14:56:23 +02:00
Thomas Waldmann c9cc5c4c19 setup.py: cosmetic updates for chunkers
- remove outdated comment
- remove undef'ing of NDEBUG for chunks
2025-06-18 15:34:20 +02:00
Thomas Waldmann 63ff136dfe buzhash64: integrate into build 2025-06-10 22:44:48 +02:00
Thomas Waldmann f44b1742f5 Extract ChunkerFixed into a dedicated module under chunkers.
Moved the `ChunkerFixed` implementation from `chunker` to a new `fixed` module for better modularity. Updated imports and type hints.

Removed now empty chunkers.chunker module.
2025-06-04 23:48:50 +02:00
Thomas Waldmann 31494f200d Extract buzhash logic into a dedicated module under chunkers
Moved `buzhash` implementation from `chunker` to a new `buzhash` module for better separation of concerns. Updated imports, adjusted `setup.py` and build configuration accordingly. Removed deprecated `Chunker` definitions from `chunker.pyi`.
2025-06-04 22:57:03 +02:00
Thomas Waldmann a78c310b72 Split reader functionality into a separate module under chunkers package
Extracted the `reader` logic from `chunker` into a dedicated `reader` module to improve modularity and maintainability. Updated imports, references, and build configurations accordingly.
2025-06-04 22:40:39 +02:00
Thomas Waldmann bc86bd4bb0 Move chunker module to chunkers package
Refactor by relocating the `chunker` module under a new `chunkers` package, adjusting imports and file references accordingly.
2025-06-04 22:12:45 +02:00
Thomas Waldmann 16b7dd8cee suppress compiler warning about CYTHON_FALLTHROUGH
The `-Wno-unreachable-code-fallthrough` compiler flag suppresses warnings about fallthrough annotations in unreachable code.

In C switch statements, "fallthrough" occurs when execution continues from one case to the next without a break statement. This is often a source of bugs, so modern compilers warn about it. To indicate intentional fallthrough, developers use annotations like `__attribute__((fallthrough))`.

In Cython-generated C code, the `CYTHON_FALLTHROUGH` macro is defined to expand to the appropriate fallthrough annotation for the compiler being used. For example, in `compress.c`:

```c
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
```

The issue occurs because Cython generates code with conditional branches that may be unreachable on certain platforms or configurations. When these branches contain switch statements with fallthrough annotations, compilers like Clang issue warnings like:

```
warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
```

These warnings appear in the generated C code, not in the original Cython source. They're harmless but noisy, cluttering the build output with warnings about code we don't control.

By adding `-Wno-unreachable-code-fallthrough` to the compiler flags in `setup.py`, we specifically tell the compiler to ignore these particular warnings, resulting in a cleaner build output without affecting the actual functionality of the code.

This is a common practice when working with generated code - suppress specific warnings that are unavoidable due to the code generation process while keeping other useful warnings enabled.
2025-05-21 23:22:24 +02:00
Björn Ketelaars cf6a324afa borg2 - Support other OpenSSL versions on OpenBSD
`setup.py` hardcoded crypto library paths for OpenBSD, causing build
issue when OpenBSD drops specific OpenSSL version. Solution is to make
paths configurable.

Addresses #8553.
2024-11-23 23:01:44 +01:00
Thomas Waldmann 03596e3651 remove unused _hashindex.c, update setup.py
also the hash_sizes.py script, which was used for _hashindex.c.
2024-10-25 19:03:38 +02:00
Thomas Waldmann ce2a824ec9 cosmetic: blacken setup.py 2024-05-12 16:13:31 +02:00
Thomas Waldmann 8a73344352 setup.py: detect noexec build fs issue, see #8208
That "failed to map segment from shared object" error msg is not
very helpful. Add a hint that the filesystem needs to be +exec
(== not noexec mounted, like it might be the case for /tmp on
some systems).
2024-05-12 16:13:28 +02:00
Thomas Waldmann b067f0fba2 setup.py: fix import error reporting for cythonize import, see #8208
Looks like borg's setup.py has hidden the real cause of a cythonize ImportError.

There are basically 2 cases:
- either there is no Cython installed, then the import fails because the module can not be found, or
- there is some issue within Cython and the import fails due to that.

It's important not to hide the real cause, especially if we run into case 2.

case 1 is kind of expected and frequent, case 2 is rare.
2024-05-12 16:13:26 +02:00
Thomas Waldmann b04dcf4cbd libacl: work with older versions, too
this was recently set to a relatively high minimum version when
locating it via pkgconfig was added. this broke the binary builds
on buster and bullseye.

i don't think borg requires a specific libacl version as long as
the api is compatible, so i now set this to 2.2.47 (from 2008).
2024-02-20 21:40:43 +01:00
Thomas Waldmann 86c8031dc5 fix comment in setup.py 2024-02-20 17:04:16 +01:00
Thomas Waldmann 8eba627b29 scripts: make.py clean implementation 2024-02-09 17:37:46 +01:00
Thomas Waldmann 9d913b0e82 setup.py: remove build_usage and build_man as setup.py command 2024-02-09 02:50:19 +01:00
Thomas Waldmann 7d77985601 setup.py: move long_desc_from_readme definition to here 2024-02-09 02:38:47 +01:00
Thomas Waldmann 5ca4703a47 use and require cython3 2024-01-02 19:30:14 +01:00
Thomas Waldmann c7f0d779bf blacken master branch 2023-11-05 13:33:25 +01:00
Łukasz Stelmach c68a158ffb linux: use pkgconfig to find libacl
Using pkgconfig gives a more meaningful error message in case libacl
development files are missing.
2023-10-24 15:00:21 +02:00
Björn Ketelaars 83d4fca4d2 OpenBSD only: switch to OpenSSL-3.0 2023-09-11 21:43:35 +02:00
Thomas Waldmann 311ac55ebd undef NDEBUG for chunker and hashindex
note:
intentionally not undef'ing it for all the cython-only generated C code.
2023-02-09 21:01:03 +01:00
Paul D 253d8e8d4e Docs grammar fixes
joined split infinitives, and relocated adverbs appropriately.
2022-12-29 22:26:54 +00:00
Björn Ketelaars 730fca5bcc OpenBSD only - statically link OpenSSL (#6474)
Avoid conflicting with shared libcrypto from the base OS pulled in via
dependencies.
2022-09-10 17:49:24 +02:00
Thomas Waldmann 7957af562d blacken all the code
https://black.readthedocs.io/
2022-07-06 16:34:38 +02:00
TW dbb9f62afd Merge pull request #6836 from ThomasWaldmann/cleanups
Cleanups
2022-07-05 02:46:43 +02:00
Thomas Waldmann ff46a03b42 use language_level = 3str for cython
this will be the default in cython 3.
2022-07-05 00:16:48 +02:00
Thomas Waldmann 350393c9fd remove unused imports 2022-07-05 00:05:07 +02:00
Thomas Waldmann 5c8a5f111f stop using libdeflate
borg2's new repo format does not need computing crc32 over big amounts of
(content) data any more (we now use xxh64 for that).

thus, having a quick crc32 implementation via libdeflate is not important
enough any more to rectify having libdeflate as a requirement.
2022-07-04 20:33:59 +02:00
Thomas Waldmann be9e7d37c2 remove libressl support
currently it does not have what we need, so we can simplify our code.
2022-04-14 19:31:55 +02:00
Thomas Waldmann c592b20262 use openssl on openbsd, fixes #6474 2022-04-14 19:31:55 +02:00
Thomas Waldmann 2872d7acfd point to setup.cfg also 2022-04-13 03:50:54 +02:00
Thomas Waldmann 9642ace953 require/configure setuptools_scm via pyproject.toml 2022-04-07 19:11:15 +02:00
Manu 710d76e5c2 Move system lib comment up, formatting, expand lib not found error. 2022-03-24 08:41:34 +04:00
Manu c86a5491d9 Rever xxhash version 2022-03-23 17:40:33 +04:00
Manu e686ec0d8c Fix openssl ext 2022-03-23 17:28:27 +04:00
Manu 249de7eb45 Add feedback, part 1 2022-03-23 17:19:43 +04:00
Manu dd17c0e869 Fix xxhash version 2022-03-23 15:53:26 +04:00
Manu 3732c45f42 Initial commit 2022-03-23 15:42:34 +04:00
Andrey Bienkowski 78f041440c Argon2 the first part: Implement key derivation (was: part 0) (#6468)
add a argon2 based kdf, using argon2-cffi
2022-03-21 21:51:54 +01:00
Thomas Waldmann cc3b5c062c remove algorithms package, move checksums module to borg package 2022-03-17 00:24:49 +01:00
Thomas Waldmann 98a675f62a use crc32 from libdeflate, remove bundled crc32 code
we use zlib.crc32 (macOS) or libdeflate_crc32 (Linux and all others) now.
2022-03-13 21:39:34 +01:00
James Buren 820de65562 Allow extra compiler flags for every extension build
This is mainly intended for explicit warnings but it can be
used for other flags as well.
2022-03-09 05:18:52 -06:00
Andrey Bienkowski a929b2db0a Merge remote-tracking branch 'origin/master' into pyproject 2022-03-01 08:43:36 +03:00
Thomas Waldmann 64e7ccd3fc require python >= 3.9, fixes #6315 2022-02-27 18:46:30 +01:00