summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2022-12-05 17:18:50 +0000
committerKshitij Sisodia <kshitij.sisodia@arm.com>2022-12-06 09:15:05 +0000
commit47406feb4b2aed29942d7e89cab882ea797dbf7e (patch)
tree1d95943c36f1935a893613fbdb013a7a8b7de2fb /scripts
parent71f282e8dc7284431cd6d0305370cc8e450d4463 (diff)
downloadml-embedded-evaluation-kit-47406feb4b2aed29942d7e89cab882ea797dbf7e.tar.gz
MLECO-3710: Fix for freshly updated submodule build issue.
TensorFlow Lite Micro can have stale third party components downloaded by an older version. On a submodule update, our recommendation to users would be to use `-DTENSORFLOW_LITE_MICRO_CLEAN_DOWNLOADS=ON` to clean the older downloads. Moving the triggered cleaning and refresh to CMake configuration stage (with no parallel build option). This should have a better chance of success with the subsequent build step. Change-Id: I305439c09658f49765ecc15eb1ce0c8b914dd30a
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/tensorflow.cmake11
-rw-r--r--scripts/py/setup_hooks.py34
2 files changed, 27 insertions, 18 deletions
diff --git a/scripts/cmake/tensorflow.cmake b/scripts/cmake/tensorflow.cmake
index d807416..29d5bce 100644
--- a/scripts/cmake/tensorflow.cmake
+++ b/scripts/cmake/tensorflow.cmake
@@ -71,7 +71,16 @@ else()
endif()
if (TENSORFLOW_LITE_MICRO_CLEAN_DOWNLOADS)
- list(APPEND MAKE_TARGETS_LIST "clean_downloads")
+ message(STATUS "Refreshing TensorFlow Lite Micro's third party downloads...")
+ execute_process(
+ COMMAND make -f ${TENSORFLOW_LITE_MICRO_PATH}/tools/make/Makefile clean_downloads third_party_downloads
+ RESULT_VARIABLE return_code
+ WORKING_DIRECTORY ${TENSORFLOW_SRC_PATH})
+ if (NOT return_code EQUAL "0")
+ message(FATAL_ERROR "Failed to clean TensorFlow Lite Micro's third party downloads.")
+ else()
+ message(STATUS "Refresh completed.")
+ endif ()
endif()
if (TENSORFLOW_LITE_MICRO_CLEAN_BUILD)
diff --git a/scripts/py/setup_hooks.py b/scripts/py/setup_hooks.py
index 97a2861..178765c 100644
--- a/scripts/py/setup_hooks.py
+++ b/scripts/py/setup_hooks.py
@@ -55,25 +55,25 @@ def add_pre_push_hooks(hooks_dir):
while read local_ref local_sha remote_ref remote_sha
do
# We should pass only added or modified C/C++ source files to cppcheck.
- changed_files=$(git diff --name-only HEAD~1 HEAD | grep -E "*\.(c|cpp|cc|cxx)" | cut -f 2)
- if [ -n "$changed_files" ]; then
- clang-format -style=file --dry-run --Werror $changed_files
+ changed_files=$(git diff --name-only HEAD~1 HEAD | grep -iE "\.(c|cpp|cxx|cc|h|hpp|hxx)$" | cut -f 2)
+ if [ -n "$changed_files" ]; then
+ clang-format -style=file --dry-run --Werror $changed_files
- exitcode1=$?
- if [ $exitcode1 -ne 0 ]; then
- echo "Formatting errors found in file: $changed_files.
- \nPlease run:\n\ \"clang-format -style=file -i $changed_files\"
- \nto correct these errors"
- exit $exitcode1
- fi
+ exitcode1=$?
+ if [ $exitcode1 -ne 0 ]; then
+ echo "Formatting errors found in file: $changed_files.
+ \nPlease run:\n\ \"clang-format -style=file -i $changed_files\"
+ \nto correct these errors"
+ exit $exitcode1
+ fi
- cppcheck --enable=performance,portability --error-exitcode=1 $changed_files
- exitcode2=$?
- if [ $exitcode2 -ne 0 ]; then
- exit $exitcode2
- fi
- fi
- exit 0
+ cppcheck --enable=performance,portability --error-exitcode=1 $changed_files
+ exitcode2=$?
+ if [ $exitcode2 -ne 0 ]; then
+ exit $exitcode2
+ fi
+ fi
+ exit 0
done
exit 0'''