Skip to content

Commit 64ed413

Browse files
committed
Merge remote-tracking branch 'origin/main' into testing
2 parents 0370c68 + ca7cae3 commit 64ed413

File tree

5 files changed

+148
-13
lines changed

5 files changed

+148
-13
lines changed

.github/workflows/create_release.yml

Lines changed: 134 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,98 @@ jobs:
9696
with:
9797
name: otel-matlab-${{ matrix.os }}.tar.gz
9898
path: ${{ github.workspace }}/otel-matlab-${{ matrix.os }}.tar.gz
99+
nogrpc-ubuntu: # without gRPC exporter
100+
runs-on: ubuntu-22.04
101+
env:
102+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
103+
steps:
104+
- name: Download OpenTelemetry-Matlab source
105+
uses: actions/checkout@v3
106+
with:
107+
path: opentelemetry-matlab
108+
- name: Install ninja-build
109+
run: sudo apt-get install ninja-build
110+
- name: Install MATLAB
111+
uses: matlab-actions/setup-matlab@v2
112+
with:
113+
release: R2025a
114+
products: MATLAB_Compiler
115+
- name: Build OpenTelemetry-Matlab
116+
working-directory: opentelemetry-matlab
117+
run: |
118+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=OFF -DWITH_OTLP_FILE=ON -DOTEL_MATLAB_VERSION=${{ github.ref_name }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
119+
cmake --build build --config Release --target install
120+
- name: Compress into single artifact
121+
working-directory: ${{ github.workspace }}
122+
run: tar -czf otel-matlab-nogrpc-ubuntu.tar.gz otel_matlab_install
123+
- name: Upload artifacts
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: otel-matlab-nogrpc-ubuntu.tar.gz
127+
path: ${{ github.workspace }}/otel-matlab-nogrpc-ubuntu.tar.gz
128+
nogrpc-windows: # without gRPC exporter
129+
runs-on: windows-latest
130+
env:
131+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
132+
steps:
133+
- name: Download OpenTelemetry-Matlab source
134+
uses: actions/checkout@v3
135+
with:
136+
path: opentelemetry-matlab
137+
- name: Install ninja-build
138+
run: choco install ninja
139+
- name: Install MATLAB
140+
uses: matlab-actions/setup-matlab@v2
141+
with:
142+
release: R2025a
143+
products: MATLAB_Compiler
144+
- name: Build OpenTelemetry-Matlab
145+
working-directory: opentelemetry-matlab
146+
shell: cmd
147+
run: |
148+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
149+
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=OFF -DWITH_OTLP_FILE=ON -DFETCH_VCPKG=ON -DOTEL_MATLAB_VERSION=${{ github.ref_name }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
150+
cmake --build build --config Release --target install
151+
- name: Compress into single artifact
152+
working-directory: ${{ github.workspace }}
153+
run: tar -czf otel-matlab-nogrpc-windows.tar.gz otel_matlab_install
154+
- name: Upload artifacts
155+
uses: actions/upload-artifact@v4
156+
with:
157+
name: otel-matlab-nogrpc-windows.tar.gz
158+
path: ${{ github.workspace }}/otel-matlab-nogrpc-windows.tar.gz
159+
nogrpc-macos: # without gRPC exporter
160+
runs-on: ${{ matrix.os }}
161+
strategy:
162+
matrix:
163+
os: [macos-13, macos-14] # runs on Mac with both Intel (macos-13) and Apple Silicon (macos-14) processors
164+
env:
165+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
166+
steps:
167+
- name: Download OpenTelemetry-Matlab source
168+
uses: actions/checkout@v3
169+
with:
170+
path: opentelemetry-matlab
171+
- name: Install ninja-build
172+
run: brew install ninja
173+
- name: Install MATLAB
174+
uses: matlab-actions/setup-matlab@v2
175+
with:
176+
release: R2025a
177+
products: MATLAB_Compiler
178+
- name: Build OpenTelemetry-Matlab
179+
working-directory: opentelemetry-matlab
180+
run: |
181+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=OFF -DWITH_OTLP_FILE=ON -DOTEL_MATLAB_VERSION=${{ github.ref_name }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
182+
cmake --build build --config Release --target install
183+
- name: Compress into single artifact
184+
working-directory: ${{ github.workspace }}
185+
run: tar -czf otel-matlab-nogrpc-${{ matrix.os }}.tar.gz otel_matlab_install
186+
- name: Upload artifacts
187+
uses: actions/upload-artifact@v4
188+
with:
189+
name: otel-matlab-nogrpc-${{ matrix.os }}.tar.gz
190+
path: ${{ github.workspace }}/otel-matlab-nogrpc-${{ matrix.os }}.tar.gz
99191
package-mltbx:
100192
name: Package MATLAB Toolbox (MLTBX) Files
101193
runs-on: ubuntu-22.04
@@ -105,8 +197,13 @@ jobs:
105197
- build-ubuntu
106198
- build-windows
107199
- build-macos
200+
- nogrpc-ubuntu
201+
- nogrpc-windows
202+
- nogrpc-macos
108203
env:
109204
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
205+
WITHGRPC_FOLDER: "${{ github.workspace }}/withgrpc"
206+
NOGRPC_FOLDER: "${{ github.workspace }}/nogrpc"
110207
steps:
111208
- name: Checkout OpenTelemetry-Matlab
112209
uses: actions/checkout@v3
@@ -118,28 +215,61 @@ jobs:
118215
path: artifacts-downloaded
119216
- name: Decompress Artifacts
120217
run: |
121-
mv artifacts-downloaded/*/*.tar.gz .
218+
mkdir $WITHGRPC_FOLDER
219+
cd $WITHGRPC_FOLDER
220+
mv ../artifacts-downloaded/*/otel-matlab-ubuntu.tar.gz .
221+
mv ../artifacts-downloaded/*/otel-matlab-macos*.tar.gz .
222+
mv ../artifacts-downloaded/*/otel-matlab-windows.tar.gz .
122223
tar -xzvf otel-matlab-ubuntu.tar.gz
123224
tar -xzvf otel-matlab-macos-13.tar.gz
124225
tar -xzvf otel-matlab-macos-14.tar.gz
125226
tar -xzvf otel-matlab-windows.tar.gz
227+
- name: Decompress Artifacts without gRPC exporter
228+
run: |
229+
mkdir $NOGRPC_FOLDER
230+
cd $NOGRPC_FOLDER
231+
mv ../artifacts-downloaded/*/*nogrpc*.tar.gz .
232+
tar -xzvf otel-matlab-nogrpc-ubuntu.tar.gz
233+
tar -xzvf otel-matlab-nogrpc-macos-13.tar.gz
234+
tar -xzvf otel-matlab-nogrpc-macos-14.tar.gz
235+
tar -xzvf otel-matlab-nogrpc-windows.tar.gz
126236
- name: Install MATLAB
127237
uses: matlab-actions/setup-matlab@v2
128238
with:
129239
release: R2025a
130-
- name: Run commands
240+
- name: Package Toolbox
241+
env:
242+
MATLABPATH: OpenTelemetry-Matlab/tools
243+
WORKING_FOLDER: ${{ env.WITHGRPC_FOLDER }}
244+
OTEL_MATLAB_TOOLBOX_FOLDER: otel_matlab_install
245+
OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER: ${{ env.WITHGRPC_FOLDER }}
246+
OTEL_MATLAB_TOOLBOX_VERSION: ${{ github.ref_name }}
247+
OTEL_MATLAB_TOOLBOX_NAME: otel-matlab
248+
uses: matlab-actions/run-command@v1
249+
with:
250+
command: packageMatlabInterface
251+
- name: Package Toolbox without gRPC exporter
131252
env:
132253
MATLABPATH: OpenTelemetry-Matlab/tools
254+
WORKING_FOLDER: ${{ env.NOGRPC_FOLDER }}
133255
OTEL_MATLAB_TOOLBOX_FOLDER: otel_matlab_install
134-
OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER:
256+
OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER: ${{ env.NOGRPC_FOLDER }}
135257
OTEL_MATLAB_TOOLBOX_VERSION: ${{ github.ref_name }}
258+
OTEL_MATLAB_TOOLBOX_NAME: otel-matlab-nogrpc
136259
uses: matlab-actions/run-command@v1
137260
with:
138261
command: packageMatlabInterface
262+
- name: Compress Toolbox without gRPC exporter
263+
working-directory: ${{ env.NOGRPC_FOLDER }}
264+
run: tar -czf otel-matlab-nogrpc.mltbx.tar.gz otel-matlab-nogrpc.mltbx
139265
- name: Create release
140266
uses: softprops/action-gh-release@v2
267+
# Upload toolbox without gRPC exporter in compressed format
268+
# This is to avoid multiple .mltbx files, which will cause issues in MATLAB File Exchange
141269
with:
142-
files: ./otel-matlab.mltbx
270+
files: |
271+
${{ env.WITHGRPC_FOLDER }}/otel-matlab.mltbx
272+
${{ env.NOGRPC_FOLDER }}/otel-matlab-nogrpc.mltbx.tar.gz
143273
name: "Version ${{ github.ref_name }}"
144274
fail_on_unmatched_files: true
145275
generate_release_notes: false

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ if(WIN32)
423423

424424
if(WITH_OTLP_HTTP)
425425
set(OPENTELEMETRY_PROXY_RUNTIME_LIBRARIES ${OPENTELEMETRY_PROXY_RUNTIME_LIBRARIES}
426-
$<TARGET_FILE:CURL::libcurl>)
426+
$<TARGET_FILE:CURL::libcurl_shared>)
427427
endif()
428428

429429
if(WITH_OTLP_GRPC)
@@ -432,10 +432,8 @@ if(WIN32)
432432
set(OPENSSL_DLL libssl-3-x64.dll)
433433
set(OPENSSL_CRYPTO_DLL libcrypto-3-x64.dll)
434434
set(OPENTELEMETRY_PROXY_RUNTIME_LIBRARIES ${OPENTELEMETRY_PROXY_RUNTIME_LIBRARIES}
435-
$<TARGET_FILE:c-ares::cares>
436435
$<TARGET_FILE_DIR:OpenSSL::SSL>/../bin/${OPENSSL_DLL}
437-
$<TARGET_FILE_DIR:OpenSSL::SSL>/../bin/${OPENSSL_CRYPTO_DLL}
438-
$<TARGET_FILE:re2::re2>)
436+
$<TARGET_FILE_DIR:OpenSSL::SSL>/../bin/${OPENSSL_CRYPTO_DLL})
439437
endif()
440438
else()
441439
set(OTEL_CPP_RUNTIME ${OTEL_CPP_PREFIX}/lib/libopentelemetry_proto${CMAKE_SHARED_LIBRARY_SUFFIX})

cmake/vcpkg_triplets/x64-windows-otel-matlab.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
set(VCPKG_TARGET_ARCHITECTURE x64)
22
set(VCPKG_CRT_LINKAGE dynamic)
3-
# Conflict with abseil_dll.dll used by Simulink. Use static library to avoid conflict.
4-
if(${PORT} MATCHES "abseil")
3+
# Conflict with abseil_dll.dll used by Simulink. cares.dll and re2.dll are also shipped with MATLAB.
4+
# Use static libraries to avoid conflict.
5+
if(${PORT} MATCHES "(abseil|c-ares|re2)")
56
set(VCPKG_LIBRARY_LINKAGE static)
67
else()
78
set(VCPKG_LIBRARY_LINKAGE dynamic)

tools/packageMatlabInterface.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@
55
% the resulting .mltbx file location is taken from environment variable
66
% OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER.
77

8-
% Copyright 2024 The MathWorks, Inc.
8+
% Copyright 2024-2025 The MathWorks, Inc.
99

1010
toolboxFolder = string(getenv("OTEL_MATLAB_TOOLBOX_FOLDER"));
1111
outputFolder = string(getenv("OTEL_MATLAB_TOOLBOX_OUTPUT_FOLDER"));
1212
toolboxVersion = string(getenv("OTEL_MATLAB_TOOLBOX_VERSION"));
13+
workingFolder = string(getenv("WORKING_FOLDER"));
14+
toolboxName = string(getenv("OTEL_MATLAB_TOOLBOX_NAME"));
15+
16+
% cd to working folder
17+
cd(workingFolder);
1318

1419
% Output folder must exist.
1520
mkdir(outputFolder);
1621

1722
disp("Toolbox Folder: " + toolboxFolder);
1823
disp("Output Folder: " + outputFolder);
1924
disp("Toolbox Version:" + toolboxVersion);
25+
disp("Toolbox Name:" + toolboxName);
2026

2127
identifier = "dc2cae2f-4f43-4d2c-b6ed-f1a59f0dfcdf";
2228
opts = matlab.addons.toolbox.ToolboxOptions(toolboxFolder, identifier);
@@ -33,6 +39,6 @@
3339

3440
opts.MinimumMatlabRelease = "R2022a";
3541

36-
opts.OutputFile = fullfile(outputFolder, "otel-matlab.mltbx");
42+
opts.OutputFile = fullfile(outputFolder, toolboxName + ".mltbx");
3743
disp("Output File: " + opts.OutputFile);
3844
matlab.addons.toolbox.packageToolbox(opts);

vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
]
2626
}
2727
},
28-
"builtin-baseline": "638b1588be3a265a9c7ad5b212cef72a1cad336a"
28+
"builtin-baseline": "f7423ee180c4b7f40d43402c2feb3859161ef625"
2929
}

0 commit comments

Comments
 (0)