Build the visions server, with a patch to rusqlite_migrations
Some checks failed
Monorepo build / build-flake (push) Has been cancelled

This commit is contained in:
2026-01-23 15:17:03 -05:00
parent 53c3ce281b
commit edee93777c
7 changed files with 216 additions and 75 deletions

59
Cargo.lock generated
View File

@@ -988,9 +988,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "foldhash"
version = "0.1.5"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "foreign-types"
@@ -1929,26 +1929,20 @@ dependencies = [
[[package]]
name = "hashbrown"
version = "0.15.5"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
dependencies = [
"foldhash",
]
[[package]]
name = "hashbrown"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
[[package]]
name = "hashlink"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230"
dependencies = [
"hashbrown 0.15.5",
"hashbrown",
]
[[package]]
@@ -2288,7 +2282,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
dependencies = [
"equivalent",
"hashbrown 0.16.1",
"hashbrown",
]
[[package]]
@@ -2435,9 +2429,9 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
[[package]]
name = "libsqlite3-sys"
version = "0.35.0"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f"
checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a"
dependencies = [
"pkg-config",
"vcpkg",
@@ -3189,10 +3183,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746"
[[package]]
name = "rusqlite"
version = "0.37.0"
name = "rsqlite-vfs"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "165ca6e57b20e1351573e3729b958bc62f0e48025386970b6e4d29e7a7e71f3f"
checksum = "a8a1f2315036ef6b1fbacd1972e8ee7688030b0a2121edfc2a6550febd41574d"
dependencies = [
"hashbrown",
"thiserror 2.0.18",
]
[[package]]
name = "rusqlite"
version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3"
dependencies = [
"bitflags 2.10.0",
"fallible-iterator",
@@ -3200,13 +3204,14 @@ dependencies = [
"hashlink",
"libsqlite3-sys",
"smallvec",
"sqlite-wasm-rs",
]
[[package]]
name = "rusqlite_migration"
version = "2.3.0"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fc9767ae49274bafd3e55be9d30405a033b7a59548327d87fd4971fbb58e264"
checksum = "08e45ef6076d02cdc5b6daa61999bb6a90d7a2e256c178c31ab903d5023f1493"
dependencies = [
"log",
"rusqlite",
@@ -3567,6 +3572,18 @@ dependencies = [
"windows-sys 0.60.2",
]
[[package]]
name = "sqlite-wasm-rs"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f4206ed3a67690b9c29b77d728f6acc3ce78f16bf846d83c94f76400320181b"
dependencies = [
"cc",
"js-sys",
"rsqlite-vfs",
"wasm-bindgen",
]
[[package]]
name = "stable_deref_trait"
version = "1.2.1"

140
Cargo.nix
View File

@@ -3279,9 +3279,9 @@ rec {
};
"foldhash" = rec {
crateName = "foldhash";
version = "0.1.5";
version = "0.2.0";
edition = "2021";
sha256 = "1wisr1xlc2bj7hk4rgkcjkz3j2x4dhd1h9lwk7mj8p71qpdgbi6r";
sha256 = "1nvgylb099s11xpfm1kn2wcsql080nqmnhj1l25bp3r2b35j9kkp";
authors = [
"Orson Peters <orsonpeters@gmail.com>"
];
@@ -6546,11 +6546,11 @@ rec {
"std" = [ "alloc" ];
};
};
"hashbrown 0.15.5" = rec {
"hashbrown" = rec {
crateName = "hashbrown";
version = "0.15.5";
version = "0.16.1";
edition = "2021";
sha256 = "189qaczmjxnikm9db748xyhiw04kpmhm9xj9k9hg0sgx7pjwyacj";
sha256 = "004i3njw38ji3bzdp9z178ba9x3k0c1pgy8x69pj7yfppv4iq7c4";
authors = [
"Amanieu d'Antras <amanieu@gmail.com>"
];
@@ -6562,28 +6562,6 @@ rec {
usesDefaultFeatures = false;
}
];
features = {
"alloc" = [ "dep:alloc" ];
"allocator-api2" = [ "dep:allocator-api2" ];
"core" = [ "dep:core" ];
"default" = [ "default-hasher" "inline-more" "allocator-api2" "equivalent" "raw-entry" ];
"default-hasher" = [ "dep:foldhash" ];
"equivalent" = [ "dep:equivalent" ];
"nightly" = [ "bumpalo/allocator_api" ];
"rayon" = [ "dep:rayon" ];
"rustc-dep-of-std" = [ "nightly" "core" "alloc" "rustc-internal-api" ];
"serde" = [ "dep:serde" ];
};
resolvedDefaultFeatures = [ "default-hasher" "inline-more" ];
};
"hashbrown 0.16.1" = rec {
crateName = "hashbrown";
version = "0.16.1";
edition = "2021";
sha256 = "004i3njw38ji3bzdp9z178ba9x3k0c1pgy8x69pj7yfppv4iq7c4";
authors = [
"Amanieu d'Antras <amanieu@gmail.com>"
];
features = {
"alloc" = [ "dep:alloc" ];
"allocator-api2" = [ "dep:allocator-api2" ];
@@ -6596,21 +6574,19 @@ rec {
"rustc-dep-of-std" = [ "nightly" "core" "alloc" "rustc-internal-api" ];
"serde" = [ "dep:serde_core" "dep:serde" ];
};
resolvedDefaultFeatures = [ "default-hasher" ];
};
"hashlink" = rec {
crateName = "hashlink";
version = "0.10.0";
version = "0.11.0";
edition = "2018";
sha256 = "1h8lzvnl9qxi3zyagivzz2p1hp6shgddfmccyf6jv7s1cdicz0kk";
authors = [
"kyren <kerriganw@gmail.com>"
];
sha256 = "0c6jpsyb9f3j5yrlbw8rnr5kpkar08z02b1h3b5sf14w39b242za";
dependencies = [
{
name = "hashbrown";
packageId = "hashbrown 0.15.5";
packageId = "hashbrown";
usesDefaultFeatures = false;
features = [ "default-hasher" "inline-more" ];
features = [ "default-hasher" ];
}
];
features = {
@@ -7733,7 +7709,7 @@ rec {
}
{
name = "hashbrown";
packageId = "hashbrown 0.16.1";
packageId = "hashbrown";
usesDefaultFeatures = false;
}
];
@@ -8202,10 +8178,10 @@ rec {
};
"libsqlite3-sys" = rec {
crateName = "libsqlite3-sys";
version = "0.35.0";
version = "0.36.0";
edition = "2021";
links = "sqlite3";
sha256 = "0gy1m6j1l94fxsirzp4h4rkrksf78rz7jy3px57qd1rcd8m1hg0k";
sha256 = "0ak4pibl2n1lnziwb7vkq98iw5i7cryv9dlc8aw2x9zgzwy11d4m";
libName = "libsqlite3_sys";
authors = [
"The rusqlite developers"
@@ -8230,9 +8206,9 @@ rec {
"bundled-sqlcipher-vendored-openssl" = [ "bundled-sqlcipher" "openssl-sys/vendored" ];
"bundled-windows" = [ "cc" "bundled_bindings" ];
"cc" = [ "dep:cc" ];
"default" = [ "min_sqlite_version_3_14_0" ];
"default" = [ "min_sqlite_version_3_34_1" ];
"loadable_extension" = [ "prettyplease" "quote" "syn" ];
"min_sqlite_version_3_14_0" = [ "pkg-config" "vcpkg" ];
"min_sqlite_version_3_34_1" = [ "pkg-config" "vcpkg" ];
"openssl-sys" = [ "dep:openssl-sys" ];
"pkg-config" = [ "dep:pkg-config" ];
"prettyplease" = [ "dep:prettyplease" ];
@@ -8242,7 +8218,7 @@ rec {
"syn" = [ "dep:syn" ];
"vcpkg" = [ "dep:vcpkg" ];
};
resolvedDefaultFeatures = [ "default" "min_sqlite_version_3_14_0" "pkg-config" "vcpkg" ];
resolvedDefaultFeatures = [ "default" "min_sqlite_version_3_34_1" "pkg-config" "vcpkg" ];
};
"lights-core" = rec {
crateName = "lights-core";
@@ -10483,12 +10459,33 @@ rec {
"rustasync"
];
};
"rsqlite-vfs" = rec {
crateName = "rsqlite-vfs";
version = "0.1.0";
edition = "2021";
sha256 = "0kap86yzwl355byfs891185h723nxvl746fdp8gnpvrna0qz58d8";
libName = "rsqlite_vfs";
dependencies = [
{
name = "hashbrown";
packageId = "hashbrown";
usesDefaultFeatures = false;
features = [ "default-hasher" ];
}
{
name = "thiserror";
packageId = "thiserror 2.0.18";
usesDefaultFeatures = false;
}
];
};
"rusqlite" = rec {
crateName = "rusqlite";
version = "0.37.0";
version = "0.38.0";
edition = "2021";
sha256 = "0gqzwykyfaaddq5rg1jk0940wby6ifarnwp3fcakbq90ggjscp0n";
sha256 = "1wvsy4ilbsz4yvbgxj5zna880avhrc4j2j9c76646fv8r78kvjgi";
authors = [
"The rusqlite developers"
];
@@ -10508,28 +10505,39 @@ rec {
{
name = "hashlink";
packageId = "hashlink";
optional = true;
}
{
name = "libsqlite3-sys";
packageId = "libsqlite3-sys";
target = { target, features }: (!((builtins.elem "wasm" target."family") && ("unknown" == target."os" or null)));
}
{
name = "smallvec";
packageId = "smallvec";
}
{
name = "sqlite-wasm-rs";
packageId = "sqlite-wasm-rs";
usesDefaultFeatures = false;
target = { target, features }: ((builtins.elem "wasm" target."family") && ("unknown" == target."os" or null));
}
];
features = {
"array" = [ "vtab" "modern_sqlite" ];
"buildtime_bindgen" = [ "libsqlite3-sys/buildtime_bindgen" ];
"array" = [ "vtab" ];
"buildtime_bindgen" = [ "libsqlite3-sys/buildtime_bindgen" "sqlite-wasm-rs/bindgen" ];
"bundled" = [ "libsqlite3-sys/bundled" "modern_sqlite" ];
"bundled-full" = [ "modern-full" "bundled" ];
"bundled-sqlcipher" = [ "libsqlite3-sys/bundled-sqlcipher" "bundled" ];
"bundled-sqlcipher-vendored-openssl" = [ "libsqlite3-sys/bundled-sqlcipher-vendored-openssl" "bundled-sqlcipher" ];
"bundled-windows" = [ "libsqlite3-sys/bundled-windows" ];
"cache" = [ "hashlink" ];
"chrono" = [ "dep:chrono" ];
"column_metadata" = [ "libsqlite3-sys/column_metadata" ];
"csv" = [ "dep:csv" ];
"csvtab" = [ "csv" "vtab" ];
"default" = [ "cache" ];
"hashlink" = [ "dep:hashlink" ];
"in_gecko" = [ "modern_sqlite" "libsqlite3-sys/in_gecko" ];
"jiff" = [ "dep:jiff" ];
"loadable_extension" = [ "libsqlite3-sys/loadable_extension" ];
@@ -10538,7 +10546,6 @@ rec {
"preupdate_hook" = [ "libsqlite3-sys/preupdate_hook" "hooks" ];
"rusqlite-macros" = [ "dep:rusqlite-macros" ];
"serde_json" = [ "dep:serde_json" ];
"serialize" = [ "modern_sqlite" ];
"series" = [ "vtab" ];
"session" = [ "libsqlite3-sys/session" "hooks" ];
"sqlcipher" = [ "libsqlite3-sys/sqlcipher" ];
@@ -10547,15 +10554,16 @@ rec {
"url" = [ "dep:url" ];
"uuid" = [ "dep:uuid" ];
"wasm32-wasi-vfs" = [ "libsqlite3-sys/wasm32-wasi-vfs" ];
"window" = [ "functions" "modern_sqlite" ];
"window" = [ "functions" ];
"with-asan" = [ "libsqlite3-sys/with-asan" ];
};
resolvedDefaultFeatures = [ "cache" "default" "hashlink" ];
};
"rusqlite_migration" = rec {
crateName = "rusqlite_migration";
version = "2.3.0";
version = "2.4.0";
edition = "2021";
sha256 = "0r72b2xiz5ylgzc2g0slb5x3n0ss80q9vgjm7vyvlx4jwix7dj9z";
sha256 = "14ql7w1da0xr3b1pihanwaidg43apfcik9nsnv2ws0kd0zv5xr08";
authors = [
"Clément Joly <foss@131719.xyz>"
];
@@ -11621,6 +11629,42 @@ rec {
};
resolvedDefaultFeatures = [ "all" ];
};
"sqlite-wasm-rs" = rec {
crateName = "sqlite-wasm-rs";
version = "0.5.2";
edition = "2021";
links = "wsqlite3";
sha256 = "06qq401l0xjgr61nv15z2s7yfg6cda7p4zdp56f0nsb77bnhchig";
libName = "sqlite_wasm_rs";
authors = [
"Spxg <unsafe@outlook.es>"
];
dependencies = [
{
name = "js-sys";
packageId = "js-sys";
usesDefaultFeatures = false;
}
{
name = "rsqlite-vfs";
packageId = "rsqlite-vfs";
}
{
name = "wasm-bindgen";
packageId = "wasm-bindgen";
usesDefaultFeatures = false;
}
];
buildDependencies = [
{
name = "cc";
packageId = "cc";
}
];
features = {
"bindgen" = [ "dep:bindgen" ];
};
};
"stable_deref_trait" = rec {
crateName = "stable_deref_trait";
version = "1.2.1";

View File

@@ -55,6 +55,7 @@
dashboard = import ./dashboard { inherit pkgs; };
fitnesstrax = import ./fitnesstrax/app { inherit pkgs; };
l10n-db = cargo_nix.workspaceMembers.l10n-db.build;
visions-server = import ./visions/server { inherit pkgs; };
default = pkgs.symlinkJoin {
name = "luminescent-dreams-apps";
@@ -63,6 +64,7 @@
dashboard
fitnesstrax
l10n-db
visions-server
];
};
};

View File

@@ -0,0 +1,51 @@
[workspace]
members = [
diff --git build.rs build.rs
index 1a1b32d..542fc75 100644
--- build.rs
+++ build.rs
@@ -23,31 +23,5 @@ use std::{
};
fn main() -> Result<(), Box<dyn Error>> {
- let readme_path = env::var("CARGO_PKG_README")?;
- println!("cargo:rerun-if-changed={readme_path}");
-
- let out_dir = env::var("OUT_DIR")?;
- let readme_for_rustdoc = File::create(format!("{out_dir}/readme_for_rustdoc.md"))?;
- let mut out = BufWriter::new(readme_for_rustdoc);
-
- let readme = read_to_string(readme_path)?;
- readme
- .lines()
- .skip_while(|line| line != &"<!-- rustdoc start -->")
- .skip(1) // Discard the pattern line
- .filter(|line| *line != "</div>") // Known unclosed div because we dont start from the top
- .try_fold(0, |lines_written, line| -> Result<usize, io::Error> {
- writeln!(out, "{line}")?;
- Ok(lines_written + 1)
- })
- .map(|lines_written| {
- println!("Wrote {lines_written} lines from the README to the rustdoc.");
- assert!(
- lines_written > 70,
- "the size of the documentation produced from the README.md file is suspiciously small"
- );
- })
- ?;
-
Ok(())
}
diff --git src/lib.rs src/lib.rs
index c53d25e..977f80e 100644
--- src/lib.rs
+++ src/lib.rs
@@ -15,8 +15,6 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![allow(clippy::test_attr_in_doctest)]
-// The doc is extracted from the README.md file at build time
-#![doc = include_str!(concat!(env!("OUT_DIR"), "/readme_for_rustdoc.md"))]
use std::borrow::Cow;
use std::fmt::Display;

View File

@@ -5,10 +5,10 @@ edition = "2024"
[dependencies]
fail = "0.5"
futures = "0.3.31"
libsqlite3-sys = "0.35.0"
rusqlite = "0.37.0"
rusqlite_migration = "2.3.0"
futures = "0.3.31"
libsqlite3-sys = "0.36"
rusqlite = "0.38"
rusqlite_migration = "2.4"
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }

View File

@@ -8,8 +8,8 @@ axum = { workspace = true }
axum-test = { version = "17.3.0", features = ["ws"] }
cool_asserts = "2.0.3"
fail = "0.5"
rusqlite = "0.37.0"
rusqlite_migration = "2.3.0"
rusqlite = "0.38"
rusqlite_migration = "2.4"
serde = { workspace = true }
serde_json = { workspace = true }
tempfile = "3.23.0"

View File

@@ -0,0 +1,27 @@
{ pkgs }:
let
rusqlite_patch = pkgs.writeTextFile {
name = "rusqlite_migrations.patch";
text = (builtins.readFile ../../patches/rusqlite_migrations.patch);
};
cargoOverrides =
pkgs:
pkgs.buildRustCrate.override {
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
rusqlite_migration = attrs: rec {
patchPhase = ''
pwd
ls -l
patch -p0 < ${rusqlite_patch}
'';
};
};
};
cargo_nix = pkgs.callPackage ../../Cargo.nix {
nixpkgs = pkgs;
buildRustCrateForPkgs = cargoOverrides;
};
in
cargo_nix.workspaceMembers.visions-server.build