From a7a4ce31700366f93c40b8b342fc138b467e6f0f Mon Sep 17 00:00:00 2001 From: Isaiah Inuwa Date: Fri, 23 Jan 2026 10:47:11 -0600 Subject: [PATCH 1/3] build: Remove libwebauthn dependency from common and ui packages --- Cargo.lock | 1 - Cargo.toml | 2 - credentialsd-common/Cargo.toml | 1 - credentialsd-common/src/model.rs | 74 ------------------- credentialsd/Cargo.toml | 3 +- credentialsd/src/credential_service/hybrid.rs | 6 +- credentialsd/src/credential_service/mod.rs | 17 +++-- credentialsd/src/credential_service/nfc.rs | 6 +- credentialsd/src/credential_service/usb.rs | 6 +- credentialsd/src/dbus/flow_control.rs | 17 +++-- credentialsd/src/dbus/gateway.rs | 21 +++--- credentialsd/src/dbus/model.rs | 5 +- credentialsd/src/main.rs | 1 + credentialsd/src/model.rs | 73 ++++++++++++++++++ 14 files changed, 117 insertions(+), 116 deletions(-) create mode 100644 credentialsd/src/model.rs diff --git a/Cargo.lock b/Cargo.lock index 616c52b..18ccab0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -800,7 +800,6 @@ name = "credentialsd-common" version = "0.1.0" dependencies = [ "futures-lite", - "libwebauthn", "serde", "zvariant", ] diff --git a/Cargo.toml b/Cargo.toml index bbe9fa9..f502061 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,6 @@ lto = true [workspace.dependencies] futures-lite = "2.6.0" -# libwebauthn = "0.2" -libwebauthn = { git = "https://github.com/linux-credentials/libwebauthn.git", rev="9e4e5d7", features = ["libnfc","pcsc"] } serde = { version = "1.0.219", features = ["derive"] } tracing = "0.1.41" tracing-subscriber = "0.3.19" diff --git a/credentialsd-common/Cargo.toml b/credentialsd-common/Cargo.toml index 489412b..5fd94d2 100644 --- a/credentialsd-common/Cargo.toml +++ b/credentialsd-common/Cargo.toml @@ -7,6 +7,5 @@ license = "LGPL-3.0-only" [dependencies] futures-lite.workspace = true -libwebauthn.workspace = true serde = { workspace = true, features = ["derive"] } zvariant.workspace = true diff --git a/credentialsd-common/src/model.rs b/credentialsd-common/src/model.rs index 11ce62b..cf1c2b9 100644 --- a/credentialsd-common/src/model.rs +++ b/credentialsd-common/src/model.rs @@ -3,10 +3,6 @@ use std::{fmt::Display, path::PathBuf}; use serde::{Deserialize, Serialize}; use zvariant::{SerializeDict, Type}; -pub use libwebauthn::ops::webauthn::{ - Assertion, GetAssertionRequest, MakeCredentialRequest, MakeCredentialResponse, -}; - #[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct Credential { pub id: String, @@ -14,76 +10,6 @@ pub struct Credential { pub username: Option, } -#[derive(Clone, Debug)] -pub enum CredentialRequest { - CreatePublicKeyCredentialRequest(MakeCredentialRequest), - GetPublicKeyCredentialRequest(GetAssertionRequest), -} - -#[derive(Clone, Debug)] -pub enum CredentialResponse { - CreatePublicKeyCredentialResponse(Box), - GetPublicKeyCredentialResponse(Box), -} - -impl CredentialResponse { - pub fn from_make_credential( - response: &MakeCredentialResponse, - transports: &[&str], - modality: &str, - ) -> CredentialResponse { - CredentialResponse::CreatePublicKeyCredentialResponse(Box::new( - MakeCredentialResponseInternal::new( - response.clone(), - transports.iter().map(|s| s.to_string()).collect(), - modality.to_string(), - ), - )) - } - - pub fn from_get_assertion(assertion: &Assertion, modality: &str) -> CredentialResponse { - CredentialResponse::GetPublicKeyCredentialResponse(Box::new( - GetAssertionResponseInternal::new(assertion.clone(), modality.to_string()), - )) - } -} - -#[derive(Clone, Debug)] -pub struct MakeCredentialResponseInternal { - pub ctap: MakeCredentialResponse, - pub transport: Vec, - pub attachment_modality: String, -} - -impl MakeCredentialResponseInternal { - pub fn new( - response: MakeCredentialResponse, - transport: Vec, - attachment_modality: String, - ) -> Self { - Self { - ctap: response, - transport, - attachment_modality, - } - } -} - -#[derive(Clone, Debug)] -pub struct GetAssertionResponseInternal { - pub ctap: Assertion, - pub attachment_modality: String, -} - -impl GetAssertionResponseInternal { - pub fn new(ctap: Assertion, attachment_modality: String) -> Self { - Self { - ctap, - attachment_modality, - } - } -} - #[derive(SerializeDict, Type)] #[zvariant(signature = "dict", rename_all = "camelCase")] pub struct GetClientCapabilitiesResponse { diff --git a/credentialsd/Cargo.toml b/credentialsd/Cargo.toml index 8a8720c..b4fd9f6 100644 --- a/credentialsd/Cargo.toml +++ b/credentialsd/Cargo.toml @@ -10,7 +10,8 @@ async-stream = "0.3.6" base64 = "0.22.1" credentialsd-common = { path = "../credentialsd-common" } futures-lite.workspace = true -libwebauthn.workspace = true +# libwebauthn = "0.2" +libwebauthn = { git = "https://github.com/linux-credentials/libwebauthn.git", rev="9e4e5d7", features = ["libnfc","pcsc"] } # TODO: split nfc and pcsc into separate features # Also, 0.6.1 fails to build with non-vendored library. # https://github.com/alexrsagen/rs-nfc1/issues/15 diff --git a/credentialsd/src/credential_service/hybrid.rs b/credentialsd/src/credential_service/hybrid.rs index 09b6d40..85cb6d5 100644 --- a/credentialsd/src/credential_service/hybrid.rs +++ b/credentialsd/src/credential_service/hybrid.rs @@ -12,7 +12,9 @@ use libwebauthn::transport::cable::qr_code_device::{CableQrCodeDevice, QrCodeOpe use libwebauthn::transport::{Channel, Device}; use libwebauthn::webauthn::{Error as WebAuthnError, WebAuthn}; -use credentialsd_common::model::{CredentialRequest, Error}; +use credentialsd_common::model::Error; + +use crate::model::CredentialRequest; use super::AuthenticatorResponse; @@ -262,7 +264,7 @@ pub(super) mod test { proto::ctap2::{Ctap2PublicKeyCredentialDescriptor, Ctap2Transport}, }; - use credentialsd_common::model::CredentialRequest; + use crate::model::CredentialRequest; use super::{HybridEvent, HybridHandler, HybridStateInternal}; #[derive(Debug)] diff --git a/credentialsd/src/credential_service/mod.rs b/credentialsd/src/credential_service/mod.rs index 4093218..7cc373f 100644 --- a/credentialsd/src/credential_service/mod.rs +++ b/credentialsd/src/credential_service/mod.rs @@ -20,14 +20,14 @@ use nfc::{NfcEvent, NfcHandler, NfcState, NfcStateInternal}; use tokio::sync::oneshot::Sender; use credentialsd_common::{ - model::{ - CredentialRequest, CredentialResponse, Device, Error as CredentialServiceError, Operation, - RequestingApplication, Transport, - }, + model::{Device, Error as CredentialServiceError, Operation, RequestingApplication, Transport}, server::{RequestId, ViewRequest, WindowHandle}, }; -use crate::credential_service::{hybrid::HybridEvent, usb::UsbEvent}; +use crate::{ + credential_service::{hybrid::HybridEvent, usb::UsbEvent}, + model::{CredentialRequest, CredentialResponse}, +}; use self::{ hybrid::{HybridHandler, HybridState, HybridStateInternal}, @@ -378,7 +378,9 @@ mod test { use std::{sync::Arc, time::Duration}; use libwebauthn::{ - ops::webauthn::{ResidentKeyRequirement, UserVerificationRequirement}, + ops::webauthn::{ + MakeCredentialRequest, ResidentKeyRequirement, UserVerificationRequirement, + }, proto::ctap2::{ Ctap2COSEAlgorithmIdentifier, Ctap2CredentialType, Ctap2PublicKeyCredentialRpEntity, Ctap2PublicKeyCredentialType, Ctap2PublicKeyCredentialUserEntity, @@ -389,9 +391,10 @@ mod test { use crate::{ credential_service::usb::InProcessUsbHandler, dbus::test::{DummyFlowServer, DummyUiServer}, + model::CredentialRequest, webauthn, }; - use credentialsd_common::model::{CredentialRequest, MakeCredentialRequest, Operation}; + use credentialsd_common::model::Operation; use super::{ hybrid::{test::DummyHybridHandler, HybridStateInternal}, diff --git a/credentialsd/src/credential_service/nfc.rs b/credentialsd/src/credential_service/nfc.rs index b96307a..f3994db 100644 --- a/credentialsd/src/credential_service/nfc.rs +++ b/credentialsd/src/credential_service/nfc.rs @@ -14,9 +14,9 @@ use tokio::sync::broadcast; use tokio::sync::mpsc::{self, Receiver, Sender, WeakSender}; use tracing::{debug, warn}; -use credentialsd_common::model::{ - Credential, CredentialRequest, Error, GetAssertionResponseInternal, -}; +use credentialsd_common::model::{Credential, Error}; + +use crate::model::{CredentialRequest, GetAssertionResponseInternal}; use super::{AuthenticatorResponse, CredentialResponse}; diff --git a/credentialsd/src/credential_service/usb.rs b/credentialsd/src/credential_service/usb.rs index b32a2a4..c43b949 100644 --- a/credentialsd/src/credential_service/usb.rs +++ b/credentialsd/src/credential_service/usb.rs @@ -17,9 +17,9 @@ use tokio::sync::broadcast; use tokio::sync::mpsc::{self, Receiver, Sender, WeakSender}; use tracing::{debug, warn}; -use credentialsd_common::model::{ - Credential, CredentialRequest, Error, GetAssertionResponseInternal, -}; +use credentialsd_common::model::{Credential, Error}; + +use crate::model::{CredentialRequest, GetAssertionResponseInternal}; use super::{AuthenticatorResponse, CredentialResponse}; diff --git a/credentialsd/src/dbus/flow_control.rs b/credentialsd/src/dbus/flow_control.rs index 6f588da..3ba5068 100644 --- a/credentialsd/src/dbus/flow_control.rs +++ b/credentialsd/src/dbus/flow_control.rs @@ -5,8 +5,7 @@ use std::future::Future; use std::{collections::VecDeque, fmt::Debug, sync::Arc}; use credentialsd_common::model::{ - BackgroundEvent, CredentialRequest, CredentialResponse, Error as CredentialServiceError, - RequestingApplication, WebAuthnError, + BackgroundEvent, Error as CredentialServiceError, RequestingApplication, WebAuthnError, }; use credentialsd_common::server::{Device, RequestId, WindowHandle}; use futures_lite::StreamExt; @@ -25,12 +24,16 @@ use zbus::{ ObjectServer, }; -use crate::credential_service::nfc::{NfcHandler, NfcState}; -use crate::credential_service::{ - hybrid::{HybridHandler, HybridState}, - usb::UsbHandler, - CredentialService, UiController, UsbState, +use crate::{ + credential_service::{ + hybrid::{HybridHandler, HybridState}, + nfc::{NfcHandler, NfcState}, + usb::UsbHandler, + CredentialService, UiController, UsbState, + }, + model::{CredentialRequest, CredentialResponse}, }; + pub const SERVICE_PATH: &str = "/xyz/iinuwa/credentialsd/FlowControl"; pub const SERVICE_NAME: &str = "xyz.iinuwa.credentialsd.FlowControl"; diff --git a/credentialsd/src/dbus/gateway.rs b/credentialsd/src/dbus/gateway.rs index d337bd1..2cb4ea1 100644 --- a/credentialsd/src/dbus/gateway.rs +++ b/credentialsd/src/dbus/gateway.rs @@ -1,13 +1,10 @@ //! Implements the service that public clients can connect to. Responsible for //! authorizing clients for origins and validating request parameters. -use std::sync::Arc; +use std::{os::fd::AsRawFd, sync::Arc}; use credentialsd_common::{ - model::{ - CredentialRequest, CredentialResponse, GetClientCapabilitiesResponse, - RequestingApplication, WebAuthnError, - }, + model::{GetClientCapabilitiesResponse, RequestingApplication, WebAuthnError}, server::{ CreateCredentialRequest, CreateCredentialResponse, GetCredentialRequest, GetCredentialResponse, WindowHandle, @@ -22,12 +19,14 @@ use zbus::{ Connection, DBusError, }; -use crate::dbus::{ - create_credential_request_try_into_ctap2, create_credential_response_try_from_ctap2, - get_credential_request_try_into_ctap2, get_credential_response_try_from_ctap2, - CredentialRequestController, +use crate::{ + dbus::{ + create_credential_request_try_into_ctap2, create_credential_response_try_from_ctap2, + get_credential_request_try_into_ctap2, get_credential_response_try_from_ctap2, + CredentialRequestController, + }, + model::{CredentialRequest, CredentialResponse}, }; -use std::os::fd::AsRawFd; pub const SERVICE_NAME: &str = "xyz.iinuwa.credentialsd.Credentials"; pub const SERVICE_PATH: &str = "/xyz/iinuwa/credentialsd/Credentials"; @@ -451,8 +450,6 @@ impl From for Error { #[cfg(test)] mod test { - use std::future::Future; - use credentialsd_common::model::WebAuthnError; use crate::dbus::gateway::check_origin; diff --git a/credentialsd/src/dbus/model.rs b/credentialsd/src/dbus/model.rs index 55a2112..4f77a5d 100644 --- a/credentialsd/src/dbus/model.rs +++ b/credentialsd/src/dbus/model.rs @@ -7,9 +7,7 @@ use std::{collections::HashMap, time::Duration}; use base64::{self, engine::general_purpose::URL_SAFE_NO_PAD, Engine as _}; use credentialsd_common::{ - model::{ - GetAssertionResponseInternal, MakeCredentialResponseInternal, Operation, WebAuthnError, - }, + model::{Operation, WebAuthnError}, server::{ CreateCredentialRequest, CreatePublicKeyCredentialResponse, GetCredentialRequest, GetPublicKeyCredentialResponse, @@ -18,6 +16,7 @@ use credentialsd_common::{ use crate::{ cose::CoseKeyAlgorithmIdentifier, + model::{GetAssertionResponseInternal, MakeCredentialResponseInternal}, webauthn::{ self, CredentialProtectionExtension, Ctap2PublicKeyCredentialDescriptor, Ctap2PublicKeyCredentialRpEntity, Ctap2PublicKeyCredentialUserEntity, diff --git a/credentialsd/src/main.rs b/credentialsd/src/main.rs index 4090985..ae6a7ab 100644 --- a/credentialsd/src/main.rs +++ b/credentialsd/src/main.rs @@ -2,6 +2,7 @@ mod cbor; mod cose; mod credential_service; mod dbus; +mod model; mod serde; mod webauthn; diff --git a/credentialsd/src/model.rs b/credentialsd/src/model.rs new file mode 100644 index 0000000..cb59df9 --- /dev/null +++ b/credentialsd/src/model.rs @@ -0,0 +1,73 @@ +use libwebauthn::ops::webauthn::{ + Assertion, GetAssertionRequest, MakeCredentialRequest, MakeCredentialResponse, +}; + +#[derive(Clone, Debug)] +pub enum CredentialRequest { + CreatePublicKeyCredentialRequest(MakeCredentialRequest), + GetPublicKeyCredentialRequest(GetAssertionRequest), +} + +#[derive(Clone, Debug)] +pub enum CredentialResponse { + CreatePublicKeyCredentialResponse(Box), + GetPublicKeyCredentialResponse(Box), +} + +impl CredentialResponse { + pub fn from_make_credential( + response: &MakeCredentialResponse, + transports: &[&str], + modality: &str, + ) -> CredentialResponse { + CredentialResponse::CreatePublicKeyCredentialResponse(Box::new( + MakeCredentialResponseInternal::new( + response.clone(), + transports.iter().map(|s| s.to_string()).collect(), + modality.to_string(), + ), + )) + } + + pub fn from_get_assertion(assertion: &Assertion, modality: &str) -> CredentialResponse { + CredentialResponse::GetPublicKeyCredentialResponse(Box::new( + GetAssertionResponseInternal::new(assertion.clone(), modality.to_string()), + )) + } +} + +#[derive(Clone, Debug)] +pub struct MakeCredentialResponseInternal { + pub ctap: MakeCredentialResponse, + pub transport: Vec, + pub attachment_modality: String, +} + +impl MakeCredentialResponseInternal { + pub fn new( + response: MakeCredentialResponse, + transport: Vec, + attachment_modality: String, + ) -> Self { + Self { + ctap: response, + transport, + attachment_modality, + } + } +} + +#[derive(Clone, Debug)] +pub struct GetAssertionResponseInternal { + pub ctap: Assertion, + pub attachment_modality: String, +} + +impl GetAssertionResponseInternal { + pub fn new(ctap: Assertion, attachment_modality: String) -> Self { + Self { + ctap, + attachment_modality, + } + } +} From ee30f05a19168c3b021f6bcc46ac3f887e035850 Mon Sep 17 00:00:00 2001 From: Isaiah Inuwa Date: Fri, 23 Jan 2026 11:14:01 -0600 Subject: [PATCH 2/3] build: remove unused aws-lc-sys dependency --- Cargo.lock | 61 +--------------------------------------- credentialsd/Cargo.toml | 4 +-- credentialsd/src/main.rs | 3 -- 3 files changed, 2 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18ccab0..8d7ba46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -347,28 +347,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "aws-lc-rs" -version = "1.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e84ce723ab67259cfeb9877c6a639ee9eb7a27b28123abd71db7f0d5d0cc9d86" -dependencies = [ - "aws-lc-sys", - "zeroize", -] - -[[package]] -name = "aws-lc-sys" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a442ece363113bd4bd4c8b18977a7798dd4d3c3383f34fb61936960e8f4ad8" -dependencies = [ - "cc", - "cmake", - "dunce", - "fs_extra", -] - [[package]] name = "base16ct" version = "0.2.0" @@ -621,8 +599,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932" dependencies = [ "find-msvc-tools", - "jobserver", - "libc", "shlex", ] @@ -703,15 +679,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "cmake" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" -dependencies = [ - "cc", -] - [[package]] name = "combine" version = "4.6.7" @@ -786,7 +753,6 @@ dependencies = [ "nfc1", "rand 0.9.2", "ring", - "rustls", "serde", "serde_json", "tokio", @@ -1044,12 +1010,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - [[package]] name = "ecdsa" version = "0.16.9" @@ -1218,12 +1178,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - [[package]] name = "futures" version = "0.3.31" @@ -1913,16 +1867,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "jobserver" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" -dependencies = [ - "getrandom 0.3.4", - "libc", -] - [[package]] name = "js-sys" version = "0.3.85" @@ -1976,7 +1920,7 @@ dependencies = [ [[package]] name = "libwebauthn" version = "0.2.2" -source = "git+https://github.com/linux-credentials/libwebauthn.git?rev=9e4e5d7#9e4e5d78dd8030d7d4f78c0a4915b45e337c9ed1" +source = "git+https://github.com/linux-credentials/libwebauthn.git?rev=80545bff16c4e89a930221e90d3141a76303b84b#80545bff16c4e89a930221e90d3141a76303b84b" dependencies = [ "aes", "apdu", @@ -2813,8 +2757,6 @@ version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ - "aws-lc-rs", - "log", "once_cell", "ring", "rustls-pki-types", @@ -2850,7 +2792,6 @@ version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ - "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", diff --git a/credentialsd/Cargo.toml b/credentialsd/Cargo.toml index b4fd9f6..693a751 100644 --- a/credentialsd/Cargo.toml +++ b/credentialsd/Cargo.toml @@ -10,15 +10,13 @@ async-stream = "0.3.6" base64 = "0.22.1" credentialsd-common = { path = "../credentialsd-common" } futures-lite.workspace = true -# libwebauthn = "0.2" -libwebauthn = { git = "https://github.com/linux-credentials/libwebauthn.git", rev="9e4e5d7", features = ["libnfc","pcsc"] } +libwebauthn = { git = "https://github.com/linux-credentials/libwebauthn.git", rev="80545bff16c4e89a930221e90d3141a76303b84b", features = ["libnfc","pcsc"] } # TODO: split nfc and pcsc into separate features # Also, 0.6.1 fails to build with non-vendored library. # https://github.com/alexrsagen/rs-nfc1/issues/15 nfc1 = { version = "=0.6.0", default-features = false } rand = "0.9.2" ring = "0.17.14" -rustls = { version = "0.23.27", default-features = false, features = ["std", "tls12", "ring", "log", "logging", "prefer-post-quantum"] } serde.workspace = true serde_json = "1.0.140" tokio = { version = "1.45.0", features = ["rt-multi-thread"] } diff --git a/credentialsd/src/main.rs b/credentialsd/src/main.rs index ae6a7ab..c556c69 100644 --- a/credentialsd/src/main.rs +++ b/credentialsd/src/main.rs @@ -21,9 +21,6 @@ use crate::{ async fn main() { // Initialize logger tracing_subscriber::fmt::init(); - rustls::crypto::ring::default_provider() - .install_default() - .expect("Failed to install rustls crypto provider"); println!("Starting..."); run().await.unwrap(); From 02700f3a9496124cad30708478c878aa8097c3c7 Mon Sep 17 00:00:00 2001 From: Isaiah Inuwa Date: Fri, 23 Jan 2026 12:16:53 -0600 Subject: [PATCH 3/3] build: Add Meson option for cargo --locked flag --- .github/workflows/main.yml | 3 +-- credentialsd-common/meson.build | 4 +++- credentialsd-ui/meson.build | 4 +++- credentialsd/meson.build | 4 +++- meson.options | 6 ++++++ 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a54e09..80b0542 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,6 @@ jobs: workspaces: ". -> build/target" cache-workspace-crates: true - - name: Update apt cache run: sudo apt update - name: Install system dependencies @@ -45,7 +44,7 @@ jobs: # Newer version needed for --interactive flag needed below python3 -m pip install --user -v 'meson==1.5.0' - name: Setup meson project - run: meson setup -Dprofile=development build + run: meson setup -Dprofile=development -Dcargo_locked=true build - name: Build run: ninja -C build diff --git a/credentialsd-common/meson.build b/credentialsd-common/meson.build index ea0a71a..b04134e 100644 --- a/credentialsd-common/meson.build +++ b/credentialsd-common/meson.build @@ -8,7 +8,9 @@ cargo_options = [ '--manifest-path', meson.project_source_root() / meson.current_source_dir() / 'Cargo.toml', ] cargo_options += ['--target-dir', cargo_target_dir] -cargo_options += '--locked' +if get_option('cargo_locked') == true + cargo_options += '--locked' +endif if get_option('cargo_offline') == true cargo_options += ['--offline'] endif diff --git a/credentialsd-ui/meson.build b/credentialsd-ui/meson.build index 56b7906..a3525f1 100644 --- a/credentialsd-ui/meson.build +++ b/credentialsd-ui/meson.build @@ -65,7 +65,9 @@ cargo_options = [ '--manifest-path', meson.project_source_root() / gui_source_dir / 'Cargo.toml', ] cargo_options += ['--target-dir', cargo_target_dir] -cargo_options += '--locked' +if get_option('cargo_locked') == true + cargo_options += '--locked' +endif if get_option('cargo_offline') == true cargo_options += ['--offline'] endif diff --git a/credentialsd/meson.build b/credentialsd/meson.build index 24fe14f..855ee20 100644 --- a/credentialsd/meson.build +++ b/credentialsd/meson.build @@ -48,7 +48,9 @@ cargo_options = [ cargo_options += [ '--target-dir', cargo_target_dir, ] -cargo_options += '--locked' +if get_option('cargo_locked') == true + cargo_options += '--locked' +endif if get_option('cargo_offline') == true cargo_options += ['--offline'] endif diff --git a/meson.options b/meson.options index 75adcb6..c10c493 100644 --- a/meson.options +++ b/meson.options @@ -10,6 +10,12 @@ option( type: 'string', description: 'The directory to store files downloaded by Cargo', ) +option( + 'cargo_locked', + type: 'boolean', + value: false, + description: 'Whether Cargo.lock will be used without modification. Defaults to false to automatically resolve dependencies.', +) option( 'cargo_offline', type: 'boolean',