Skip to content

Commit

Permalink
Implement a JNI wrapper around SQLite.
Browse files Browse the repository at this point in the history
This will be used by the implementation of garbage collection for the disk cache, as discussed in #5139 and the linked design doc. I judge this to be preferred over https://github.com/xerial/sqlite-jdbc for the following reasons:

1. It's a much smaller dependency.
2. The JDBC API is too generic and becomes awkward to use when dealing with the peculiarities of SQLite.
3. We can (more easily) compile it from source for all host platforms, including the BSDs.

PiperOrigin-RevId: 628046749
Change-Id: I17bd0547876df460f48af24944d3f7327069375f
  • Loading branch information
tjgq authored and copybara-github committed Apr 25, 2024
1 parent 91d08ed commit 8ef7b70
Show file tree
Hide file tree
Showing 11 changed files with 1,031 additions and 33 deletions.
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ bazel_dep(name = "rules_pkg", version = "0.9.1")
bazel_dep(name = "stardoc", version = "0.5.6", repo_name = "io_bazel_skydoc")
bazel_dep(name = "zstd-jni", version = "1.5.2-3.bcr.1")
bazel_dep(name = "blake3", version = "1.3.3.bcr.1")
bazel_dep(name = "sqlite3", version = "3.42.0.bcr.1")
bazel_dep(name = "zlib", version = "1.3")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_java", version = "7.5.0")
Expand Down
111 changes: 79 additions & 32 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ DIST_ARCHIVE_REPOS = [get_canonical_repo_name(repo) for repo in [
"rules_pkg",
"rules_proto",
"rules_python",
"sqlite3",
"upb",
"zlib",
"zstd-jni",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ java_library(
srcs = glob(["*.java"]),
deps = [
"//src/main/java/com/google/devtools/build/lib/exec:spawn_runner",
"//src/main/java/com/google/devtools/build/lib/jni",
"//src/main/java/com/google/devtools/build/lib/remote:store",
"//src/main/java/com/google/devtools/build/lib/remote/common",
"//src/main/java/com/google/devtools/build/lib/remote/common:cache_not_found_exception",
Expand Down
Loading

0 comments on commit 8ef7b70

Please sign in to comment.