Skip to content

Commit 1bb2b3d

Browse files
authored
Fix missing cmake_deps.toml dep from size_test to extension_data_loader (#12744)
Missing deps like this causes executorch_srcs.cmake to just roll the sources into the would-be-depending target, which is bad.
1 parent f592d85 commit 1bb2b3d

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

.github/workflows/trunk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ jobs:
269269
if [[ ${{ matrix.os}} == "bare_metal" ]]; then
270270
bash test/build_size_test.sh "-DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} -DEXECUTORCH_BUILD_ARM_BAREMETAL=ON"
271271
elif [[ ${{ matrix.os}} == "zephyr-preset" ]]; then
272-
CXXFLAGS=${cxx_flags} cmake --preset zephyr -DCMAKE_BUILD_TYPE=Release -DEXECUTORCH_OPTIMIZE_SIZE=ON -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out .
272+
CXXFLAGS=${cxx_flags} cmake --preset zephyr -DCMAKE_BUILD_TYPE=Release -DEXECUTORCH_OPTIMIZE_SIZE=ON -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out .
273273
cmake --build cmake-out -j9 --target install --config Release
274274
CXXFLAGS=${cxx_flags} cmake -DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test
275275
cmake --build cmake-out/test -j9 --config Release

test/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ list(TRANSFORM _size_test__srcs PREPEND "${EXECUTORCH_ROOT}/")
5151
# TODO(larryliu0820): Add EXECUTORCH_BUILD_EXECUTABLES to not build executable
5252
# when we cross compile to ios
5353
add_executable(size_test ${_size_test__srcs})
54-
target_link_libraries(size_test executorch)
54+
target_link_libraries(size_test executorch extension_data_loader)
5555
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
5656
target_link_options_gc_sections(size_test)
5757
endif()
@@ -62,7 +62,8 @@ endif()
6262
add_executable(size_test_all_ops ${_size_test__srcs})
6363
executorch_target_link_options_shared_lib(portable_ops_lib)
6464
target_link_libraries(
65-
size_test_all_ops executorch portable_ops_lib portable_kernels
65+
size_test_all_ops executorch extension_data_loader portable_ops_lib
66+
portable_kernels
6667
)
6768
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
6869
target_link_options_gc_sections(size_test_all_ops)
@@ -75,7 +76,8 @@ if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
7576
add_executable(size_test_all_optimized_ops ${_size_test__srcs})
7677
executorch_target_link_options_shared_lib(optimized_native_cpu_ops_lib)
7778
target_link_libraries(
78-
size_test_all_optimized_ops executorch optimized_native_cpu_ops_lib
79+
size_test_all_optimized_ops executorch extension_data_loader
80+
optimized_native_cpu_ops_lib
7981
)
8082
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
8183
target_link_options_gc_sections(size_test_all_optimized_ops)

test/build_size_test.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,12 @@ cmake_install_executorch_lib() {
2323
update_tokenizers_git_submodule
2424
local EXTRA_BUILD_ARGS="${@}"
2525

26-
if [[ "$EXTRA_BUILD_ARGS" == *"-DEXECUTORCH_BUILD_ARM_BAREMETAL=ON"* ]]; then
27-
local BUILD_DATA_LOADER="OFF"
28-
else
29-
local BUILD_DATA_LOADER=ON
30-
fi
3126
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DBUCK2="$BUCK2" \
3227
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
3328
-DCMAKE_INSTALL_PREFIX=cmake-out \
3429
-DCMAKE_BUILD_TYPE=Release \
3530
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF \
36-
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=${BUILD_DATA_LOADER} \
31+
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
3732
-DEXECUTORCH_OPTIMIZE_SIZE=ON \
3833
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
3934
${EXTRA_BUILD_ARGS} \

tools/cmake/cmake_deps.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ excludes = [
373373
deps = [
374374
"executorch_core",
375375
"executorch",
376+
"extension_data_loader",
376377
]
377378
# ---------------------------------- binary end ----------------------------------
378379
# ---------------------------------- MPS start ----------------------------------

0 commit comments

Comments
 (0)