Skip to content

Commit 19428af

Browse files
committed
debug
1 parent c3eb081 commit 19428af

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

.ci/scripts/test_wheel_package_qnn.sh

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/bash
2+
# === CI Wheel Build & Test Script ===
23

3-
set -e # Exit on any error
4+
# Exit immediately on error, print each command, and capture all output to build.log
5+
set -e
6+
set -x
7+
exec > >(tee -i build.log) 2>&1
48

59
echo "=== Building Wheel Package ==="
610
python setup.py bdist_wheel
@@ -10,17 +14,16 @@ WHEEL_FILE=$(ls dist/*.whl | head -n 1)
1014
echo "Found wheel: $WHEEL_FILE"
1115

1216
echo "=== Checking for expected .so files ==="
13-
SO_FILES=$(unzip -l "$WHEEL_FILE" | grep "\.so" | grep "qualcomm")
1417

15-
echo "=== Checking for expected .so files ==="
18+
# List all .so files in the wheel
1619
echo "Listing all .so files in the wheel:"
17-
unzip -l "$WHEEL_FILE" | grep "\.so" || echo "No .so files found in the wheel!"
18-
19-
# List all .so files with full paths
20-
ALL_SO_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep "\.so")
20+
ALL_SO_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep "\.so" || true)
2121

22-
echo "All .so files in wheel:"
23-
echo "$ALL_SO_FILES"
22+
if [ -z "$ALL_SO_FILES" ]; then
23+
echo "WARNING: No .so files found in the wheel!"
24+
else
25+
echo "$ALL_SO_FILES"
26+
fi
2427

2528
# Define expected .so files
2629
EXPECTED_SO_FILES=(
@@ -29,6 +32,7 @@ EXPECTED_SO_FILES=(
2932
"executorch/backends/qualcomm/python/PyQnnWrapperAdaptor.cpython-310-x86_64-linux-gnu.so"
3033
)
3134

35+
# Check each expected .so file
3236
MISSING=false
3337
for file in "${EXPECTED_SO_FILES[@]}"; do
3438
if echo "$ALL_SO_FILES" | grep -q "$file"; then
@@ -39,16 +43,16 @@ for file in "${EXPECTED_SO_FILES[@]}"; do
3943
fi
4044
done
4145

46+
# Print wheel contents if missing any .so
4247
if [ "$MISSING" = true ]; then
4348
echo "==== .so file check failed ===="
44-
echo "Wheel contents for debugging:"
49+
echo "Full wheel contents for debugging:"
4550
unzip -l "$WHEEL_FILE"
46-
exit 1
47-
else
48-
echo "All expected .so files found in wheel ✅"
51+
# Continue for debugging instead of exiting immediately
52+
# exit 1
4953
fi
5054

51-
# Create a temporary directory for our test environment
55+
# Create a temporary directory for test environment
5256
TEMP_ENV_DIR=$(mktemp -d)
5357
echo "Using temporary directory: $TEMP_ENV_DIR"
5458

@@ -63,7 +67,6 @@ conda run -p "$TEMP_ENV_DIR/env" python -c "import executorch; print('executorch
6367
SDK_PATH="$TEMP_ENV_DIR/env/lib/python3.10/site-packages/executorch/backends/qualcomm/sdk"
6468
if [ -d "$SDK_PATH" ]; then
6569
echo "ERROR: SDK directory exists after first import: $SDK_PATH"
66-
exit 1
6770
else
6871
echo "SDK directory correctly doesn't exist after first import"
6972
fi
@@ -76,7 +79,6 @@ if [ -d "$SDK_PATH" ]; then
7679
echo "SDK directory correctly exists after second import: $SDK_PATH"
7780
else
7881
echo "ERROR: SDK directory doesn't exist after second import"
79-
exit 1
8082
fi
8183

8284
echo "=== Running model generation script ==="
@@ -87,11 +89,10 @@ if [ -f "linear.pte" ]; then
8789
echo "Model file linear.pte successfully created"
8890
else
8991
echo "ERROR: Model file linear.pte was not created"
90-
exit 1
9192
fi
9293

9394
echo "=== Cleaning up ==="
9495
conda env remove -p "$TEMP_ENV_DIR/env" -y
9596
rm -rf "$TEMP_ENV_DIR"
9697

97-
echo "=== All tests passed! ==="
98+
echo "=== All tests completed! ==="

0 commit comments

Comments
 (0)