This is an automated email from the ASF dual-hosted git repository.
mehrdadh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 6dbdf2e201 Fix Hexagon build using ci.py (#11304)
6dbdf2e201 is described below
commit 6dbdf2e20116ecc6f5379f5cb430ed023ff0d62b
Author: Mehrdad Hessar <[email protected]>
AuthorDate: Fri Jun 3 14:22:05 2022 -0700
Fix Hexagon build using ci.py (#11304)
* Add output directory
add post build for hexagon
fix -net=host for docker
* remove --net by default
---
tests/scripts/ci.py | 6 +++++-
tests/scripts/task_build_hexagon_api.sh | 16 ++++++++++------
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/tests/scripts/ci.py b/tests/scripts/ci.py
index b3f9cb6500..599bbaddce 100755
--- a/tests/scripts/ci.py
+++ b/tests/scripts/ci.py
@@ -342,6 +342,7 @@ def generate_command(
options: Dict[str, Option],
help: str,
precheck: Optional[Callable[[], None]] = None,
+ post_build: Optional[List[str]] = None,
):
"""
Helper to generate CLIs that:
@@ -378,6 +379,9 @@ def generate_command(
f"./tests/scripts/task_build.py --build-dir
{get_build_dir(name)}",
]
+ if post_build is not None:
+ scripts += post_build
+
# Check that a test suite was not used alongside specific test names
if any(v for v in kwargs.values()) and tests is not None:
option_flags = ", ".join([f"--{k}" for k in options.keys()])
@@ -624,12 +628,12 @@ generated = [
generate_command(
name="hexagon",
help="Run Hexagon build and test(s)",
+ post_build=["./tests/scripts/task_build_hexagon_api.sh --output
build-hexagon"],
options={
"cpp": CPP_UNITTEST,
"test": (
"run Hexagon API/Python tests",
[
- "./tests/scripts/task_build_hexagon_api.sh",
"./tests/scripts/task_python_hexagon.sh",
],
),
diff --git a/tests/scripts/task_build_hexagon_api.sh
b/tests/scripts/task_build_hexagon_api.sh
index 4c7b4f396c..5f811e4e27 100755
--- a/tests/scripts/task_build_hexagon_api.sh
+++ b/tests/scripts/task_build_hexagon_api.sh
@@ -19,6 +19,15 @@
set -e
set -u
+output_directory_parent=$(realpath ${PWD}/build)
+if [ $# -ge 1 ] && [[ "$1" == "--output" ]]; then
+ shift 1
+ output_directory_parent=$(realpath $1)
+ shift 1
+fi
+output_directory="${output_directory_parent}/hexagon_api_output"
+rm -rf ${output_directory}
+
use_cache=false
if [ $# -ge 1 ] && [[ "$1" == "--use-cache" ]]; then
use_cache=true
@@ -26,24 +35,19 @@ if [ $# -ge 1 ] && [[ "$1" == "--use-cache" ]]; then
fi
cd apps/hexagon_api
-
if [ "$use_cache" = false ]; then
rm -rf build
fi
-
mkdir -p build
cd build
-output_binary_directory=$(realpath ${PWD}/../../../build/hexagon_api_output)
-rm -rf ${output_binary_directory}
-
cmake -DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-28 \
-DUSE_ANDROID_TOOLCHAIN="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake"
\
-DUSE_HEXAGON_ARCH=v68 \
-DUSE_HEXAGON_SDK="${HEXAGON_SDK_ROOT}" \
-DUSE_HEXAGON_TOOLCHAIN="${HEXAGON_TOOLCHAIN}" \
- -DUSE_OUTPUT_BINARY_DIR="${output_binary_directory}" \
+ -DUSE_OUTPUT_BINARY_DIR="${output_directory}" \
-DUSE_HEXAGON_GTEST="${HEXAGON_SDK_ROOT}/utils/googletest/gtest" ..
make -j$(nproc)