Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,12 @@ jobs:
Write-Host "Contents of C:\olm-install\lib:"
Get-ChildItem -Path C:\olm-install\lib -Recurse

# python-olm expects olm.lib, but CMake creates olm_static.lib when BUILD_SHARED_LIBS=OFF
# Copy the static library with the expected name
if (Test-Path "C:\olm-install\lib\olm_static.lib") {
Copy-Item "C:\olm-install\lib\olm_static.lib" "C:\olm-install\lib\olm.lib"
Write-Host "Copied olm_static.lib to olm.lib"
} else {
Write-Error "ERROR: olm_static.lib not found in C:\olm-install\lib. Build cannot continue."
# Verify that olm.lib was created
if (-not (Test-Path "C:\olm-install\lib\olm.lib")) {
Write-Error "ERROR: olm.lib not found in C:\olm-install\lib. Build cannot continue."
exit 1
}
Write-Host "Successfully built olm.lib"

# Set environment variables for python-olm build
# Include both the include and lib paths, and also set CMAKE_PREFIX_PATH for FindOlm
Expand Down Expand Up @@ -370,6 +367,8 @@ jobs:
echo "PKG_CONFIG_PATH=${HOMEBREW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
echo "CFLAGS=-I${HOMEBREW_PREFIX}/include"
echo "LDFLAGS=-L${HOMEBREW_PREFIX}/lib"
# Tell python-olm to use system libolm instead of building bundled version
echo "CMAKE_ARGS=-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
} >> "$GITHUB_ENV"

- name: Install dependencies
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ and this project adheres to Semantic Calendar Versioning with format YYYY.MM.DD.
## [Unreleased]

### Fixed
- **Build Workflow**: Fixed Windows and macOS build failures in GitHub Actions
- **Windows**: Fixed incorrect check for `olm_static.lib` - CMake creates `olm.lib`, not `olm_static.lib`
- **macOS**: Added `CMAKE_ARGS` to prevent python-olm from building bundled libolm source
- Both platforms now correctly use pre-built/system libolm libraries
- **macOS Installation Documentation**: Fixed python-olm build failures on macOS
- Added macOS-specific prerequisites section in INSTALL.md requiring libolm installation via Homebrew
- Added troubleshooting section for macOS build failures with clear instructions
- Documented requirement to install libolm before installing Python dependencies
- Prevents CMake compatibility errors when building python-olm from source
- Issue: `python-olm` bundles older libolm with CMakeLists.txt incompatible with modern CMake
- Solution: Install libolm via Homebrew so python-olm uses system library instead
- **Build and Release Workflow**: Fixed multiple critical build failures
- Updated Nuitka Action to use `mode=onefile` instead of deprecated `onefile/standalone` options
- Added QEMU setup for ARM64 cross-compilation on Linux
Expand Down
30 changes: 27 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,16 @@ For development or if you prefer to run from source.
- Python 3.12 or higher (3.12, 3.13, 3.14 supported)
- [uv](https://docs.astral.sh/uv/) - Fast Python package installer (recommended) or pip

### Prerequisites
#### macOS-Specific Prerequisites

- Python 3.12 or higher (3.12, 3.13, 3.14 supported)
- [uv](https://docs.astral.sh/uv/) - Fast Python package installer (recommended) or pip
On macOS, you must install libolm and pkg-config via Homebrew **before** installing Python dependencies to avoid build failures:

```bash
# Install libolm and build dependencies via Homebrew
brew install libolm pkg-config cmake
```

This is required because `python-olm` (a dependency of `matrix-nio[e2e]`) bundles an older version of libolm with a CMakeLists.txt that is incompatible with modern CMake. Installing libolm via Homebrew ensures the Python package uses the system library instead of building from source.

### Install uv (if not already installed)

Expand Down Expand Up @@ -605,6 +611,24 @@ Alpine Linux uses OpenRC instead of systemd. This is a lightweight deployment op
- Ensure the bot account has verified its device
- Check file permissions on the store directory

### macOS Build Failures

If you encounter CMake errors when installing dependencies on macOS (e.g., "Compatibility with CMake < 3.5 has been removed"), you need to install libolm via Homebrew:

```bash
# Install libolm and build dependencies
brew install libolm pkg-config cmake

# Then retry installing Python dependencies
# If using uv (recommended):
uv pip install -r requirements.txt

# Or if using pip:
pip install -r requirements.txt
```

This error occurs because `python-olm` bundles an older version of libolm with an outdated CMakeLists.txt. Installing libolm via Homebrew ensures the Python package uses the system library instead of building from source.

## Security Best Practices

1. **Protect credentials**: Never commit config.json with real credentials
Expand Down