From ab35621b9ed84e404904d2e901fb57bb4eb54c4a Mon Sep 17 00:00:00 2001 From: Sachymetsu Date: Sun, 11 Jan 2026 12:16:40 +0100 Subject: [PATCH] Yeet KDL configs, embrace TOML --- .gitignore | 2 +- Cargo.lock | 298 +++++++-------------------------------- build.rs | 2 +- config.example.kdl | 12 -- pico-config.example.toml | 11 ++ 5 files changed, 67 insertions(+), 258 deletions(-) delete mode 100644 config.example.kdl create mode 100644 pico-config.example.toml diff --git a/.gitignore b/.gitignore index 43b4dbe..807798f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /target -config.kdl +pico-config.toml diff --git a/Cargo.lock b/Cargo.lock index 231ebb1..81ecace 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -757,116 +757,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "facet" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ee49c69f8a398d01d9b160e3e6288c1a5f7d756e8377f0530bbb4019aa1616" -dependencies = [ - "autocfg", - "facet-core", - "facet-macros", - "static_assertions", -] - -[[package]] -name = "facet-core" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ca85b6f8c289d86e5a0daa6b402ed1edf4001ad9b6ead357cc047fff680e0d" -dependencies = [ - "autocfg", - "impls", -] - -[[package]] -name = "facet-kdl" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b52d9f35c93a85109d9d1d9042fbc1b02972c28eaceb36374995e9d166f4019" -dependencies = [ - "facet", - "facet-core", - "facet-reflect", - "facet-singularize", - "facet-solver", - "kdl", - "log", - "miette", -] - -[[package]] -name = "facet-macro-parse" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "294183c810413075f9c3f075c0b3554d04ad06207dad18debc649a48779321f6" -dependencies = [ - "facet-macro-types", - "proc-macro2", - "quote", -] - -[[package]] -name = "facet-macro-types" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8335dd3290eb5780aa40fb5b0da6c1a1c08980af6ada54c2e0d8cbbcd52b8f33" -dependencies = [ - "proc-macro2", - "quote", - "unsynn", -] - -[[package]] -name = "facet-macros" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f7c8e20f24f6c933290da20e76ce8b62a28ea7f16ea173a1aa21cb2ebf61f0" -dependencies = [ - "facet-macros-impl", -] - -[[package]] -name = "facet-macros-impl" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc36ba0859bb5fc539e9fb9ed4dab7a5af3b9dbf080e92adaeb5041c58971fcb" -dependencies = [ - "facet-macro-parse", - "facet-macro-types", - "proc-macro2", - "quote", - "strsim", - "unsynn", -] - -[[package]] -name = "facet-reflect" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ab47f7ccaed7b782b4cdbfa3482f16720c0e7e31c38bf5f7da8b8f8c988690" -dependencies = [ - "facet-core", - "miette", -] - -[[package]] -name = "facet-singularize" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd14cadea48902b862d1f9256f1eac9102680d3fc105e5888008e219f2de6023" - -[[package]] -name = "facet-solver" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a23bcde5d4f562dfed81ca31c15c241536b1b6ef0a6e46cc17d8963b9f9f33" -dependencies = [ - "facet-core", - "facet-reflect", - "strsim", -] - [[package]] name = "fixed" version = "1.29.0" @@ -1043,17 +933,11 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "impls" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a46645bbd70538861a90d0f26c31537cdf1e44aae99a794fb75a664b70951bc" - [[package]] name = "indexmap" -version = "2.12.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown", @@ -1074,17 +958,6 @@ dependencies = [ "either", ] -[[package]] -name = "kdl" -version = "6.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a29e7b50079ff44549f68c0becb1c73d7f6de2a4ea952da77966daf3d4761e" -dependencies = [ - "miette", - "num", - "winnow 0.6.24", -] - [[package]] name = "keccak" version = "0.1.5" @@ -1128,9 +1001,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.179" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "linux-raw-sys" @@ -1210,12 +1083,6 @@ dependencies = [ "adler2", ] -[[package]] -name = "mutants" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0287524726960e07b119cebd01678f852f147742ae0d925e6a520dca956126" - [[package]] name = "nb" version = "0.1.3" @@ -1237,70 +1104,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1684,12 +1487,6 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" -[[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1721,17 +1518,16 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "sachy-config" version = "0.1.0" -source = "git+https://tangled.org/sachy.dev/sachy-embed-core#07539b3e060d72b69d4c5fef8db61a10dc20541d" +source = "git+https://tangled.org/sachy.dev/sachy-embed-core#ddd979631521a586c4e8b1df7bf8cef817921c98" dependencies = [ - "facet", - "facet-kdl", "miette", + "toml_edit", ] [[package]] name = "sachy-fmt" version = "0.1.0" -source = "git+https://tangled.org/sachy.dev/sachy-embed-core#07539b3e060d72b69d4c5fef8db61a10dc20541d" +source = "git+https://tangled.org/sachy.dev/sachy-embed-core#ddd979631521a586c4e8b1df7bf8cef817921c98" dependencies = [ "defmt 1.0.1", ] @@ -1739,18 +1535,18 @@ dependencies = [ [[package]] name = "sachy-mdns" version = "0.1.0" -source = "git+https://tangled.org/sachy.dev/sachy-embed-core#07539b3e060d72b69d4c5fef8db61a10dc20541d" +source = "git+https://tangled.org/sachy.dev/sachy-embed-core#ddd979631521a586c4e8b1df7bf8cef817921c98" dependencies = [ "defmt 1.0.1", "embassy-time", "sachy-fmt", - "winnow 0.7.14", + "winnow", ] [[package]] name = "sachy-sntp" version = "0.1.0" -source = "git+https://tangled.org/sachy.dev/sachy-embed-core#07539b3e060d72b69d4c5fef8db61a10dc20541d" +source = "git+https://tangled.org/sachy.dev/sachy-embed-core#ddd979631521a586c4e8b1df7bf8cef817921c98" dependencies = [ "chrono", "defmt 1.0.1", @@ -1885,12 +1681,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "static_cell" version = "2.1.1" @@ -1903,7 +1693,7 @@ dependencies = [ [[package]] name = "striker-proto" version = "0.1.0" -source = "git+https://tangled.org/sachy.dev/striker#bd091d3021faf30a207617dd329c3782f98b7176" +source = "git+https://tangled.org/sachy.dev/striker#674322b5d31c9f4d2c2e129c4c4f17d72cee2b2d" dependencies = [ "postcard", "serde", @@ -2041,6 +1831,43 @@ dependencies = [ "syn 2.0.114", ] +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.24.0+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c740b185920170a6d9191122cafef7010bd6270a3824594bff6784c04d7f09e" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" + [[package]] name = "typenum" version = "1.19.0" @@ -2077,17 +1904,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "unsynn" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501a7adf1a4bd9951501e5c66621e972ef8874d787628b7f90e64f936ef7ec0a" -dependencies = [ - "mutants", - "proc-macro2", - "rustc-hash", -] - [[package]] name = "vcell" version = "0.1.3" @@ -2225,33 +2041,27 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "0.6.24" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] -[[package]] -name = "winnow" -version = "0.7.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" - [[package]] name = "zerocopy" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fabae64378cb18147bb18bca364e63bdbe72a0ffe4adf0addfec8aa166b2c56" +checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9c2d862265a8bb4471d87e033e730f536e2a285cc7cb05dbce09a2a97075f90" +checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" dependencies = [ "proc-macro2", "quote", diff --git a/build.rs b/build.rs index ee1242b..3778423 100644 --- a/build.rs +++ b/build.rs @@ -35,7 +35,7 @@ fn main() { println!("cargo:rustc-link-arg-bins=-Tlink-rp.x"); println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); - let config = include_str!("config.kdl"); + let config = include_str!("pico-config.toml"); let out_file = out.join("constants.rs"); diff --git a/config.example.kdl b/config.example.kdl deleted file mode 100644 index dcdcb08..0000000 --- a/config.example.kdl +++ /dev/null @@ -1,12 +0,0 @@ -statics { - SSID "CHANGEME" - PASSWORD "astrongpassword123" - HOST_NAME "strike" -} -constants { - HEAP_SIZE "usize" "65536" - BLOCK_SIZE "usize" "512" - HOST_PORT "u16" "6125" - BLIP_THRESHOLD "u16" "12" - BLIP_SIZE "usize" "2" -} diff --git a/pico-config.example.toml b/pico-config.example.toml new file mode 100644 index 0000000..5bbb265 --- /dev/null +++ b/pico-config.example.toml @@ -0,0 +1,11 @@ +[statics] +SSID = "CHANGEME" +PASSWORD = "astrongpassword123" +HOST_NAME = "strike" + +[constants] +HEAP_SIZE = { type = "usize", value = 65536 } +BLOCK_SIZE = { type = "usize", value = 512 } +HOST_PORT = { type = "u16", value = 6125 } +BLIP_THRESHOLD = { type = "u16", value = 12 } +BLIP_SIZE = { type = "usize", value = 2 } -- 2.51.2