Skip to content

Commit

Permalink
upgrade dependencies, Nasm on Windows (#1295)
Browse files Browse the repository at this point in the history
* Install `nasm` when running CI on Windows (required by rustls new
faster crypto-provider)
* In integration testing, wrap connection in mutex due to `rstest` now
requiring `once` fixtures to be `Sync`
* Upgrade to Brotli v4, and disable FFI due to compilation conflict
  • Loading branch information
nyurik authored Apr 9, 2024
1 parent 823955c commit 566f91d
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ jobs:
run: rustc --version && cargo --version
- uses: Swatinem/rust-cache@v2
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
- name: Install NASM for rustls/aws-lc-rs on Windows
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- name: Build (.deb)
if: matrix.target == 'debian-x86_64'
run: |
Expand Down
163 changes: 146 additions & 17 deletions Cargo.lock

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

10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ anyhow = "1.0"
approx = "0.5.1"
async-trait = "0.1"
bit-set = "0.5.3"
brotli = "3"
brotli = { version = "4", default-features = false, features = ["std"] }
cargo-husky = { version = "1", features = ["user-hooks"], default-features = false }
clap = { version = "4", features = ["derive"] }
criterion = { version = "0.5", features = ["async_futures", "async_tokio", "html_reports"] }
Expand Down Expand Up @@ -62,8 +62,10 @@ postgres-protocol = "0.6"
pprof = { version = "0.13", features = ["flamegraph", "criterion"] }
pretty_assertions = "1"
regex = "1"
rstest = "0.18"
rustls = "0.22"
rstest = "0.19"
rustls = "0.23.4"
# ring feature does not require NASM windows executable, but works slower
#rustls = { version = "0.23", default-features = false, features = ["logging", "std", "tls12", "ring"] }
rustls-native-certs = "0.7"
rustls-pemfile = "2"
semver = "1"
Expand All @@ -80,7 +82,7 @@ thiserror = "1"
tile-grid = "0.5"
tilejson = "0.4"
tokio = { version = "1", features = ["macros"] }
tokio-postgres-rustls = "0.11"
tokio-postgres-rustls = "0.12"
url = "2.5"

[profile.dev.package]
Expand Down
3 changes: 2 additions & 1 deletion martin/src/pg/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use deadpool_postgres::tokio_postgres::Config;
use log::{info, warn};
use regex::Regex;
use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier};
use rustls::crypto::ring::default_provider;
// use rustls::crypto::ring::default_provider;
use rustls::crypto::aws_lc_rs::default_provider;
use rustls::crypto::{verify_tls12_signature, verify_tls13_signature};
use rustls::pki_types::{CertificateDer, ServerName, UnixTime};
use rustls::{DigitallySignedStruct, Error, SignatureScheme};
Expand Down
11 changes: 9 additions & 2 deletions mbtiles/tests/copy.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::collections::HashMap;
use std::path::PathBuf;
use std::str::from_utf8;
use std::sync::Mutex;

use ctor::ctor;
use insta::{allow_duplicates, assert_snapshot};
Expand Down Expand Up @@ -176,7 +177,12 @@ macro_rules! assert_dump {
struct Databases(
HashMap<
(&'static str, MbtTypeCli),
(Vec<SqliteEntry>, Mbtiles, Option<String>, SqliteConnection),
(
Vec<SqliteEntry>,
Mbtiles,
Option<String>,
Mutex<SqliteConnection>,
),
>,
);

Expand All @@ -190,7 +196,8 @@ impl Databases {
hash: Option<String>,
conn: SqliteConnection,
) {
self.0.insert((name, typ), (dump, mbtiles, hash, conn));
self.0
.insert((name, typ), (dump, mbtiles, hash, Mutex::new(conn)));
}
fn dump(&self, name: &'static str, typ: MbtTypeCli) -> &Vec<SqliteEntry> {
&self.0.get(&(name, typ)).unwrap().0
Expand Down

0 comments on commit 566f91d

Please sign in to comment.