Skip to content

Commit 6dbdf2e

Browse files
authored
Fix Hexagon build using ci.py (#11304)
* Add output directory add post build for hexagon fix -net=host for docker * remove --net by default
1 parent 8823757 commit 6dbdf2e

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

tests/scripts/ci.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ def generate_command(
342342
options: Dict[str, Option],
343343
help: str,
344344
precheck: Optional[Callable[[], None]] = None,
345+
post_build: Optional[List[str]] = None,
345346
):
346347
"""
347348
Helper to generate CLIs that:
@@ -378,6 +379,9 @@ def fn(
378379
f"./tests/scripts/task_build.py --build-dir {get_build_dir(name)}",
379380
]
380381

382+
if post_build is not None:
383+
scripts += post_build
384+
381385
# Check that a test suite was not used alongside specific test names
382386
if any(v for v in kwargs.values()) and tests is not None:
383387
option_flags = ", ".join([f"--{k}" for k in options.keys()])
@@ -624,12 +628,12 @@ def add_subparser(
624628
generate_command(
625629
name="hexagon",
626630
help="Run Hexagon build and test(s)",
631+
post_build=["./tests/scripts/task_build_hexagon_api.sh --output build-hexagon"],
627632
options={
628633
"cpp": CPP_UNITTEST,
629634
"test": (
630635
"run Hexagon API/Python tests",
631636
[
632-
"./tests/scripts/task_build_hexagon_api.sh",
633637
"./tests/scripts/task_python_hexagon.sh",
634638
],
635639
),

tests/scripts/task_build_hexagon_api.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,35 @@
1919
set -e
2020
set -u
2121

22+
output_directory_parent=$(realpath ${PWD}/build)
23+
if [ $# -ge 1 ] && [[ "$1" == "--output" ]]; then
24+
shift 1
25+
output_directory_parent=$(realpath $1)
26+
shift 1
27+
fi
28+
output_directory="${output_directory_parent}/hexagon_api_output"
29+
rm -rf ${output_directory}
30+
2231
use_cache=false
2332
if [ $# -ge 1 ] && [[ "$1" == "--use-cache" ]]; then
2433
use_cache=true
2534
shift 1
2635
fi
2736

2837
cd apps/hexagon_api
29-
3038
if [ "$use_cache" = false ]; then
3139
rm -rf build
3240
fi
33-
3441
mkdir -p build
3542
cd build
3643

37-
output_binary_directory=$(realpath ${PWD}/../../../build/hexagon_api_output)
38-
rm -rf ${output_binary_directory}
39-
4044
cmake -DANDROID_ABI=arm64-v8a \
4145
-DANDROID_PLATFORM=android-28 \
4246
-DUSE_ANDROID_TOOLCHAIN="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" \
4347
-DUSE_HEXAGON_ARCH=v68 \
4448
-DUSE_HEXAGON_SDK="${HEXAGON_SDK_ROOT}" \
4549
-DUSE_HEXAGON_TOOLCHAIN="${HEXAGON_TOOLCHAIN}" \
46-
-DUSE_OUTPUT_BINARY_DIR="${output_binary_directory}" \
50+
-DUSE_OUTPUT_BINARY_DIR="${output_directory}" \
4751
-DUSE_HEXAGON_GTEST="${HEXAGON_SDK_ROOT}/utils/googletest/gtest" ..
4852

4953
make -j$(nproc)

0 commit comments

Comments
 (0)