Skip to content

Commit c6bb70d

Browse files
committed
Fix Android aarch64 build and suppress Maven download progress
Three changes: 1. Bump Android platform from API 24 to API 28 (CMakeLists.txt and publish.yml). mtmd-helper.cpp includes vendor/sheredom/subprocess.h which calls posix_spawn* / posix_spawn_file_actions_*; these symbols are available in the NDK libc at all API levels but their <spawn.h> declarations are only exposed when __ANDROID_API__ >= 28. API 24 was enough for getifaddrs; API 28 is required to compile mtmd-helper.cpp. Both Android build jobs (CPU-only and OpenCL/Adreno) are updated. 2. Update CMakeLists.txt comment to document why API 28 is needed (__ANDROID_API__ now gates both getifaddrs and posix_spawn*). 3. Add --no-transfer-progress to the four mvn compile steps that were missing it on macOS / Linux native build jobs and to both publish (snapshot + release) deploy steps, eliminating the verbose per-chunk download progress lines from CI logs. Note: The NotJavadoc compile error on macOS and Ubuntu was already fixed by commit 8932fd8 (removing the orphaned duplicate Javadoc block before completeBatch). This commit does not touch that check. https://claude.ai/code/session_01RcJfwgM2cfjd3n5A8JrGqe
1 parent 20e734b commit c6bb70d

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

.github/workflows/publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
- name: Build libraries
165165
shell: bash
166166
run: |
167-
.github/dockcross/dockcross-android-arm64 .github/build.sh "-DANDROID_PLATFORM=android-24 -DOS_NAME=Linux-Android -DOS_ARCH=aarch64"
167+
.github/dockcross/dockcross-android-arm64 .github/build.sh "-DANDROID_PLATFORM=android-28 -DOS_NAME=Linux-Android -DOS_ARCH=aarch64"
168168
- name: Upload artifacts
169169
uses: actions/upload-artifact@v7
170170
with:
@@ -180,7 +180,7 @@ jobs:
180180
- name: Build libraries
181181
shell: bash
182182
run: |
183-
.github/dockcross/dockcross-android-arm64 .github/build_opencl_android.sh "-DANDROID_PLATFORM=android-24 -DOS_NAME=Linux-Android -DOS_ARCH=aarch64 -DGGML_OPENCL=ON -DGGML_OPENCL_EMBED_KERNELS=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON"
183+
.github/dockcross/dockcross-android-arm64 .github/build_opencl_android.sh "-DANDROID_PLATFORM=android-28 -DOS_NAME=Linux-Android -DOS_ARCH=aarch64 -DGGML_OPENCL=ON -DGGML_OPENCL_EMBED_KERNELS=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON"
184184
- name: Upload artifacts
185185
uses: actions/upload-artifact@v7
186186
with:
@@ -212,7 +212,7 @@ jobs:
212212
- name: Build libraries
213213
shell: bash
214214
run: |
215-
mvn compile
215+
mvn --no-transfer-progress compile
216216
.github/build.sh -DLLAMA_METAL=OFF -DGGML_NATIVE=OFF -DBUILD_TESTING=ON
217217
- name: Run C++ unit tests
218218
run: ctest --test-dir build --output-on-failure
@@ -243,7 +243,7 @@ jobs:
243243
- name: Build libraries
244244
shell: bash
245245
run: |
246-
mvn compile
246+
mvn --no-transfer-progress compile
247247
.github/build.sh -DLLAMA_METAL_EMBED_LIBRARY=ON -DBUILD_TESTING=ON
248248
- name: Run C++ unit tests
249249
run: ctest --test-dir build --output-on-failure
@@ -334,7 +334,7 @@ jobs:
334334
cat /proc/cpuinfo
335335
- name: Build libraries
336336
run: |
337-
mvn -q compile
337+
mvn -q --no-transfer-progress compile
338338
.github/build.sh -DBUILD_TESTING=ON
339339
- name: Run C++ unit tests
340340
run: ctest --test-dir build --output-on-failure
@@ -360,7 +360,7 @@ jobs:
360360
- name: Build libraries
361361
shell: bash
362362
run: |
363-
mvn compile
363+
mvn --no-transfer-progress compile
364364
.github/build.sh -DLLAMA_METAL_EMBED_LIBRARY=ON -DGGML_NATIVE=OFF -DBUILD_TESTING=ON
365365
- name: Run C++ unit tests
366366
run: ctest --test-dir build --output-on-failure
@@ -873,7 +873,7 @@ jobs:
873873
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
874874
gpg-passphrase: MAVEN_GPG_PASSPHRASE
875875
- name: Publish snapshot
876-
run: mvn --batch-mode -P release,cuda,opencl-android -Dmaven.test.skip=true deploy
876+
run: mvn --batch-mode --no-transfer-progress -P release,cuda,opencl-android -Dmaven.test.skip=true deploy
877877
env:
878878
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
879879
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
@@ -948,7 +948,7 @@ jobs:
948948
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
949949
gpg-passphrase: MAVEN_GPG_PASSPHRASE
950950
- name: Publish release
951-
run: mvn --batch-mode -P release,cuda,opencl-android -Dmaven.test.skip=true deploy
951+
run: mvn --batch-mode --no-transfer-progress -P release,cuda,opencl-android -Dmaven.test.skip=true deploy
952952
env:
953953
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
954954
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Three places wire it together (mirrors the CUDA classifier pattern):
6262
Local sanity build:
6363
```bash
6464
.github/dockcross/dockcross-android-arm64 .github/build_opencl_android.sh \
65-
"-DANDROID_PLATFORM=android-24 -DOS_NAME=Linux-Android -DOS_ARCH=aarch64 \
65+
"-DANDROID_PLATFORM=android-28 -DOS_NAME=Linux-Android -DOS_ARCH=aarch64 \
6666
-DGGML_OPENCL=ON -DGGML_OPENCL_EMBED_KERNELS=ON \
6767
-DGGML_OPENCL_USE_ADRENO_KERNELS=ON"
6868
```

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_L
4747
link_libraries(stdc++fs)
4848
endif()
4949

50-
# Android standalone toolchains default to API level 21, but cpp-httplib uses
51-
# getifaddrs/freeifaddrs which are only declared in <ifaddrs.h> when
52-
# __ANDROID_API__ >= 24. NDK unified sysroots (r14b+) include the symbol in
53-
# libc regardless of level; this exposes the declaration for all targets.
50+
# Android NDK headers gate symbols on __ANDROID_API__:
51+
# >= 24: getifaddrs/freeifaddrs (<ifaddrs.h>), needed by cpp-httplib.
52+
# >= 28: posix_spawn / posix_spawnp / posix_spawn_file_actions_* (<spawn.h>),
53+
# needed by mtmd-helper.cpp (vendor/sheredom/subprocess.h).
54+
# NDK unified sysroots (r14b+) include all these symbols in libc regardless of
55+
# level; the define only controls which declarations are visible in the headers.
5456
if(ANDROID_ABI)
55-
add_compile_definitions(__ANDROID_API__=24)
57+
add_compile_definitions(__ANDROID_API__=28)
5658
endif()
5759

5860
set(LLAMA_BUILD_COMMON ON)

0 commit comments

Comments
 (0)