Commit e545435
Vendor OSInfo from xerial/sqlite-jdbc with Apache-2.0 license (#171)
* Replace OSInfo with 1:1 vendored copy from xerial/sqlite-jdbc
OSInfo originated in snappy-java (Taro L. Saito, 2008) and was carried
into this project via kherud/java-llama.cpp. The most actively
maintained copy of the same class today lives in xerial/sqlite-jdbc
(same author/org, last touched April 2026 with Android fixes, plus
~16 commits 2020-2026 including RISCV64, isMusl(), and several Android
refinements).
Supersedes prior local edits: the REUSE MIT rewrite (#149), the
typo fix (#166), and the SonarQube InterruptedException re-interrupt
fix (#170) on OSInfo are all rolled back in favour of a true verbatim
resync. Only deviations from the upstream file:
1. package org.sqlite.util -> package net.ladenthin.llama
2. system property "org.sqlite.osinfo.architecture"
-> "net.ladenthin.llama.osinfo.architecture"
Both deviations are documented in the per-file header. The original
Apache-2.0 boilerplate is preserved verbatim. Per-file SPDX-License-
Identifier is Apache-2.0; the project remains MIT overall.
Same-package helpers (Logger, LoggerFactory, AndroidSignatureIgnore)
are vendored alongside, each carrying their own SPDX-FileCopyrightText
lines drawn from git log of the sqlite-jdbc repo. LoggerFactory uses
SLF4J when present and falls back to java.util.logging otherwise, so
slf4j-api is declared <optional>true</optional> in pom.xml at 2.0.18
(latest stable as of Maven Central metadata 2026-05-12).
LICENSES/Apache-2.0.txt added so reuse lint stays green
(140/140 files compliant with REUSE 3.3).
Verified:
- mvn clean compile: BUILD SUCCESS
- mvn test -Dtest=OSInfoTest: 16/16 pass
- mvn test -Dtest=LlamaLoaderTest: BUILD SUCCESS
- reuse lint: compliant with REUSE 3.3
* Drop vendored Logger/LoggerFactory wrapper; use SLF4J + Logback directly
The OSInfo resync from xerial/sqlite-jdbc brought a same-package
Logger / LoggerFactory pair that re-implemented a tiny SLF4J facade.
For this project that wrapper is dead weight: depending on slf4j-api
directly and shipping logback-classic at runtime scope gives the same
behaviour with no hand-maintained code.
Changes:
- Delete src/main/java/net/ladenthin/llama/Logger.java
- Delete src/main/java/net/ladenthin/llama/LoggerFactory.java
- OSInfo.java: import org.slf4j.Logger / org.slf4j.LoggerFactory
directly. Drop the Supplier<String> lazy form at the two
LogHolder.logger call sites in getHardwareName() and
resolveArmArchType() (both messages are constant strings, so eager
construction is free). Header comment lists this as a third
documented deviation from the upstream sqlite-jdbc file.
- pom.xml: slf4j-api 2.0.18 -> non-optional (compile). Add
logback-classic 1.5.32 at runtime scope as the default binding.
AndroidSignatureIgnore.java is kept as-is — it is a marker annotation,
not a logging shim, and removing it would add a 4th deviation from
upstream for no gain.
Verified:
- mvn clean compile: BUILD SUCCESS
- mvn test -Dtest=OSInfoTest,LlamaLoaderTest: 37/37 pass
- mvn dependency:tree: slf4j-api:compile, logback-classic:runtime,
logback-core:runtime (transitive). No duplicate binding.
- reuse lint: 138/138 files compliant with REUSE 3.3.
* Replace custom AndroidSignatureIgnore with standard @IgnoreJRERequirement
sqlite-jdbc's AndroidSignatureIgnore was a custom marker annotation
that only had meaning when their pom.xml configured the
animal-sniffer-maven-plugin with
<annotation>org.sqlite.util.AndroidSignatureIgnore</animation>. This
project does not configure animal-sniffer, so the vendored copy of
the annotation was inert.
Replaced with the standard @IgnoreJRERequirement from
org.codehaus.mojo:animal-sniffer-annotations 1.27 (latest stable).
The plugin recognises this annotation out of the box, so if signature
checking is ever enabled here it will work with zero further config.
Changes:
- pom.xml: add animal-sniffer-annotations 1.27, scope=provided
(retention=CLASS, not needed at runtime).
- Delete src/main/java/net/ladenthin/llama/AndroidSignatureIgnore.java
- OSInfo.java:
* Import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement.
* Replace the three @AndroidSignatureIgnore(explanation = "Should
not reach this code path") sites in isMusl, toRealPathOrEmpty,
and isAlpineLinux with @IgnoreJRERequirement plus a one-line //
comment preserving the explanation (the standard annotation has
no explanation field).
* Header lists this as a 4th documented deviation from upstream.
Verified:
- mvn clean compile: BUILD SUCCESS
- mvn test -Dtest=OSInfoTest,LlamaLoaderTest: 37/37 pass
- reuse lint: 137/137 files compliant with REUSE 3.3.
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b8e5d7b commit e545435
3 files changed
Lines changed: 434 additions & 270 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
76 | 99 | | |
77 | 100 | | |
78 | 101 | | |
| |||
0 commit comments