From 937f41377c1c7ca603c14efd10500102030bc6a5 Mon Sep 17 00:00:00 2001 From: duncanpo Date: Thu, 28 Aug 2025 14:02:54 -0400 Subject: [PATCH 1/4] fix hardcoded dependency issue on Mac, fixes #189 --- CMakeLists.txt | 2 +- cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake | 6 ++++++ cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e782fa..be00c7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ else() set(VCPKG_FETCH_CONTENT_NAME vcpkg) set(VCPKG_GIT_REPOSITORY "https://github.com/microsoft/vcpkg.git") - set(VCPKG_GIT_TAG "f7423ee") + set(VCPKG_GIT_TAG "b02e341") FetchContent_Declare( ${VCPKG_FETCH_CONTENT_NAME} GIT_REPOSITORY ${VCPKG_GIT_REPOSITORY} diff --git a/cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake b/cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake index 4e8c1d0..eade7d9 100644 --- a/cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake +++ b/cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake @@ -5,6 +5,12 @@ if(${PORT} MATCHES "(curl|zlib)") else() set(VCPKG_LIBRARY_LINKAGE static) endif() ++# disable the script to fix rpath for curl, which makes an undesirable change to ++# the install name from @rpath/libcurl.4.dylib to @rpath/libcurl.4.8.0.dylib ++if(${PORT} MATCHES "curl") ++ set(VCPKG_FIXUP_MACHO_RPATH OFF) ++endif() + set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES arm64) diff --git a/cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake b/cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake index e33a495..9f860b6 100644 --- a/cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake +++ b/cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake @@ -5,6 +5,11 @@ if(${PORT} MATCHES "(curl|zlib)") else() set(VCPKG_LIBRARY_LINKAGE static) endif() ++# disable the script to fix rpath for curl, which makes an undesirable change to ++# the install name from @rpath/libcurl.4.dylib to @rpath/libcurl.4.8.0.dylib ++if(${PORT} MATCHES "curl") ++ set(VCPKG_FIXUP_MACHO_RPATH OFF) ++endif() set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES x86_64) From edc71c0bc3726c5e86297e923d452c248b23589f Mon Sep 17 00:00:00 2001 From: duncanpo Date: Thu, 28 Aug 2025 14:33:05 -0400 Subject: [PATCH 2/4] fix a typo in Mac triplet files --- cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake | 10 +++++----- cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake b/cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake index eade7d9..52210d2 100644 --- a/cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake +++ b/cmake/vcpkg_triplets/arm64-osx-otel-matlab.cmake @@ -5,11 +5,11 @@ if(${PORT} MATCHES "(curl|zlib)") else() set(VCPKG_LIBRARY_LINKAGE static) endif() -+# disable the script to fix rpath for curl, which makes an undesirable change to -+# the install name from @rpath/libcurl.4.dylib to @rpath/libcurl.4.8.0.dylib -+if(${PORT} MATCHES "curl") -+ set(VCPKG_FIXUP_MACHO_RPATH OFF) -+endif() +# disable the script to fix rpath for curl, which makes an undesirable change to +# the install name from @rpath/libcurl.4.dylib to @rpath/libcurl.4.8.0.dylib +if(${PORT} MATCHES "curl") + set(VCPKG_FIXUP_MACHO_RPATH OFF) +endif() set(VCPKG_CMAKE_SYSTEM_NAME Darwin) diff --git a/cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake b/cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake index 9f860b6..c2bedaa 100644 --- a/cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake +++ b/cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake @@ -5,11 +5,11 @@ if(${PORT} MATCHES "(curl|zlib)") else() set(VCPKG_LIBRARY_LINKAGE static) endif() -+# disable the script to fix rpath for curl, which makes an undesirable change to -+# the install name from @rpath/libcurl.4.dylib to @rpath/libcurl.4.8.0.dylib -+if(${PORT} MATCHES "curl") -+ set(VCPKG_FIXUP_MACHO_RPATH OFF) -+endif() +# disable the script to fix rpath for curl, which makes an undesirable change to +# the install name from @rpath/libcurl.4.dylib to @rpath/libcurl.4.8.0.dylib +if(${PORT} MATCHES "curl") + set(VCPKG_FIXUP_MACHO_RPATH OFF) +endif() set(VCPKG_CMAKE_SYSTEM_NAME Darwin) set(VCPKG_OSX_ARCHITECTURES x86_64) From d3e91f68190e5894b310ee596c0c9ea90fa395ee Mon Sep 17 00:00:00 2001 From: duncanpo Date: Thu, 28 Aug 2025 23:10:15 -0400 Subject: [PATCH 3/4] change triplet name to conform to requirement --- CMakeLists.txt | 6 +++++- ...6_64-osx-otel-matlab.cmake => x64-osx-otel-matlab.cmake} | 0 2 files changed, 5 insertions(+), 1 deletion(-) rename cmake/vcpkg_triplets/{x86_64-osx-otel-matlab.cmake => x64-osx-otel-matlab.cmake} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index be00c7b..188c15d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,11 @@ if(APPLE) # use libcurl as a shared library and load the MATLAB version at runtime # run uname -m to determine whether arm64 or x86_64 exec_program(uname ARGS -m OUTPUT_VARIABLE MAC_HOST_SYSTEM) - set(VCPKG_OTEL_TRIPLET ${MAC_HOST_SYSTEM}-osx-otel-matlab) + if(${MAC_HOST_SYSTEM} STREQUAL "arm64") + set(VCPKG_OTEL_TRIPLET "arm64-osx-otel-matlab") + elseif(${MAC_HOST_SYSTEM} STREQUAL "x86_64") + set(VCPKG_OTEL_TRIPLET "x64-osx-otel-matlab") + endif() set(VCPKG_OVERLAY_TRIPLETS ${CMAKE_SOURCE_DIR}/cmake/vcpkg_triplets) set(VCPKG_TARGET_TRIPLET ${VCPKG_OTEL_TRIPLET}) set(TRIPLET_DEFINITIONS -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}) diff --git a/cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake b/cmake/vcpkg_triplets/x64-osx-otel-matlab.cmake similarity index 100% rename from cmake/vcpkg_triplets/x86_64-osx-otel-matlab.cmake rename to cmake/vcpkg_triplets/x64-osx-otel-matlab.cmake From 97d80d7c9625ab189023d09044f2432fce4d4246 Mon Sep 17 00:00:00 2001 From: duncanpo Date: Fri, 29 Aug 2025 09:22:52 -0400 Subject: [PATCH 4/4] pin MATLAB to specific versions in GitHub workflows --- .github/workflows/build_and_test_full.yml | 5 +++++ .github/workflows/build_and_test_simple.yml | 4 ++++ .github/workflows/create_release.yml | 7 ++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test_full.yml b/.github/workflows/build_and_test_full.yml index 6dae576..296fa05 100644 --- a/.github/workflows/build_and_test_full.yml +++ b/.github/workflows/build_and_test_full.yml @@ -40,6 +40,7 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + release: R2025a products: MATLAB_Compiler MATLAB_Compiler_SDK - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab @@ -70,6 +71,7 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + release: R2025a products: MATLAB_Compiler MATLAB_Compiler_SDK - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab @@ -106,6 +108,8 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + # pin to R2024b because R2025a has an issue that causes a failure when building the context_propagation example + release: R2024b products: MATLAB_Compiler MATLAB_Compiler_SDK - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab @@ -140,6 +144,7 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + release: R2025a products: MATLAB_Compiler MATLAB_Compiler_SDK - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab diff --git a/.github/workflows/build_and_test_simple.yml b/.github/workflows/build_and_test_simple.yml index 27f4fd5..d703e44 100644 --- a/.github/workflows/build_and_test_simple.yml +++ b/.github/workflows/build_and_test_simple.yml @@ -41,6 +41,7 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + release: R2025a products: MATLAB_Compiler MATLAB_Compiler_SDK - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab @@ -70,6 +71,8 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + # pin to R2024b because R2025a has an issue that causes a failure when building the context_propagation example + release: R2024b products: MATLAB_Compiler MATLAB_Compiler_SDK - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab @@ -104,6 +107,7 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + release: R2025a products: MATLAB_Compiler MATLAB_Compiler_SDK - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index b3202b9..6b710e4 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -18,6 +18,7 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + release: R2025a products: MATLAB_Compiler - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab @@ -46,6 +47,7 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + release: R2025a products: MATLAB_Compiler - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab @@ -79,6 +81,7 @@ jobs: - name: Install MATLAB uses: matlab-actions/setup-matlab@v2 with: + release: R2025a products: MATLAB_Compiler - name: Build OpenTelemetry-Matlab working-directory: opentelemetry-matlab @@ -121,7 +124,9 @@ jobs: tar -xzvf otel-matlab-macos-14.tar.gz tar -xzvf otel-matlab-windows.tar.gz - name: Install MATLAB - uses: matlab-actions/setup-matlab@v1 + uses: matlab-actions/setup-matlab@v2 + with: + release: R2025a - name: Run commands env: MATLABPATH: OpenTelemetry-Matlab/tools