From 6a277dd3ab20c0056d25517636dbb47e27a48a0e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 16:21:18 +0000 Subject: [PATCH 1/3] Initial plan From 9dc0390baba4836fb7d255bd62243cb68edd702b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 16:25:07 +0000 Subject: [PATCH 2/3] fix: correct Windows libolm library name check in build workflow The Windows build was failing because the workflow checked for olm_static.lib, but CMake with BUILD_SHARED_LIBS=OFF creates olm.lib directly. Updated the check to verify that olm.lib exists instead of trying to copy from a non-existent olm_static.lib file. Co-authored-by: CJFWeatherhead <6923098+CJFWeatherhead@users.noreply.github.com> --- .github/workflows/build.yml | 12 +++++------- CHANGELOG.md | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 508f88d..eb07bf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -253,15 +253,13 @@ 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 successfully + # CMake with BUILD_SHARED_LIBS=OFF creates olm.lib directly + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f2fecf..549b6ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to Semantic Calendar Versioning with format YYYY.MM.DD. - Installed libolm build dependency via homebrew on macOS - Setup CMake and libolm build environment on Windows - **Windows Build**: Patched libolm CMakeLists.txt to require CMake 3.5+ for compatibility + - **Windows Build**: Fixed incorrect library name check - CMake creates `olm.lib` directly, not `olm_static.lib` - **macOS Build**: Set CFLAGS and LDFLAGS to use homebrew libolm instead of building from source - Fixed compatibility issues with python-olm native extension builds - Enhanced Windows libolm build configuration with CMAKE_BUILD_TYPE and proper install paths From aaf56ea56fca1e0a131d6b1b6b150fd743ef6168 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:41:12 +0000 Subject: [PATCH 3/3] fix: build libolm as shared library (DLL) on Windows The Windows build was creating a static library (olm.lib) instead of a shared library. Python-olm on Windows requires a DLL (olm.dll) with its import library (olm.lib) for proper linking and runtime loading. Changed BUILD_SHARED_LIBS from OFF to ON, added DLL path verification, and added bin directory to PATH for runtime DLL discovery. Co-authored-by: CJFWeatherhead <6923098+CJFWeatherhead@users.noreply.github.com> --- .github/workflows/build.yml | 18 ++++++++++++------ CHANGELOG.md | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb07bf7..c27c17f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -245,26 +245,32 @@ jobs: cmake -S . -B build ` -DCMAKE_INSTALL_PREFIX=C:\olm-install ` -DCMAKE_BUILD_TYPE=Release ` - -DBUILD_SHARED_LIBS=OFF + -DBUILD_SHARED_LIBS=ON cmake --build build --config Release cmake --install build --config Release # Debug: Show what files were created - Write-Host "Contents of C:\olm-install\lib:" - Get-ChildItem -Path C:\olm-install\lib -Recurse + Write-Host "Contents of C:\olm-install:" + Get-ChildItem -Path C:\olm-install -Recurse | Select-Object FullName, Length - # Verify that olm.lib was created successfully - # CMake with BUILD_SHARED_LIBS=OFF creates olm.lib directly + # Verify that olm.dll and olm.lib were created successfully + # CMake with BUILD_SHARED_LIBS=ON creates olm.dll (shared library) and olm.lib (import library) + if (-not (Test-Path "C:\olm-install\bin\olm.dll")) { + Write-Error "ERROR: olm.dll not found in C:\olm-install\bin. Build cannot continue." + exit 1 + } 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" + Write-Host "Successfully built olm.dll and olm.lib" # Set environment variables for python-olm build # Include both the include and lib paths, and also set CMAKE_PREFIX_PATH for FindOlm + # Add bin directory to PATH so the DLL can be found at runtime echo "INCLUDE=C:\olm-install\include;$env:INCLUDE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "LIB=C:\olm-install\lib;$env:LIB" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "PATH=C:\olm-install\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "CMAKE_PREFIX_PATH=C:\olm-install;$env:CMAKE_PREFIX_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Install dependencies diff --git a/CHANGELOG.md b/CHANGELOG.md index 549b6ef..62e36d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ and this project adheres to Semantic Calendar Versioning with format YYYY.MM.DD. - Installed libolm build dependency via homebrew on macOS - Setup CMake and libolm build environment on Windows - **Windows Build**: Patched libolm CMakeLists.txt to require CMake 3.5+ for compatibility - - **Windows Build**: Fixed incorrect library name check - CMake creates `olm.lib` directly, not `olm_static.lib` + - **Windows Build**: Fixed libolm build to create shared library (DLL) instead of static library - python-olm requires olm.dll and olm.lib (import library) - **macOS Build**: Set CFLAGS and LDFLAGS to use homebrew libolm instead of building from source - Fixed compatibility issues with python-olm native extension builds - Enhanced Windows libolm build configuration with CMAKE_BUILD_TYPE and proper install paths