which python3
python3 --version
Home // macOS Development Guide
Some notes for developers and contributors willing to help with rdiff-backup development on macOS, or simply compile rdiff-backup from source code.
Here is the list of components required to develop or compile rdiff-backup on macOS.
On macOS, you have two main options for installing Python.
Note
|
The universal2 format allows a single binary to run natively on both x86_64 (Intel) and arm64 (Apple Silicon M1,M2,M3) architectures. This is especially helpful when distributing Python scripts or applications across various Mac environments. https://en.wikipedia.org/wiki/Universal_binary#Universal_2
|
Visit the official Python downloads page for macOS:
Choose the installer labeled macOS 64-bit universal2 installer
.
This version includes support for both Intel and Apple Silicon processors.
It installs Python under /usr/local/bin/python3
(you may need to update your PATH).
If you use Homebrew, you can install Python with:
On macOS, you have two main options to install Python:
Install via Homebrew: brew install python
which python3
python3 --version
You may need the following tools for building native libraries:
xcode-select --install
Clone or download the librsync source from GitHub: https://github.com/rdiff-backup/librsync
Build and install it:
wget https://github.com/librsync/librsync/releases/download/v2.3.4/librsync-2.3.4.tar.gz
tar zxvf librsync-2.3.4.tar.gz
cd librsync
cmake .
make
sudo make install
This should install librsync
in /usr/local/lib
and headers in /usr/local/include
.
To confirm installation:
ls /usr/local/lib | grep rsync
Now you can clone and set up the rdiff-backup source tree:
git clone https://github.com/rdiff-backup/rdiff-backup
cd rdiff-backup
python3 -m venv .venv
source .venv/bin/activate
Ensure you’re using the virtual environment’s Python, verify that python3
is within the venv folder:
which python3
export DYLD_LIBRARY_PATH=/usr/local/lib
pip install -e .
This installs rdiff-backup in editable mode along with development dependencies.
make test
To build a source distribution and wheel:
pyproject-build
Artifacts will be created in the dist/
directory.
If Python cannot find librsync
, make sure DYLD_LIBRARY_PATH
is exported properly.
Use otool -L dist/rdiff-backup
to inspect dynamic library dependencies.