Skip to content

Commit ebe3f69

Browse files
committed
Build size_test binaries with debug info
The CI workflow already runs strip before checking size, so this shouldn't break it (and we'll see if it does on this PR). Having debug info makes it much easier to investigate issues with bloaty. ghstack-source-id: 640864c ghstack-comment-id: 3009793476 Pull-Request-resolved: #12019
1 parent ce6d2a4 commit ebe3f69

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/pull.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ jobs:
366366
# build module for executorch.extension.pybindings.portable_lib
367367
bash test/build_size_test.sh
368368
strip cmake-out/test/size_test
369+
strip --strip-debug cmake-out/test/size_test
369370
output=$(ls -la cmake-out/test/size_test)
370371
arr=($output)
371372
size=${arr[4]}
@@ -403,6 +404,7 @@ jobs:
403404
# build module for executorch.extension.pybindings.portable_lib
404405
bash test/build_size_test.sh
405406
strip cmake-out/test/size_test
407+
strip --strip-debug cmake-out/test/size_test
406408
output=$(ls -la cmake-out/test/size_test)
407409
arr=($output)
408410
size=${arr[4]}

test/build_size_test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ cmake_install_executorch_lib() {
2626
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DBUCK2="$BUCK2" \
2727
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
2828
-DCMAKE_INSTALL_PREFIX=cmake-out \
29-
-DCMAKE_BUILD_TYPE=Release \
29+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
3030
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF \
3131
-DEXECUTORCH_OPTIMIZE_SIZE=ON \
3232
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
3333
${EXTRA_BUILD_ARGS} \
3434
-Bcmake-out .
35-
cmake --build cmake-out -j9 --target install --config Release
35+
cmake --build cmake-out -j9 --target install --config RelWithDebInfo
3636
}
3737

3838
test_cmake_size_test() {
39-
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DCMAKE_BUILD_TYPE=Release \
39+
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
4040
-DCMAKE_INSTALL_PREFIX=cmake-out \
4141
${EXTRA_BUILD_ARGS} \
4242
-Bcmake-out/test test
4343

4444
echo "Build size test"
45-
cmake --build cmake-out/test -j9 --config Release
45+
cmake --build cmake-out/test -j9 --config RelWithDebInfo
4646

4747
echo 'ExecuTorch with no ops binary size, unstripped:'
4848
ls -al cmake-out/test/size_test

0 commit comments

Comments
 (0)