Skip to content

Commit 20cd913

Browse files
anyasabocursoragent
andcommitted
fix: use correct TFLite library path for ARM64 in lint task
Same bug as check-tflite-lib: the lint task unconditionally used /usr/lib for all Linux hosts, but ARM64 needs SYSTEM_LIB_DIR_ARM64 (/usr/aarch64-linux-gnu/lib). Switch to a case statement matching both aarch64 and arm64 uname variants. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d5948f4 commit 20cd913

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

Taskfile.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,14 @@ tasks:
6767
desc: Run golangci-lint with TensorFlow CGO flags
6868
cmds:
6969
- |
70-
# Determine library path based on OS
71-
if [ "{{.UNAME_S}}" = "Darwin" ]; then
72-
if [ "{{.UNAME_M}}" = "arm64" ]; then
73-
LIB_DIR="/opt/homebrew/lib"
74-
else
75-
LIB_DIR="/usr/local/lib"
76-
fi
77-
else
78-
LIB_DIR="/usr/lib"
79-
fi
70+
# Determine library path based on OS and architecture
71+
case "{{.UNAME_S}}_{{.UNAME_M}}" in
72+
Darwin_arm64) LIB_DIR="/opt/homebrew/lib";;
73+
Darwin_*) LIB_DIR="/usr/local/lib";;
74+
Linux_aarch64|Linux_arm64) LIB_DIR="{{.SYSTEM_LIB_DIR_ARM64}}";;
75+
Linux_*) LIB_DIR="{{.SYSTEM_LIB_DIR_AMD64}}";;
76+
*) echo "unsupported platform: {{.UNAME_S}}_{{.UNAME_M}}" >&2; exit 1;;
77+
esac
8078
# Use noembed,skipfrontend tags to skip model and frontend embedding for faster linting
8179
{{.CGO_FLAGS}} CGO_LDFLAGS="-L${LIB_DIR} -ltensorflowlite_c" \
8280
golangci-lint run --build-tags=noembed,skipfrontend {{.CLI_ARGS}}

0 commit comments

Comments
 (0)