From 77f33176c31c770aea5e1cdb97d0dbe57f89e674 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 10 Jun 2022 14:22:05 +0100 Subject: [PATCH 1/3] config: Do not strip_option for journald (and in future) As per point 1 in https://gitlab.torproject.org/tpo/core/arti/-/issues/488 --- crates/arti/src/logging.rs | 2 +- crates/tor-config/src/lib.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/arti/src/logging.rs b/crates/arti/src/logging.rs index 029261e62..9810fd63c 100644 --- a/crates/arti/src/logging.rs +++ b/crates/arti/src/logging.rs @@ -34,7 +34,7 @@ pub struct LoggingConfig { /// /// Only takes effect if Arti is built with the `journald` filter. #[builder( - setter(into, strip_option), + setter(into), field(build = r#"tor_config::resolve_option(&self.journald, || None)"#) )] journald: Option, diff --git a/crates/tor-config/src/lib.rs b/crates/tor-config/src/lib.rs index bce946336..c7ef41f92 100644 --- a/crates/tor-config/src/lib.rs +++ b/crates/tor-config/src/lib.rs @@ -153,6 +153,9 @@ impl Reconfigure { /// /// See /// +/// For consistency with other APIs in Arti, when using this, +/// do not pass `setter(strip_option)` to derive_builder. +/// /// # ⚠ Stability Warning ⚠ /// /// We hope to significantly change this so that it is an method in an extension trait. From baca49e0877b35d319637b66443328becad5d9e5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 10 Jun 2022 14:22:43 +0100 Subject: [PATCH 2/3] config: Suppose that we might extend resolve_option to non-T::Default As per point 3 in https://gitlab.torproject.org/tpo/core/arti/-/issues/488 --- crates/tor-config/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/tor-config/src/lib.rs b/crates/tor-config/src/lib.rs index c7ef41f92..632e348fa 100644 --- a/crates/tor-config/src/lib.rs +++ b/crates/tor-config/src/lib.rs @@ -159,6 +159,8 @@ impl Reconfigure { /// # ⚠ Stability Warning ⚠ /// /// We hope to significantly change this so that it is an method in an extension trait. +/// We may also make it able to support settings where the special "no such thing" value is +/// not `T::Default`. // // This is an annoying AOI right now because you have to write things like // #[builder(field(build = r#"tor_config::resolve_option(&self.dns_port, || None)"#))] From d22f6007f0ea09da31fbf6cf664238a5b417cd76 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 10 Jun 2022 14:28:36 +0100 Subject: [PATCH 3/3] config: document semver change --- crates/arti/semver.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 crates/arti/semver.md diff --git a/crates/arti/semver.md b/crates/arti/semver.md new file mode 100644 index 000000000..6e121c5cd --- /dev/null +++ b/crates/arti/semver.md @@ -0,0 +1 @@ +BREAKING: LoggingConfig.journald now takes `Option>`