Skip to content

llama/pom.xml: write JNI headers relative to the module, not the cwd - #452

Merged
bernardladenthin merged 1 commit into
mainfrom
fix-jni-header-path
Sep 21, 2026
Merged

bernardladenthin merged 1 commit into
mainfrom
fix-jni-header-path

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Problem

The 16 classifier-profile compile executions in llama/pom.xml pass -h src/main/cpp. javac resolves that against the process working directory, not the module. Building the core from the repository root — e.g. mvn -pl llama -am install -P vulkan-windows, the local recipe for installing a snapshot with GPU natives — writes net_ladenthin_llama_*.h into ./src/main/cpp at the root: untracked files outside the module, instead of llama/src/main/cpp, where .gitignore (llama/src/main/cpp/net_ladenthin_llama_*.h) expects them. Building from inside llama/ happened to work, which is why CI never noticed.

Fix

<arg>src/main/cpp</arg><arg>${project.basedir}/src/main/cpp</arg> in all 16 executions. No other change.

Verified

From the repository root on Windows 11: mvn -pl llama -am clean compile -P vulkan-windows puts all five headers into llama/src/main/cpp/ and no ./src is created; git status shows only llama/pom.xml.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E2h8gXyyE5UeimkL9vQv9G

The 16 classifier-profile compile executions (cuda, opencl-android,
windows-msvc, vulkan-*, rocm-*, sycl-*, openvino-*, ...) passed `-h src/main/cpp`,
which javac resolves against the process working directory. Building the core
from the repository root (`mvn -pl llama -am ... -P vulkan-windows`) therefore
wrote net_ladenthin_llama_*.h into ./src/main/cpp at the root -- untracked files
outside the module -- instead of llama/src/main/cpp, where .gitignore expects
them. They now use ${project.basedir}/src/main/cpp.

Verified: `mvn -pl llama -am clean compile -P vulkan-windows` from the root puts
all five headers into llama/src/main/cpp and creates no ./src.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2h8gXyyE5UeimkL9vQv9G
@bernardladenthin
bernardladenthin merged commit 438f831 into main Sep 21, 2026
7 of 14 checks passed
@bernardladenthin
bernardladenthin deleted the fix-jni-header-path branch September 21, 2026 22:02

This branch had an error being deployed

1 failed deployment
maven-central c55a2fbc Deployed Sep 21, 2026 by bernardladenthin via Verify GPG signing key (no secrets printed) #994
startgate c55a2fbc Deployed Sep 21, 2026 by bernardladenthin via Start gate (abort window) #994
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant