Skip to content

Commit

Permalink
Update SQLite3 to 3.45.2 (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm authored Apr 30, 2024
1 parent 1e70b73 commit 749683c
Show file tree
Hide file tree
Showing 21 changed files with 324 additions and 139 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
if: matrix.os == 'macos-latest'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,IOS_ARM32,IOS_ARM64,IOS_X64,IOS_SIMULATOR_ARM64,MACOS_ARM64,MACOS_X64,TVOS_ARM64,TVOS_X64,TVOS_SIMULATOR_ARM64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_X64,WATCHOS_X86,WATCHOS_SIMULATOR_ARM64,WASM,WASM_32"
-PKMP_TARGETS="JVM,JS,IOS_ARM64,IOS_X64,IOS_SIMULATOR_ARM64,MACOS_ARM64,MACOS_X64,TVOS_ARM64,TVOS_X64,TVOS_SIMULATOR_ARM64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_X64,WATCHOS_SIMULATOR_ARM64,WASM_JS,WASM_WASI"
- name: Run macOS JVM Tests
if: matrix.os == 'macos-11'
run: >
Expand All @@ -62,7 +62,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="ANDROID,JVM,JS,ANDROID_ARM32,ANDROID_ARM64,ANDROID_X64,ANDROID_X86,LINUX_ARM32HFP,LINUX_ARM64,LINUX_MIPS32,LINUX_MIPSEL32,LINUX_X64,MINGW_X64,WASM,WASM_32"
-PKMP_TARGETS="JVM,JS,ANDROID,ANDROID_ARM32,ANDROID_ARM64,ANDROID_X64,ANDROID_X86,LINUX_ARM64,LINUX_X64,WASM_JS,WASM_WASI"
- name: Run Linux JVM Tests
if: matrix.os == 'ubuntu-20.04'
run: >
Expand All @@ -72,25 +72,30 @@ jobs:
if: matrix.os == 'windows-latest'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,MINGW_X64,MINGW_X86,WASM,WASM_32"
-PKMP_TARGETS="JVM,JS,MINGW_X64,WASM_JS,WASM_WASI"
- name: Run Windows JVM Tests
if: matrix.os == 'windows-2019'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM"
emulator:
runs-on: macos-latest
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
api-level: [ 21, 23, 26, 29 ]
arch: [ x86_64 ]
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

Expand All @@ -108,5 +113,4 @@ jobs:
with:
emulator-boot-timeout: 300 # 5 minutes
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
script: ./gradlew :library:driver-test:connectedCheck -PKMP_TARGETS="ANDROID,JVM"
1 change: 1 addition & 0 deletions external/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
libs/unsigned/
windows.pkcs11
Binary file modified external/libs/signed/Mac/aarch64/libsqlitejdbc.dylib
Binary file not shown.
Binary file modified external/libs/signed/Mac/x86_64/libsqlitejdbc.dylib
Binary file not shown.
Binary file modified external/libs/signed/Windows/x86/sqlitejdbc.dll
Binary file not shown.
Binary file modified external/libs/signed/Windows/x86_64/sqlitejdbc.dll
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From dff1aff518f418d1fc7c8a6945e0205d9f4dd14d Mon Sep 17 00:00:00 2001
From c9a4fe2e4148b0c995ef1f451fde702f64876e94 Mon Sep 17 00:00:00 2001
From: Matthew Nelson <[email protected]>
Date: Tue, 13 Feb 2024 05:29:33 -0500
Date: Tue, 30 Apr 2024 15:12:45 -0400
Subject: [PATCH 1/8] Add user/group ids to docker build

---
Expand Down
6 changes: 3 additions & 3 deletions external/patches/0002-Disable-double-quoted-strings.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 24788ad43d56e2b04d47cb933080cc954f58bea5 Mon Sep 17 00:00:00 2001
From 4e88a49fb39a28be71493d5cb3e4c4df90c6f58e Mon Sep 17 00:00:00 2001
From: Matthew Nelson <[email protected]>
Date: Tue, 13 Feb 2024 05:29:59 -0500
Date: Tue, 30 Apr 2024 15:12:46 -0400
Subject: [PATCH 2/8] Disable double-quoted strings

---
Expand Down Expand Up @@ -74,7 +74,7 @@ index ee2e77e..0a296b6 100644

PreparedStatement prep = conn.prepareStatement("select colid from tbl where col = ?");
diff --git a/src/test/java/org/sqlite/StatementTest.java b/src/test/java/org/sqlite/StatementTest.java
index ebb50ec..b81349c 100644
index 172a2f2..40b8a2b 100644
--- a/src/test/java/org/sqlite/StatementTest.java
+++ b/src/test/java/org/sqlite/StatementTest.java
@@ -108,7 +108,7 @@ public class StatementTest {
Expand Down
4 changes: 2 additions & 2 deletions external/patches/0003-Remove-JDBC-extensions.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From dc81e9dd4619647b1b2847d10bacab84f57bbc2a Mon Sep 17 00:00:00 2001
From baeea259e50db5971566a94447bd23a79d2dbe2e Mon Sep 17 00:00:00 2001
From: Matthew Nelson <[email protected]>
Date: Tue, 13 Feb 2024 05:30:41 -0500
Date: Tue, 30 Apr 2024 15:12:47 -0400
Subject: [PATCH 3/8] Remove JDBC extensions

---
Expand Down
4 changes: 2 additions & 2 deletions external/patches/0004-Add-Linux-Musl-definitions.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 9dc4e5d576627b0a7feed9be83e2b93cec5c91c1 Mon Sep 17 00:00:00 2001
From 885d5d84a00f8ecede915bd9897909931c8f09a8 Mon Sep 17 00:00:00 2001
From: Matthew Nelson <[email protected]>
Date: Tue, 13 Feb 2024 05:31:16 -0500
Date: Tue, 30 Apr 2024 15:12:48 -0400
Subject: [PATCH 4/8] Add Linux-Musl definitions

---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From f3a6ec20bf96efe0ab71cc0c455bd965badf7245 Mon Sep 17 00:00:00 2001
From 88f1d0b2a331dcd5de5a0f3ddcc9972d1382e0a7 Mon Sep 17 00:00:00 2001
From: Matthew Nelson <[email protected]>
Date: Tue, 13 Feb 2024 05:31:57 -0500
Date: Tue, 30 Apr 2024 15:12:48 -0400
Subject: [PATCH 5/8] Disable Windows arm & FreeBSD targets

---
Expand Down
4 changes: 2 additions & 2 deletions external/patches/0006-Disable-macOS-adhoc-signing.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From b3617cbba5daf2c8deca8f8a50c0ad2d3b24db1f Mon Sep 17 00:00:00 2001
From 7cebda56badb1f9f3bcfac842ed507d48278af61 Mon Sep 17 00:00:00 2001
From: Matthew Nelson <[email protected]>
Date: Tue, 13 Feb 2024 05:32:27 -0500
Date: Tue, 30 Apr 2024 15:12:49 -0400
Subject: [PATCH 6/8] Disable macOS adhoc signing

---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From b53066c79719c63bdc7554b438db043fba5fe688 Mon Sep 17 00:00:00 2001
From e0825ad20e009559a6d0739fce0ae4e703adfe3a Mon Sep 17 00:00:00 2001
From: Matthew Nelson <[email protected]>
Date: Tue, 13 Feb 2024 05:40:07 -0500
Date: Tue, 30 Apr 2024 15:12:50 -0400
Subject: [PATCH 7/8] Configure build to use SQLite3MultipleCiphers

---
Expand Down Expand Up @@ -209,12 +209,12 @@ index 0b374bf..c6e4ff0 100644
Windows-x86_64_LIBNAME := sqlitejdbc.dll
Windows-x86_64_SQLITE_FLAGS :=
diff --git a/VERSION b/VERSION
index d6a23d0..b404641 100644
index 06974d5..50b4e5b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1,2 @@
version=3.45.1
+version_mc=1.8.3
version=3.45.2
+version_mc=1.8.4
diff --git a/src/main/java/org/sqlite/core/NativeDB.c b/src/main/java/org/sqlite/core/NativeDB.c
index 7361dbc..17dab54 100644
--- a/src/main/java/org/sqlite/core/NativeDB.c
Expand Down
4 changes: 2 additions & 2 deletions external/patches/0008-Update-Docker-images.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 805055dfdff0b51770e43f4c1ececa4def8b0bc4 Mon Sep 17 00:00:00 2001
From 13b23d1c47ae3b028848b4b371029f6538726f7d Mon Sep 17 00:00:00 2001
From: Matthew Nelson <[email protected]>
Date: Tue, 13 Feb 2024 05:46:40 -0500
Date: Tue, 30 Apr 2024 15:12:51 -0400
Subject: [PATCH 8/8] Update Docker images

---
Expand Down
2 changes: 1 addition & 1 deletion external/sqlite-jdbc
Submodule sqlite-jdbc updated 31 files
+4 −5 .github/workflows/ci.yml
+36 −19 README.adoc
+31 −25 USAGE.md
+1 −1 VERSION
+7 −17 demo/Sample.java
+7 −14 pom.xml
+3 −3 src/main/java/org/sqlite/core/CoreStatement.java
+ src/main/resources/org/sqlite/native/FreeBSD/aarch64/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/FreeBSD/x86/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/FreeBSD/x86_64/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux-Android/aarch64/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux-Android/arm/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux-Android/x86/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux-Android/x86_64/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux-Musl/aarch64/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux-Musl/x86/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux-Musl/x86_64/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux/aarch64/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux/arm/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux/armv6/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux/armv7/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux/ppc64/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux/x86/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Linux/x86_64/libsqlitejdbc.so
+ src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.dylib
+ src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.dylib
+ src/main/resources/org/sqlite/native/Windows/aarch64/sqlitejdbc.dll
+ src/main/resources/org/sqlite/native/Windows/armv7/sqlitejdbc.dll
+ src/main/resources/org/sqlite/native/Windows/x86/sqlitejdbc.dll
+ src/main/resources/org/sqlite/native/Windows/x86_64/sqlitejdbc.dll
+2 −2 src/test/java/org/sqlite/StatementTest.java
43 changes: 29 additions & 14 deletions external/task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,22 @@ function sign:macos { ## Sign and notarize macOS libs. 2 ARGS - [1]: /path/to/ke
done
}

function sign:mingw { ## Sign Windows libs. 2 ARGS - [1]: /path/to/file.key [2]: /path/to/cert.cer
# shellcheck disable=SC2128
if [ $# -ne 2 ]; then
echo 1>&2 "Usage: $0 $FUNCNAME 2 ARGS - [1]: /path/to/file.key [2]: /path/to/cert.cer"
exit 3
fi

local file_key="$1"
local file_cert="$2"
__require:file_exists "$file_key"
__require:file_exists "$file_cert"
# shellcheck disable=SC2154
function sign:mingw { ## Sign Windows libs. (see windows.pkcs11.sample)
. "$DIR_SCRIPT/windows.pkcs11"

__require:file_exists "$gen_pkcs11engine_path" "windows.pkcs11[gen_pkcs11engine_path] file does not exist"
__require:file_exists "$gen_pkcs11module_path" "windows.pkcs11[gen_pkcs11module_path] file does not exist"
__require:var_set "$gen_model" "windows.pkcs11[gen_model] not set"
__require:var_set "$gen_manufacturer" "windows.pkcs11[gen_manufacturer] not set"
__require:var_set "$gen_serial" "windows.pkcs11[gen_serial] not set"
__require:var_set "$gen_ts" "windows.pkcs11[gen_ts] not set"
__require:file_exists "$gen_cert_path" "windows.pkcs11[gen_cert_path] file does not exist"
__require:var_set "$gen_id" "windows.pkcs11[gen_id] not set"
__require:cmd "$OSSLSIGNCODE" "osslsigncode"

local pkcs11_url="pkcs11:model=$gen_model;manufacturer=$gen_manufacturer;serial=$gen_serial;id=$gen_id;type=private"

mkdir -p "$DIR_SIGNED"
rm -rf "$DIR_SIGNED/Windows"
trap 'rm -rf "$DIR_SIGNED/Windows"' SIGINT ERR
Expand All @@ -147,9 +150,12 @@ function sign:mingw { ## Sign Windows libs. 2 ARGS - [1]: /path/to/fi

mkdir -p "$DIR_SIGNED/Windows/$arch_name"

${OSSLSIGNCODE} sign -certs "$file_cert" \
-key "$file_key" \
-t "http://timestamp.comodoca.com" \
${OSSLSIGNCODE} sign \
-pkcs11engine "$gen_pkcs11engine_path" \
-pkcs11module "$gen_pkcs11module_path" \
-key "$pkcs11_url" \
-certs "$gen_cert_path" \
-ts "$gen_ts" \
-in "$dir_arch/sqlitejdbc.dll" \
-out "$DIR_SIGNED/Windows/$arch_name/sqlitejdbc.dll"
done
Expand Down Expand Up @@ -212,6 +218,15 @@ function __require:cmd {
exit 3
}

function __require:var_set {
if [ -n "$1" ]; then
return 0
fi

echo 1>&2 "ERROR: $2 is required to run this script"
exit 3
}

function __require:file_exists {
if [ -f "$1" ]; then
return 0
Expand Down
34 changes: 34 additions & 0 deletions external/windows.pkcs11.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Environment variables for code signing windows binaries
# using pkcs11 + HSM + osslsigncode via task "sign:mingw"
#
# 1. Copy this file to external/codesign/windows.pkcs11
# 2. complete TODO
# 3. apt install osslsigncode libengine-pkcs11-openssl ykcs11
# 4. ./external/task.sh sign:mingw
#
# All variables are prefixed with "gen_" to ensure no
# clashes with system environment variables occur.

# Path to the pkcs11 engine (e.g. "/usr/lib/x86_64-linux-gnu/engines-3/pkcs11.so")
gen_pkcs11engine_path="TODO"

# Path to the pkcs11 module (e.g. "/usr/lib/x86_64-linux-gnu/libykcs11.so")
gen_pkcs11module_path="TODO"

# The HSM Model (e.g. "YubiKey%20YK5")
gen_model="TODO"

# The HSM Manufacturer (e.g. "Yubico%20(www.yubico.com)")
gen_manufacturer="TODO"

# The HSM Serial (e.g. "123456")
gen_serial="TODO"

# The timestamping server url (e.g. "http://ts.ssl.com")
gen_ts="TODO"

# The absolute path to the .crt (e.g. "/home/matt/path/to/my_cert.pem")
gen_cert_path="TODO"

# Change if not slot 1
gen_id="%01"
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ okio = "3.7.0"

sql-delight-dialect = "sqlite-3-38-dialect"
sql-delight = "2.0.1"
sql-jdbc-xerial = "3.45.1.0"
sql-jdbc-xerial = "3.45.2.0"
slf4j = "1.7.36"

[libraries]
Expand Down
Loading

0 comments on commit 749683c

Please sign in to comment.