From 303d7912af637c1a1a01037ec4c2914f00128f84 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 24 Jun 2022 19:14:33 -0600 Subject: [PATCH] various CI fixes build.rs was missing an `await`, plus sqlx seems prone to build-time "database is locked" errors for reasons I haven't had time to debug, so I'm downgrading to 0.5.13 for the time being. --- .github/workflows/rust.yml | 8 +++---- Cargo.lock | 49 ++++++++++++++++---------------------- server/Cargo.toml | 4 ++-- server/build.rs | 6 +++-- 4 files changed, 30 insertions(+), 37 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0bf0050..39087aa 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,11 +16,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install gexiv2 + - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y libgexiv2-dev + sudo apt-get install -y libgexiv2-dev ffmpeg - name: Clippy - run: cargo clippy --all-features --all-targets + run: cargo clippy --release --all-features --all-targets - name: Run tests - run: cargo test --release + run: cargo test --release --all-features --all-targets diff --git a/Cargo.lock b/Cargo.lock index f3eec15..0884a1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,9 +60,9 @@ dependencies = [ [[package]] name = "atoi" -version = "1.0.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5" dependencies = [ "num-traits", ] @@ -267,18 +267,18 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" +checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" +checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" [[package]] name = "crc32fast" @@ -499,7 +499,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52db5973b6a19247baf19b30f41c23a1bfffc2e9ce0a5db2f60e3cd5dc8895f7" dependencies = [ - "hashbrown 0.11.2", + "hashbrown", ] [[package]] @@ -750,22 +750,13 @@ dependencies = [ "ahash", ] -[[package]] -name = "hashbrown" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" -dependencies = [ - "ahash", -] - [[package]] name = "hashlink" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452c155cb93fecdfb02a73dd57b5d8e442c2063bd7aac72f1bc5e4263a43086" +checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" dependencies = [ - "hashbrown 0.12.1", + "hashbrown", ] [[package]] @@ -950,7 +941,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", - "hashbrown 0.11.2", + "hashbrown", ] [[package]] @@ -1274,7 +1265,7 @@ dependencies = [ "byteorder", "env_logger 0.8.4", "fallible_collections", - "hashbrown 0.11.2", + "hashbrown", "log", "num-traits", "static_assertions", @@ -2108,9 +2099,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.6.0" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f82cbe94f41641d6c410ded25bbf5097c240cefdf8e3b06d04198d0a96af6a4" +checksum = "551873805652ba0d912fec5bbb0f8b4cdd96baf8e2ebf5970e5671092966019b" dependencies = [ "sqlx-core", "sqlx-macros", @@ -2118,9 +2109,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.6.0" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b69bf218860335ddda60d6ce85ee39f6cf6e5630e300e19757d1de15886a093" +checksum = "e48c61941ccf5ddcada342cd59e3e5173b007c509e1e8e990dafc830294d9dc5" dependencies = [ "ahash", "atoi", @@ -2160,9 +2151,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.6.0" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40c63177cf23d356b159b60acd27c54af7423f1736988502e36bae9a712118f" +checksum = "bc0fba2b0cae21fc00fe6046f8baa4c7fcb49e379f0f592b04696607f69ed2e1" dependencies = [ "dotenv", "either", @@ -2179,9 +2170,9 @@ dependencies = [ [[package]] name = "sqlx-rt" -version = "0.6.0" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874e93a365a598dc3dadb197565952cb143ae4aa716f7bcc933a8d836f6bf89f" +checksum = "4db708cd3e459078f85f39f96a00960bd841f66ee2a669e90bf36907f5a79aae" dependencies = [ "native-tls", "once_cell", diff --git a/server/Cargo.toml b/server/Cargo.toml index 53c9877..d0652ef 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -25,7 +25,7 @@ serde = "1.0.137" serde_derive = "1.0.137" serde_json = "1.0.81" sha2 = "0.10.2" -sqlx = { version = "0.6.0", features = [ "runtime-tokio-native-tls", "sqlite" ] } +sqlx = { version = "0.5.13", features = [ "runtime-tokio-native-tls", "sqlite" ] } structopt = "0.3.26" thiserror = "1.0.31" ring = "0.16.20" @@ -48,5 +48,5 @@ maplit = "1.0.2" [build-dependencies] anyhow = "1.0.58" schema = { path = "./schema" } -sqlx = { version = "0.6.0", features = [ "runtime-tokio-native-tls", "sqlite" ] } +sqlx = { version = "0.5.13", features = [ "runtime-tokio-native-tls", "sqlite" ] } tokio = { version = "1.19.2", features = [ "macros", "rt-multi-thread", "fs" ] } diff --git a/server/build.rs b/server/build.rs index cf646c4..5dc24f9 100644 --- a/server/build.rs +++ b/server/build.rs @@ -1,6 +1,6 @@ use { anyhow::{anyhow, Result}, - sqlx::{sqlite::SqliteConnectOptions, ConnectOptions}, + sqlx::{sqlite::SqliteConnectOptions, ConnectOptions, Connection as _}, std::env, tokio::fs, }; @@ -10,7 +10,7 @@ async fn main() -> Result<()> { let mut path = env::current_dir()?; path.push("target"); - let _ = fs::create_dir(&path); + let _ = fs::create_dir(&path).await; path.push("schema.dat"); @@ -28,6 +28,8 @@ async fn main() -> Result<()> { sqlx::query(statement).execute(&mut conn).await?; } + conn.close().await?; + println!("cargo:rustc-env=DATABASE_URL=sqlite://{db}"); Ok(())