From 84db63d60ee543effa3b6d67b2b1463917fee70f Mon Sep 17 00:00:00 2001 From: Gustavo Murayama Date: Tue, 2 Dec 2025 16:00:20 -0300 Subject: [PATCH 1/3] fix(macos): load zlib --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3940818a..a42993be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,6 +187,18 @@ elseif(ANDROID) ssl crypto ${ANDROID_LOG_LIB}) +elseif(APPLE AND BUILD_MACOS_BUNDLE) + # Add /usr/lib to rpath so @rpath/libz.1.dylib can be found + set_target_properties(pitaya PROPERTIES + BUILD_RPATH "/usr/lib" + INSTALL_RPATH "/usr/lib" + ) + target_link_libraries(pitaya + PRIVATE + zlib + uv_a + ssl + crypto) else() target_link_libraries(pitaya PRIVATE From 4c120932a6ecc892fdd87d0320fc65f2070c58e4 Mon Sep 17 00:00:00 2001 From: Gustavo Murayama Date: Tue, 2 Dec 2025 18:19:18 -0300 Subject: [PATCH 2/3] docs: changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4af71bbf..85ee99fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning] (https://semver.org/spec/v2.0.0.html). +## 4.6.5 - 2025-12-02 +### Fixed +- Fixed `DllNotFoundException` on Unity Editor running on Mac OS due to missing `zlib` dependency + ## 4.6.4 - 2025-11-26 ### Changed - Add OpenSSL-TFG as dependency for iOS builds From 03f5267c8236a93f0f7bbcf0b9cef203ffc6e021 Mon Sep 17 00:00:00 2001 From: Gustavo Murayama Date: Tue, 2 Dec 2025 18:25:49 -0300 Subject: [PATCH 3/3] feat(macos): check zlib path on mac build --- .github/workflows/build-and-release.yaml | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 3fc9c347..918d24cc 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -49,6 +49,56 @@ jobs: - name: Build run: make build-mac-xcode + - name: Check rpath for system library fallback + run: | + BUNDLE="_builds/mac-xcode/Release/libpitaya-mac.bundle" + + # Display bundle dependencies + echo "=== Bundle dependencies ===" + otool -L "$BUNDLE" | head -10 + echo "" + + # Display rpath entries + echo "=== Rpath entries ===" + otool -l "$BUNDLE" | grep -A2 "LC_RPATH" || echo "WARNING: No rpath entries found" + echo "" + + # Check if /usr/lib is in rpath + if ! otool -l "$BUNDLE" | grep -q "path /usr/lib"; then + echo "❌ ERROR: /usr/lib is NOT in rpath!" + echo "The bundle will fail to load on target machines." + echo "" + echo "To fix this, add to CMakeLists.txt:" + echo " if(APPLE AND BUILD_MACOS_BUNDLE)" + echo " set_target_properties(pitaya PROPERTIES" + echo " BUILD_RPATH \"/usr/lib\"" + echo " INSTALL_RPATH \"/usr/lib\")" + echo " endif()" + exit 1 + fi + + echo "✅ /usr/lib is in rpath" + echo "" + + # Test if bundle can be loaded + echo "=== Testing bundle loading ===" + cat > /tmp/test_bundle.c << 'EOF' + #include + #include + int main(int argc, char **argv) { + void* handle = dlopen(argv[1], RTLD_NOW); + if (!handle) { + printf("ERROR: %s\n", dlerror()); + return 1; + } + printf("SUCCESS: Bundle loads correctly\n"); + dlclose(handle); + return 0; + } + EOF + cc -o /tmp/test_bundle /tmp/test_bundle.c + /tmp/test_bundle "$BUNDLE" + - name: Upload binary artifact uses: actions/upload-artifact@v4 with: