From 94bdb409c931f07807e2650a2e413feb30fa336d Mon Sep 17 00:00:00 2001 From: tjh Date: Mon, 13 Oct 2025 21:03:33 +0100 Subject: [PATCH] ops: set rust msrv to 1.86 and add test workflow Rust 1.86 is the latest available version on CI runner. Signed-off-by: tjh --- .tangled/workflows/test.yaml | 21 +++++++++++++++++++++ Cargo.toml | 1 + crates/identity/src/resolvers.rs | 24 ++++++++++++------------ crates/knot/Cargo.toml | 1 + rust-toolchain.toml | 2 ++ 5 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 .tangled/workflows/test.yaml create mode 100644 rust-toolchain.toml diff --git a/.tangled/workflows/test.yaml b/.tangled/workflows/test.yaml new file mode 100644 index 0000000..f94bdec --- /dev/null +++ b/.tangled/workflows/test.yaml @@ -0,0 +1,21 @@ +when: + - event: + - push + branch: + - main + +engine: nixery + +dependencies: + nixpkgs: + - cargo + - clang + - openssl + - pkg-config + +steps: + - name: Run unit tests + command: | + export PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+$PKG_CONFIG_PATH:}$(nix build nixpkgs#openssl.dev --no-link --print-out-paths)/lib/pkgconfig" + cargo test --workspace + diff --git a/Cargo.toml b/Cargo.toml index 8218ee3..a091646 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ repository = "https://tangled.org/@tjh.dev/gordian" license = "MIT or Apache-2.0" edition = "2024" publish = false +rust-version = "1.86" [workspace.dependencies] identity = { path = "crates/identity" } diff --git a/crates/identity/src/resolvers.rs b/crates/identity/src/resolvers.rs index 419723c..08e4670 100644 --- a/crates/identity/src/resolvers.rs +++ b/crates/identity/src/resolvers.rs @@ -197,18 +197,18 @@ where continue; }; - if let Some(old_did) = resolved_did.replace(did.clone()) - && old_did != did - { - tracing::error!( - ?handle, - ?did, - ?old_did, - "multiple conflicting DIDs found for handle" - ); - // @TODO Replace this with an error so we can retry with a - // recursive dns resolver. - return Ok(None); + if let Some(old_did) = resolved_did.replace(did.clone()) { + if old_did != did { + tracing::error!( + ?handle, + ?did, + ?old_did, + "multiple conflicting DIDs found for handle" + ); + // @TODO Replace this with an error so we can retry with a + // recursive dns resolver. + return Ok(None); + } } } } diff --git a/crates/knot/Cargo.toml b/crates/knot/Cargo.toml index f20d407..13b6a08 100644 --- a/crates/knot/Cargo.toml +++ b/crates/knot/Cargo.toml @@ -7,6 +7,7 @@ repository.workspace = true license.workspace = true edition.workspace = true publish.workspace = true +rust-version.workspace = true [dependencies] anyhow = "1.0.99" diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..e7f22fb --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.86" -- 2.51.2