From 94c6204d42591d875c4072d980c739b62135e534 Mon Sep 17 00:00:00 2001 From: Bruce Rosier Date: Mon, 14 Oct 2024 23:36:02 +0200 Subject: [PATCH 1/8] [#432] Implement CLI iox2-config --- README.md | 4 + doc/release-notes/iceoryx2-unreleased.md | 58 ++------ iceoryx2-bb/posix/src/system_configuration.rs | 84 ------------ iceoryx2-cli/Cargo.toml | 9 ++ iceoryx2-cli/iox2-config/src/cli.rs | 40 ++++++ iceoryx2-cli/iox2-config/src/commands.rs | 124 ++++++++++++++++++ iceoryx2-cli/iox2-config/src/main.rs | 69 ++++++++++ 7 files changed, 258 insertions(+), 130 deletions(-) create mode 100644 iceoryx2-cli/iox2-config/src/cli.rs create mode 100644 iceoryx2-cli/iox2-config/src/commands.rs create mode 100644 iceoryx2-cli/iox2-config/src/main.rs diff --git a/README.md b/README.md index 06377a043..97f09b329 100644 --- a/README.md +++ b/README.md @@ -376,6 +376,10 @@ The support levels can be adjusted when required. »orecham«
»orecham«
+ + + Bruce »brosier01« Rosier
+ Bruce »brosier01« Rosier
diff --git a/doc/release-notes/iceoryx2-unreleased.md b/doc/release-notes/iceoryx2-unreleased.md index 1165f6608..a0da9e98d 100644 --- a/doc/release-notes/iceoryx2-unreleased.md +++ b/doc/release-notes/iceoryx2-unreleased.md @@ -6,57 +6,23 @@ ### Features - +Create a new CLI for iceoryx2 `iox2-config` -* Add `PeriodicTimer` into POSIX building blocks [#425](https://github.com/eclipse-iceoryx/iceoryx2/issues/425) +`iox2-config` can `show` the configuration currently in use and `generate` a new +configuration file at the default location iceoryx2 is looking for. -### Bugfixes - - - -* Example text [#1](https://github.com/eclipse-iceoryx/iceoryx2/issues/1) +* Add CLI to display complete system configuration [#432](https://github.com/eclipse-iceoryx/iceoryx2/issues/432) ### Refactoring - - -* Example text [#1](https://github.com/eclipse-iceoryx/iceoryx2/issues/1) - -### Workflow - - - -* Example text [#1](https://github.com/eclipse-iceoryx/iceoryx2/issues/1) - -### New API features - - - -* Example text [#1](https://github.com/eclipse-iceoryx/iceoryx2/issues/1) - -### API Breaking Changes +Remove the `print_system_configuration()` function in +`iceoryx2-bb/posix/src/system_configuration.rs` file and move it into the CLI `iox2-config` +[#432](https://github.com/eclipse-iceoryx/iceoryx2/issues/432) -1. Example +### New CLI features - ```rust - // old - let fuu = hello().is_it_me_you_re_looking_for() +```bash + cargo run --bin iox2-config show - // new - let fuu = hypnotoad().all_glory_to_the_hypnotoad() - ``` + cargo run --bin iox2-config generate +``` diff --git a/iceoryx2-bb/posix/src/system_configuration.rs b/iceoryx2-bb/posix/src/system_configuration.rs index 27a516298..dd49f825b 100644 --- a/iceoryx2-bb/posix/src/system_configuration.rs +++ b/iceoryx2-bb/posix/src/system_configuration.rs @@ -294,87 +294,3 @@ impl ProcessResourceLimit { true } } - -/// Prints the whole system configuration with all limits, features and details to the console. -pub fn print_system_configuration() { - const HEADER_COLOR: &str = "\x1b[4;92m"; - const VALUE_COLOR: &str = "\x1b[0;94m"; - const DISABLED_VALUE_COLOR: &str = "\x1b[0;90m"; - const ENTRY_COLOR: &str = "\x1b[0;37m"; - const DISABLED_ENTRY_COLOR: &str = "\x1b[0;90m"; - const COLOR_RESET: &str = "\x1b[0m"; - - println!("{}posix system configuration{}", HEADER_COLOR, COLOR_RESET); - println!(); - println!(" {}system info{}", HEADER_COLOR, COLOR_RESET); - for i in all::().collect::>() { - println!( - " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.value(), - ); - } - - println!(); - println!(" {}limits{}", HEADER_COLOR, COLOR_RESET); - for i in all::().collect::>() { - let limit = i.value(); - let limit = if limit == 0 { - "[ unlimited ]".to_string() - } else { - limit.to_string() - }; - println!( - " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - limit, - ); - } - - println!(); - println!(" {}options{}", HEADER_COLOR, COLOR_RESET); - for i in all::().collect::>() { - if i.is_available() { - println!( - " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.is_available(), - ); - } else { - println!( - " {DISABLED_ENTRY_COLOR}{:<50}{COLOR_RESET} {DISABLED_VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.is_available(), - ); - } - } - - println!(); - println!(" {}features{}", HEADER_COLOR, COLOR_RESET); - for i in all::().collect::>() { - if i.is_available() { - println!( - " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.is_available(), - ); - } else { - println!( - " {DISABLED_ENTRY_COLOR}{:<50}{COLOR_RESET} {DISABLED_VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.is_available(), - ); - } - } - - println!(); - println!(" {}process resource limits{}", HEADER_COLOR, COLOR_RESET); - for i in all::().collect::>() { - println!( - " {ENTRY_COLOR}{:<43}{COLOR_RESET} soft: {VALUE_COLOR}{:<24}{COLOR_RESET} hard: {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.soft_limit(), - i.hard_limit() - ); - } -} diff --git a/iceoryx2-cli/Cargo.toml b/iceoryx2-cli/Cargo.toml index 5ad763383..1411eccb2 100644 --- a/iceoryx2-cli/Cargo.toml +++ b/iceoryx2-cli/Cargo.toml @@ -26,6 +26,10 @@ path = "iox2-node/src/main.rs" name = "iox2-service" path = "iox2-service/src/main.rs" +[[bin]] +name = "iox2-config" +path = "iox2-config/src/main.rs" + [lib] name = "iceoryx2_cli" path = "lib/src/lib.rs" @@ -34,17 +38,22 @@ path = "lib/src/lib.rs" iceoryx2 = { workspace = true } iceoryx2-bb-log = { workspace = true } iceoryx2-pal-posix = {workspace = true} +iceoryx2-bb-posix = {workspace = true} +iceoryx2-bb-system-types = { workspace = true } +iceoryx2-bb-container ={ workspace = true } anyhow = { workspace = true } better-panic = { workspace = true } cargo_metadata = { workspace = true } clap = { workspace = true } colored = { workspace = true } +enum-iterator = { workspace = true } human-panic = { workspace = true } serde = { workspace = true } serde_yaml = { workspace = true } serde_json = { workspace = true } ron = { workspace = true } +toml = { workspace = true } [dev-dependencies] iceoryx2-bb-testing = { workspace = true } diff --git a/iceoryx2-cli/iox2-config/src/cli.rs b/iceoryx2-cli/iox2-config/src/cli.rs new file mode 100644 index 000000000..c217e20c0 --- /dev/null +++ b/iceoryx2-cli/iox2-config/src/cli.rs @@ -0,0 +1,40 @@ +// Copyright (c) 2024 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache Software License 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license +// which is available at https://opensource.org/licenses/MIT. +// +// SPDX-License-Identifier: Apache-2.0 OR MIT + + +use clap::Parser; +use clap::Subcommand; + +use iceoryx2_cli::help_template; + +#[derive(Parser)] +#[command( + name = "iox2-config", + about = "Query information about iceoryx2 configuration", + long_about = None, + version = env!("CARGO_PKG_VERSION"), + disable_help_subcommand = true, + arg_required_else_help = false, + help_template = help_template("iox2 config", false), +)] +pub struct Cli { + #[clap(subcommand)] + pub action: Option, +} + +#[derive(Subcommand)] +pub enum Action { + #[clap(about = "Show the currently used configuration")] + Show, + #[clap(about = "Generate a default configuration file")] + Generate, +} diff --git a/iceoryx2-cli/iox2-config/src/commands.rs b/iceoryx2-cli/iox2-config/src/commands.rs new file mode 100644 index 000000000..1274ae1cd --- /dev/null +++ b/iceoryx2-cli/iox2-config/src/commands.rs @@ -0,0 +1,124 @@ +// Copyright (c) 2024 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache Software License 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license +// which is available at https://opensource.org/licenses/MIT. +// +// SPDX-License-Identifier: Apache-2.0 OR MIT + +use anyhow::Result; +use iceoryx2_bb_posix::system_configuration::*; +use enum_iterator::all; +use iceoryx2::config::Config; +use std::fs::File; +use std::io::Write; +use std::path::Path; + +/// Prints the whole system configuration with all limits, features and details to the console. +pub fn print_system_configuration() { + const HEADER_COLOR: &str = "\x1b[4;92m"; + const VALUE_COLOR: &str = "\x1b[0;94m"; + const DISABLED_VALUE_COLOR: &str = "\x1b[0;90m"; + const ENTRY_COLOR: &str = "\x1b[0;37m"; + const DISABLED_ENTRY_COLOR: &str = "\x1b[0;90m"; + const COLOR_RESET: &str = "\x1b[0m"; + + println!("{}posix system configuration{}", HEADER_COLOR, COLOR_RESET); + println!(); + println!(" {}system info{}", HEADER_COLOR, COLOR_RESET); + for i in all::().collect::>() { + println!( + " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", + format!("{:?}", i), + i.value(), + ); + } + + println!(); + println!(" {}limits{}", HEADER_COLOR, COLOR_RESET); + for i in all::().collect::>() { + let limit = i.value(); + let limit = if limit == 0 { + "[ unlimited ]".to_string() + } else { + limit.to_string() + }; + println!( + " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", + format!("{:?}", i), + limit, + ); + } + + println!(); + println!(" {}options{}", HEADER_COLOR, COLOR_RESET); + for i in all::().collect::>() { + if i.is_available() { + println!( + " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", + format!("{:?}", i), + i.is_available(), + ); + } else { + println!( + " {DISABLED_ENTRY_COLOR}{:<50}{COLOR_RESET} {DISABLED_VALUE_COLOR}{}{COLOR_RESET}", + format!("{:?}", i), + i.is_available(), + ); + } + } + + println!(); + println!(" {}features{}", HEADER_COLOR, COLOR_RESET); + for i in all::().collect::>() { + if i.is_available() { + println!( + " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", + format!("{:?}", i), + i.is_available(), + ); + } else { + println!( + " {DISABLED_ENTRY_COLOR}{:<50}{COLOR_RESET} {DISABLED_VALUE_COLOR}{}{COLOR_RESET}", + format!("{:?}", i), + i.is_available(), + ); + } + } + + println!(); + println!(" {}process resource limits{}", HEADER_COLOR, COLOR_RESET); + for i in all::().collect::>() { + println!( + " {ENTRY_COLOR}{:<43}{COLOR_RESET} soft: {VALUE_COLOR}{:<24}{COLOR_RESET} hard: {VALUE_COLOR}{}{COLOR_RESET}", + format!("{:?}", i), + i.soft_limit(), + i.hard_limit() + ); + } +} + +pub fn show() -> Result<()> { + print_system_configuration(); + + Ok(()) +} + +pub fn generate() -> Result<()> { + let default_file_path = Path::new("config/iceoryx2.toml"); + + let default_config = Config::default(); + + let toml_string = toml::to_string_pretty(&default_config)?; + + let mut file = File::create(&default_file_path)?; + file.write_all(toml_string.as_bytes())?; + + println!("Default configuration is generated at {}", default_file_path.display()); + + Ok(()) +} diff --git a/iceoryx2-cli/iox2-config/src/main.rs b/iceoryx2-cli/iox2-config/src/main.rs new file mode 100644 index 000000000..d0f115ad2 --- /dev/null +++ b/iceoryx2-cli/iox2-config/src/main.rs @@ -0,0 +1,69 @@ + +// Copyright (c) 2024 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache Software License 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license +// which is available at https://opensource.org/licenses/MIT. +// +// SPDX-License-Identifier: Apache-2.0 OR MIT + +mod cli; +mod commands; + +use clap::CommandFactory; +use clap::Parser; +use cli::Action; +use cli::Cli; +use iceoryx2_bb_log::{set_log_level, LogLevel}; + +#[cfg(not(debug_assertions))] +use human_panic::setup_panic; +#[cfg(debug_assertions)] +extern crate better_panic; + +fn main() { + #[cfg(not(debug_assertions))] + { + setup_panic!(); + } + #[cfg(debug_assertions)] + { + better_panic::Settings::debug() + .most_recent_first(false) + .lineno_suffix(true) + .verbosity(better_panic::Verbosity::Full) + .install(); + } + + set_log_level(LogLevel::Warn); + + match Cli::try_parse() { + Ok(cli) => { + if let Some(action) = cli.action { + match action { + Action::Show => { + if let Err(e) = commands::show() + { + eprintln!("Failed to show options: {}", e); + } + } + Action::Generate => { + if let Err(e) = commands::generate() + { + eprintln!("Failed to generate default configuration: {}", e); + } + } + } + } else { + Cli::command().print_help().expect("Failed to print help"); + } + } + Err(e) => { + eprintln!("{}", e); + } + } +} From 2c1797c47de2ba218c803e67a87164b230ae29ec Mon Sep 17 00:00:00 2001 From: Bruce Rosier Date: Tue, 15 Oct 2024 00:18:05 +0200 Subject: [PATCH 2/8] [#432] Implement CLI iox2-config --- iceoryx2-cli/iox2-config/src/cli.rs | 1 - iceoryx2-cli/iox2-config/src/commands.rs | 7 +++++-- iceoryx2-cli/iox2-config/src/main.rs | 7 ++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/iceoryx2-cli/iox2-config/src/cli.rs b/iceoryx2-cli/iox2-config/src/cli.rs index c217e20c0..d6af1c26e 100644 --- a/iceoryx2-cli/iox2-config/src/cli.rs +++ b/iceoryx2-cli/iox2-config/src/cli.rs @@ -10,7 +10,6 @@ // // SPDX-License-Identifier: Apache-2.0 OR MIT - use clap::Parser; use clap::Subcommand; diff --git a/iceoryx2-cli/iox2-config/src/commands.rs b/iceoryx2-cli/iox2-config/src/commands.rs index 1274ae1cd..5967bf1ed 100644 --- a/iceoryx2-cli/iox2-config/src/commands.rs +++ b/iceoryx2-cli/iox2-config/src/commands.rs @@ -11,9 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use anyhow::Result; -use iceoryx2_bb_posix::system_configuration::*; use enum_iterator::all; use iceoryx2::config::Config; +use iceoryx2_bb_posix::system_configuration::*; use std::fs::File; use std::io::Write; use std::path::Path; @@ -118,7 +118,10 @@ pub fn generate() -> Result<()> { let mut file = File::create(&default_file_path)?; file.write_all(toml_string.as_bytes())?; - println!("Default configuration is generated at {}", default_file_path.display()); + println!( + "Default configuration is generated at {}", + default_file_path.display() + ); Ok(()) } diff --git a/iceoryx2-cli/iox2-config/src/main.rs b/iceoryx2-cli/iox2-config/src/main.rs index d0f115ad2..178377d83 100644 --- a/iceoryx2-cli/iox2-config/src/main.rs +++ b/iceoryx2-cli/iox2-config/src/main.rs @@ -1,4 +1,3 @@ - // Copyright (c) 2024 Contributors to the Eclipse Foundation // // See the NOTICE file(s) distributed with this work for additional @@ -46,14 +45,12 @@ fn main() { if let Some(action) = cli.action { match action { Action::Show => { - if let Err(e) = commands::show() - { + if let Err(e) = commands::show() { eprintln!("Failed to show options: {}", e); } } Action::Generate => { - if let Err(e) = commands::generate() - { + if let Err(e) = commands::generate() { eprintln!("Failed to generate default configuration: {}", e); } } From ecd086feb6928fd68845954694fff5f03c0a190c Mon Sep 17 00:00:00 2001 From: Bruce Rosier <71630425+brosier01@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:40:46 +0200 Subject: [PATCH 3/8] Update doc/release-notes/iceoryx2-unreleased.md Co-authored-by: orecham --- doc/release-notes/iceoryx2-unreleased.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-notes/iceoryx2-unreleased.md b/doc/release-notes/iceoryx2-unreleased.md index a0da9e98d..1ffd038fb 100644 --- a/doc/release-notes/iceoryx2-unreleased.md +++ b/doc/release-notes/iceoryx2-unreleased.md @@ -8,7 +8,7 @@ Create a new CLI for iceoryx2 `iox2-config` -`iox2-config` can `show` the configuration currently in use and `generate` a new +`iox2 config` can `show` the configuration currently in use and `generate` a new configuration file at the default location iceoryx2 is looking for. * Add CLI to display complete system configuration [#432](https://github.com/eclipse-iceoryx/iceoryx2/issues/432) From 624ee0c17f2abaf881f9f928abb71389835dcd05 Mon Sep 17 00:00:00 2001 From: Bruce Rosier <71630425+brosier01@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:49:29 +0200 Subject: [PATCH 4/8] Update doc/release-notes/iceoryx2-unreleased.md Co-authored-by: orecham --- doc/release-notes/iceoryx2-unreleased.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-notes/iceoryx2-unreleased.md b/doc/release-notes/iceoryx2-unreleased.md index 1ffd038fb..7f7fe53ce 100644 --- a/doc/release-notes/iceoryx2-unreleased.md +++ b/doc/release-notes/iceoryx2-unreleased.md @@ -24,5 +24,5 @@ Remove the `print_system_configuration()` function in ```bash cargo run --bin iox2-config show - cargo run --bin iox2-config generate + iox2 config generate ``` From 74ad90f0201f0af09c2af697e0a6a4a85380ec55 Mon Sep 17 00:00:00 2001 From: Bruce Rosier Date: Wed, 16 Oct 2024 00:19:18 +0200 Subject: [PATCH 5/8] [#432] Set default location for default configuration file --- Cargo.toml | 1 + iceoryx2-bb/posix/src/system_configuration.rs | 2 +- iceoryx2-cli/Cargo.toml | 1 + iceoryx2-cli/iox2-config/src/commands.rs | 10 +++++----- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9971a7ed6..b38cc6ca6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -102,6 +102,7 @@ thiserror = { version = "1.0.56" } tiny-fn = { version = "0.1.6" } toml = { version = "0.8.13" } tracing = { version = "0.1.40" } +dirs = { version = "5.0" } windows-sys = { version = "0.48.0", features = ["Win32_Security", "Win32_Security_Authorization", "Win32_System_Memory", "Win32_System_Threading", "Win32_Foundation", "Win32_System_WindowsProgramming", "Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_Diagnostics_Debug", "Win32_System_SystemInformation", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Console", "Win32_Networking_WinSock", "Win32_System_SystemServices", "Win32_System_ProcessStatus"] } diff --git a/iceoryx2-bb/posix/src/system_configuration.rs b/iceoryx2-bb/posix/src/system_configuration.rs index dd49f825b..12ace09c5 100644 --- a/iceoryx2-bb/posix/src/system_configuration.rs +++ b/iceoryx2-bb/posix/src/system_configuration.rs @@ -13,7 +13,7 @@ //! Provides information about the POSIX [`SystemInfo`], [`Limit`]s, available [`SysOption`] and //! [`Feature`]s. -use enum_iterator::{all, Sequence}; +use enum_iterator::Sequence; use iceoryx2_bb_log::{fatal_panic, warn}; use iceoryx2_pal_posix::posix::Struct; use iceoryx2_pal_posix::*; diff --git a/iceoryx2-cli/Cargo.toml b/iceoryx2-cli/Cargo.toml index 1411eccb2..b2379e95f 100644 --- a/iceoryx2-cli/Cargo.toml +++ b/iceoryx2-cli/Cargo.toml @@ -54,6 +54,7 @@ serde_yaml = { workspace = true } serde_json = { workspace = true } ron = { workspace = true } toml = { workspace = true } +dirs = { workspace = true } [dev-dependencies] iceoryx2-bb-testing = { workspace = true } diff --git a/iceoryx2-cli/iox2-config/src/commands.rs b/iceoryx2-cli/iox2-config/src/commands.rs index 5967bf1ed..f5bed05e7 100644 --- a/iceoryx2-cli/iox2-config/src/commands.rs +++ b/iceoryx2-cli/iox2-config/src/commands.rs @@ -14,9 +14,8 @@ use anyhow::Result; use enum_iterator::all; use iceoryx2::config::Config; use iceoryx2_bb_posix::system_configuration::*; -use std::fs::File; +use std::fs::{self, File}; use std::io::Write; -use std::path::Path; /// Prints the whole system configuration with all limits, features and details to the console. pub fn print_system_configuration() { @@ -109,11 +108,12 @@ pub fn show() -> Result<()> { } pub fn generate() -> Result<()> { - let default_file_path = Path::new("config/iceoryx2.toml"); + let config_dir = dirs::config_dir().unwrap().join("iceoryx2/"); + fs::create_dir_all(&config_dir)?; - let default_config = Config::default(); + let default_file_path = config_dir.join("config.toml"); - let toml_string = toml::to_string_pretty(&default_config)?; + let toml_string = toml::to_string_pretty(&Config::default())?; let mut file = File::create(&default_file_path)?; file.write_all(toml_string.as_bytes())?; From b96b5f7c33d7426891c2aed390d15f6d96b40db7 Mon Sep 17 00:00:00 2001 From: Bruce Rosier Date: Thu, 17 Oct 2024 23:36:49 +0200 Subject: [PATCH 6/8] [#432] Fix print_system_configuration for cross-platform coloring + implementation of user confirmation required before deleting current configuration file --- Cargo.toml | 33 ++++++-- iceoryx2-cli/Cargo.toml | 7 +- iceoryx2-cli/iox2-config/src/commands.rs | 99 ++++++++++++++---------- 3 files changed, 89 insertions(+), 50 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b38cc6ca6..a3b1d8f6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ members = [ "examples", "benchmarks/publish-subscribe", - "benchmarks/event" + "benchmarks/event", ] [workspace.package] @@ -35,7 +35,13 @@ categories = ["network-programming"] description = "iceoryx2: Lock-Free Zero-Copy Interprocess Communication" edition = "2021" homepage = "https://iceoryx.io" -keywords = ["zero-copy", "communication", "ipc", "publish-subscribe", "request-response"] +keywords = [ + "zero-copy", + "communication", + "ipc", + "publish-subscribe", + "request-response", +] license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/eclipse-iceoryx/iceoryx2" @@ -66,8 +72,7 @@ iceoryx2-ffi-macros = { version = "0.4.1", path = "iceoryx2-ffi/ffi-macros" } iceoryx2 = { version = "0.4.1", path = "iceoryx2/" } -iceoryx2-cli = { version = "0.4.1", path = "iceoryx2_cli/"} - +iceoryx2-cli = { version = "0.4.1", path = "iceoryx2_cli/" } anyhow = { version = "1.0.86" } @@ -103,8 +108,24 @@ tiny-fn = { version = "0.1.6" } toml = { version = "0.8.13" } tracing = { version = "0.1.40" } dirs = { version = "5.0" } -windows-sys = { version = "0.48.0", features = ["Win32_Security", "Win32_Security_Authorization", "Win32_System_Memory", "Win32_System_Threading", "Win32_Foundation", "Win32_System_WindowsProgramming", "Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_Diagnostics_Debug", "Win32_System_SystemInformation", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Console", "Win32_Networking_WinSock", -"Win32_System_SystemServices", "Win32_System_ProcessStatus"] } +dialoguer = { version = "0.8.0" } +windows-sys = { version = "0.48.0", features = [ + "Win32_Security", + "Win32_Security_Authorization", + "Win32_System_Memory", + "Win32_System_Threading", + "Win32_Foundation", + "Win32_System_WindowsProgramming", + "Win32_Storage_FileSystem", + "Win32_System_IO", + "Win32_System_Diagnostics_Debug", + "Win32_System_SystemInformation", + "Win32_System_Diagnostics_ToolHelp", + "Win32_System_Console", + "Win32_Networking_WinSock", + "Win32_System_SystemServices", + "Win32_System_ProcessStatus", +] } [profile.release] strip = true diff --git a/iceoryx2-cli/Cargo.toml b/iceoryx2-cli/Cargo.toml index b2379e95f..5c4a10e7f 100644 --- a/iceoryx2-cli/Cargo.toml +++ b/iceoryx2-cli/Cargo.toml @@ -37,10 +37,10 @@ path = "lib/src/lib.rs" [dependencies] iceoryx2 = { workspace = true } iceoryx2-bb-log = { workspace = true } -iceoryx2-pal-posix = {workspace = true} -iceoryx2-bb-posix = {workspace = true} +iceoryx2-pal-posix = { workspace = true } +iceoryx2-bb-posix = { workspace = true } iceoryx2-bb-system-types = { workspace = true } -iceoryx2-bb-container ={ workspace = true } +iceoryx2-bb-container = { workspace = true } anyhow = { workspace = true } better-panic = { workspace = true } @@ -55,6 +55,7 @@ serde_json = { workspace = true } ron = { workspace = true } toml = { workspace = true } dirs = { workspace = true } +dialoguer = { workspace = true } [dev-dependencies] iceoryx2-bb-testing = { workspace = true } diff --git a/iceoryx2-cli/iox2-config/src/commands.rs b/iceoryx2-cli/iox2-config/src/commands.rs index f5bed05e7..adcd2a7f7 100644 --- a/iceoryx2-cli/iox2-config/src/commands.rs +++ b/iceoryx2-cli/iox2-config/src/commands.rs @@ -11,34 +11,33 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use anyhow::Result; +use colored::Colorize; +use dialoguer::Confirm; use enum_iterator::all; use iceoryx2::config::Config; use iceoryx2_bb_posix::system_configuration::*; use std::fs::{self, File}; use std::io::Write; +use std::panic::catch_unwind; /// Prints the whole system configuration with all limits, features and details to the console. pub fn print_system_configuration() { - const HEADER_COLOR: &str = "\x1b[4;92m"; - const VALUE_COLOR: &str = "\x1b[0;94m"; - const DISABLED_VALUE_COLOR: &str = "\x1b[0;90m"; - const ENTRY_COLOR: &str = "\x1b[0;37m"; - const DISABLED_ENTRY_COLOR: &str = "\x1b[0;90m"; - const COLOR_RESET: &str = "\x1b[0m"; - - println!("{}posix system configuration{}", HEADER_COLOR, COLOR_RESET); + println!( + "{}", + "posix system configuration".underline().bright_green() + ); println!(); - println!(" {}system info{}", HEADER_COLOR, COLOR_RESET); + println!(" {}", "system info".underline().bright_green()); for i in all::().collect::>() { println!( - " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.value(), + " {:<50} {}", + format!("{:?}", i).white(), + format!("{}", i.value()).bright_blue(), ); } println!(); - println!(" {}limits{}", HEADER_COLOR, COLOR_RESET); + println!(" {}", "limit".underline().bright_green()); for i in all::().collect::>() { let limit = i.value(); let limit = if limit == 0 { @@ -47,57 +46,63 @@ pub fn print_system_configuration() { limit.to_string() }; println!( - " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - limit, + " {:<50} {}", + format!("{:?}", i).white(), + limit.bright_blue(), ); } println!(); - println!(" {}options{}", HEADER_COLOR, COLOR_RESET); + println!(" {}", "options".underline().bright_green()); for i in all::().collect::>() { if i.is_available() { println!( - " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.is_available(), + " {:<50} {}", + format!("{:?}", i).white(), + format!("{}", i.is_available()).bright_blue() ); } else { - println!( - " {DISABLED_ENTRY_COLOR}{:<50}{COLOR_RESET} {DISABLED_VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.is_available(), - ); + println!(" {:<50} {}", format!("{:?}", i), i.is_available(),); } } println!(); - println!(" {}features{}", HEADER_COLOR, COLOR_RESET); + println!(" {}", "features".underline().bright_green()); for i in all::().collect::>() { if i.is_available() { println!( - " {ENTRY_COLOR}{:<50}{COLOR_RESET} {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.is_available(), + " {:<50} {}", + format!("{:?}", i).white(), + format!("{}", i.is_available()).bright_blue(), ); } else { - println!( - " {DISABLED_ENTRY_COLOR}{:<50}{COLOR_RESET} {DISABLED_VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.is_available(), - ); + println!(" {:<50} {}", format!("{:?}", i), i.is_available(),); } } println!(); - println!(" {}process resource limits{}", HEADER_COLOR, COLOR_RESET); + println!(" {}", "process resource limits".underline().bright_green()); for i in all::().collect::>() { - println!( - " {ENTRY_COLOR}{:<43}{COLOR_RESET} soft: {VALUE_COLOR}{:<24}{COLOR_RESET} hard: {VALUE_COLOR}{}{COLOR_RESET}", - format!("{:?}", i), - i.soft_limit(), - i.hard_limit() - ); + let soft_limit_result = catch_unwind(|| i.soft_limit()); + let hard_limit_result = catch_unwind(|| i.hard_limit()); + + match (soft_limit_result, hard_limit_result) { + (Ok(soft), Ok(hard)) => { + println!( + " {:<43} soft: {:<24} hard: {}", + format!("{:?}", i).white(), + format!("{}", soft).bright_blue(), + format!("{}", hard).bright_blue() + ); + } + (Err(e), _) | (_, Err(e)) => { + println!( + " {:<43} Error: {}", + format!("{:?}", i).white(), + format!("Unable to acquire limit due to: {:?}", e).red() + ); + } + } } } @@ -113,6 +118,18 @@ pub fn generate() -> Result<()> { let default_file_path = config_dir.join("config.toml"); + if default_file_path.exists() { + let proceed = Confirm::new() + .with_prompt("Configuration file already exists. Do you want to overwrite it?") + .default(false) + .interact()?; + + if !proceed { + println!("Operation cancelled. Configuration file was not overwritten."); + return Ok(()); + } + } + let toml_string = toml::to_string_pretty(&Config::default())?; let mut file = File::create(&default_file_path)?; From f6558d0cdad65b99cc4a3bc303e1af90c48ab97e Mon Sep 17 00:00:00 2001 From: Bruce Rosier Date: Mon, 21 Oct 2024 23:28:47 +0200 Subject: [PATCH 7/8] [#432] Replace the relative path of the configuration file with the standard configuration path --- iceoryx2-cli/iox2-config/src/commands.rs | 2 +- iceoryx2/Cargo.toml | 1 + iceoryx2/src/config.rs | 16 +++++++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/iceoryx2-cli/iox2-config/src/commands.rs b/iceoryx2-cli/iox2-config/src/commands.rs index adcd2a7f7..3d19e04a5 100644 --- a/iceoryx2-cli/iox2-config/src/commands.rs +++ b/iceoryx2-cli/iox2-config/src/commands.rs @@ -113,7 +113,7 @@ pub fn show() -> Result<()> { } pub fn generate() -> Result<()> { - let config_dir = dirs::config_dir().unwrap().join("iceoryx2/"); + let config_dir = dirs::config_dir().unwrap().join("iceoryx2"); fs::create_dir_all(&config_dir)?; let default_file_path = config_dir.join("config.toml"); diff --git a/iceoryx2/Cargo.toml b/iceoryx2/Cargo.toml index bf052f7b3..fa71108d1 100644 --- a/iceoryx2/Cargo.toml +++ b/iceoryx2/Cargo.toml @@ -35,6 +35,7 @@ cdr = { workspace = true } toml = { workspace = true } sha1_smol = { workspace = true } tiny-fn = { workspace = true } +dirs = { workspace = true } [dev-dependencies] iceoryx2-bb-testing = { workspace = true } diff --git a/iceoryx2/src/config.rs b/iceoryx2/src/config.rs index 4f7851240..9f83e3e0c 100644 --- a/iceoryx2/src/config.rs +++ b/iceoryx2/src/config.rs @@ -69,6 +69,7 @@ //! # } //! ``` +use dirs; use iceoryx2_bb_container::semantic_string::SemanticString; use iceoryx2_bb_elementary::lazy_singleton::*; use iceoryx2_bb_posix::{file::FileBuilder, shared_memory::AccessMode}; @@ -76,15 +77,12 @@ use iceoryx2_bb_system_types::file_name::FileName; use iceoryx2_bb_system_types::file_path::FilePath; use iceoryx2_bb_system_types::path::Path; use serde::{Deserialize, Serialize}; -use std::time::Duration; +use std::{os::unix::ffi::OsStrExt, time::Duration}; use iceoryx2_bb_log::{fail, trace, warn}; use crate::service::port_factory::publisher::UnableToDeliverStrategy; -/// Path to the default config file -pub const DEFAULT_CONFIG_FILE: &[u8] = b"config/iceoryx2.toml"; - /// Failures occurring while creating a new [`Config`] object with [`Config::from_file()`] or /// [`Config::setup_global_config_from_file()`] #[derive(Debug, Clone, Copy, Eq, Hash, PartialEq)] @@ -394,10 +392,18 @@ impl Config { /// [`Config::setup_global_config_from_file()`] /// is called after this function was called, no file will be loaded since the global default /// config was already populated. + pub fn global_config() -> &'static Config { if !ICEORYX2_CONFIG.is_initialized() && Config::setup_global_config_from_file(unsafe { - &FilePath::new_unchecked(DEFAULT_CONFIG_FILE) + &FilePath::new_unchecked( + dirs::config_dir() + .unwrap() + .join("iceoryx2") + .join("config.toml") + .as_os_str() + .as_bytes(), + ) }) .is_err() { From 41d20b8cbc1e173e96eecbd44b85762404599e6d Mon Sep 17 00:00:00 2001 From: Bruce Rosier Date: Sat, 9 Nov 2024 20:27:57 +0100 Subject: [PATCH 8/8] [#432] Add an abstraction layer to obtain the path to the configuration file + add a subcommand to display the contents of the configuration file --- doc/release-notes/iceoryx2-unreleased.md | 9 ++++-- iceoryx2-cal/Cargo.toml | 1 + iceoryx2-cal/src/config_path/mod.rs | 35 ++++++++++++++++++++++ iceoryx2-cal/src/lib.rs | 1 + iceoryx2-cli/Cargo.toml | 1 + iceoryx2-cli/iox2-config/src/cli.rs | 28 +++++++++++++++++- iceoryx2-cli/iox2-config/src/commands.rs | 16 ++++++++-- iceoryx2-cli/iox2-config/src/main.rs | 22 +++++++++++--- iceoryx2/Cargo.toml | 1 - iceoryx2/src/config.rs | 37 +++++++++++++----------- 10 files changed, 123 insertions(+), 28 deletions(-) create mode 100644 iceoryx2-cal/src/config_path/mod.rs diff --git a/doc/release-notes/iceoryx2-unreleased.md b/doc/release-notes/iceoryx2-unreleased.md index 7f7fe53ce..07ff6389b 100644 --- a/doc/release-notes/iceoryx2-unreleased.md +++ b/doc/release-notes/iceoryx2-unreleased.md @@ -8,7 +8,8 @@ Create a new CLI for iceoryx2 `iox2-config` -`iox2 config` can `show` the configuration currently in use and `generate` a new +`iox2 config` can `show` the configuration of iceoryx currently in use +or `show` the configuration of the sytem and `generate` a new configuration file at the default location iceoryx2 is looking for. * Add CLI to display complete system configuration [#432](https://github.com/eclipse-iceoryx/iceoryx2/issues/432) @@ -22,7 +23,9 @@ Remove the `print_system_configuration()` function in ### New CLI features ```bash - cargo run --bin iox2-config show + iox2-config show system - iox2 config generate + iox2-config show current + + iox2-config generate ``` diff --git a/iceoryx2-cal/Cargo.toml b/iceoryx2-cal/Cargo.toml index 2600d239b..55511bf88 100644 --- a/iceoryx2-cal/Cargo.toml +++ b/iceoryx2-cal/Cargo.toml @@ -22,6 +22,7 @@ iceoryx2-bb-threadsafe = { workspace = true } iceoryx2-bb-testing = { workspace = true } iceoryx2-pal-concurrency-sync = { workspace = true } +dirs = { workspace = true } once_cell = { workspace = true } lazy_static = { workspace = true } serde = { workspace = true } diff --git a/iceoryx2-cal/src/config_path/mod.rs b/iceoryx2-cal/src/config_path/mod.rs new file mode 100644 index 000000000..1a58d9de1 --- /dev/null +++ b/iceoryx2-cal/src/config_path/mod.rs @@ -0,0 +1,35 @@ +// Copyright (c) 2024 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available under the +// terms of the Apache Software License 2.0 which is available at +// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license +// which is available at https://opensource.org/licenses/MIT. +// +// SPDX-License-Identifier: Apache-2.0 OR MIT + +//! use iceoryx2_cal::config_path::config_dir; +//! +//! let config_dir = config_dir().unwrap(); +//! println!("Config dir: {:?}", config_dir); + +use dirs; + +pub trait ConfigPathProvider { + fn config_dir(&self) -> Option; +} + +pub struct DirsConfigPathProvider; + +impl ConfigPathProvider for DirsConfigPathProvider { + fn config_dir(&self) -> Option { + dirs::config_dir() + } +} + +pub fn config_dir() -> Option { + let provider = DirsConfigPathProvider; + provider.config_dir() +} diff --git a/iceoryx2-cal/src/lib.rs b/iceoryx2-cal/src/lib.rs index 69b6a2ae8..1694b7422 100644 --- a/iceoryx2-cal/src/lib.rs +++ b/iceoryx2-cal/src/lib.rs @@ -11,6 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT pub mod communication_channel; +pub mod config_path; pub mod dynamic_storage; pub mod event; pub mod hash; diff --git a/iceoryx2-cli/Cargo.toml b/iceoryx2-cli/Cargo.toml index 5c4a10e7f..c803b5b4f 100644 --- a/iceoryx2-cli/Cargo.toml +++ b/iceoryx2-cli/Cargo.toml @@ -41,6 +41,7 @@ iceoryx2-pal-posix = { workspace = true } iceoryx2-bb-posix = { workspace = true } iceoryx2-bb-system-types = { workspace = true } iceoryx2-bb-container = { workspace = true } +iceoryx2-cal = { workspace = true } anyhow = { workspace = true } better-panic = { workspace = true } diff --git a/iceoryx2-cli/iox2-config/src/cli.rs b/iceoryx2-cli/iox2-config/src/cli.rs index d6af1c26e..4dc524c02 100644 --- a/iceoryx2-cli/iox2-config/src/cli.rs +++ b/iceoryx2-cli/iox2-config/src/cli.rs @@ -30,10 +30,36 @@ pub struct Cli { pub action: Option, } +#[derive(Parser)] +#[command( + name = "iox2-config", + about = "Query information about iceoryx2 configuration", + long_about = None, + version = env!("CARGO_PKG_VERSION"), + disable_help_subcommand = true, + arg_required_else_help = false, + help_template = help_template("iox2 config show", false), +)] +pub struct Config { + #[clap(subcommand)] + pub action: Option, +} + +#[derive(Subcommand, Debug)] +pub enum ShowSubcommand { + #[clap(about = "Show system configuration")] + System, + #[clap(about = "Show current iceoryx2 configuration")] + Current, +} + #[derive(Subcommand)] pub enum Action { #[clap(about = "Show the currently used configuration")] - Show, + Show { + #[clap(subcommand)] + subcommand: Option, + }, #[clap(about = "Generate a default configuration file")] Generate, } diff --git a/iceoryx2-cli/iox2-config/src/commands.rs b/iceoryx2-cli/iox2-config/src/commands.rs index 3d19e04a5..8c8074240 100644 --- a/iceoryx2-cli/iox2-config/src/commands.rs +++ b/iceoryx2-cli/iox2-config/src/commands.rs @@ -16,6 +16,7 @@ use dialoguer::Confirm; use enum_iterator::all; use iceoryx2::config::Config; use iceoryx2_bb_posix::system_configuration::*; +use iceoryx2_cal::config_path::config_dir; use std::fs::{self, File}; use std::io::Write; use std::panic::catch_unwind; @@ -106,14 +107,25 @@ pub fn print_system_configuration() { } } -pub fn show() -> Result<()> { +pub fn show_system_config() -> Result<()> { print_system_configuration(); Ok(()) } +pub fn show_current_config() -> Result<()> { + let config = Config::global_config(); + let json_config = serde_json::to_value(config).unwrap_or_else(|_| serde_json::json!({})); + let toml_config = toml::to_string_pretty(&json_config) + .unwrap_or_else(|_| "Failed to convert to TOML".to_string()); + + println!("{}", toml_config); + + Ok(()) +} + pub fn generate() -> Result<()> { - let config_dir = dirs::config_dir().unwrap().join("iceoryx2"); + let config_dir = config_dir().unwrap().join("iceoryx2"); fs::create_dir_all(&config_dir)?; let default_file_path = config_dir.join("config.toml"); diff --git a/iceoryx2-cli/iox2-config/src/main.rs b/iceoryx2-cli/iox2-config/src/main.rs index 178377d83..e1ce94b2c 100644 --- a/iceoryx2-cli/iox2-config/src/main.rs +++ b/iceoryx2-cli/iox2-config/src/main.rs @@ -17,6 +17,8 @@ use clap::CommandFactory; use clap::Parser; use cli::Action; use cli::Cli; +use cli::Config; +use cli::ShowSubcommand; use iceoryx2_bb_log::{set_log_level, LogLevel}; #[cfg(not(debug_assertions))] @@ -44,11 +46,23 @@ fn main() { Ok(cli) => { if let Some(action) = cli.action { match action { - Action::Show => { - if let Err(e) = commands::show() { - eprintln!("Failed to show options: {}", e); + Action::Show { subcommand } => match subcommand { + Some(ShowSubcommand::System) => { + if let Err(e) = commands::show_system_config() { + eprintln!("Failed to show options: {}", e); + } } - } + Some(ShowSubcommand::Current) => { + if let Err(e) = commands::show_current_config() { + eprintln!("Failed to show options: {}", e); + } + } + None => { + Config::command() + .print_help() + .expect("Failed to print help"); + } + }, Action::Generate => { if let Err(e) = commands::generate() { eprintln!("Failed to generate default configuration: {}", e); diff --git a/iceoryx2/Cargo.toml b/iceoryx2/Cargo.toml index fa71108d1..bf052f7b3 100644 --- a/iceoryx2/Cargo.toml +++ b/iceoryx2/Cargo.toml @@ -35,7 +35,6 @@ cdr = { workspace = true } toml = { workspace = true } sha1_smol = { workspace = true } tiny-fn = { workspace = true } -dirs = { workspace = true } [dev-dependencies] iceoryx2-bb-testing = { workspace = true } diff --git a/iceoryx2/src/config.rs b/iceoryx2/src/config.rs index 9f83e3e0c..56cb103f7 100644 --- a/iceoryx2/src/config.rs +++ b/iceoryx2/src/config.rs @@ -69,20 +69,23 @@ //! # } //! ``` -use dirs; use iceoryx2_bb_container::semantic_string::SemanticString; use iceoryx2_bb_elementary::lazy_singleton::*; use iceoryx2_bb_posix::{file::FileBuilder, shared_memory::AccessMode}; use iceoryx2_bb_system_types::file_name::FileName; use iceoryx2_bb_system_types::file_path::FilePath; use iceoryx2_bb_system_types::path::Path; +use iceoryx2_cal::config_path::config_dir; use serde::{Deserialize, Serialize}; -use std::{os::unix::ffi::OsStrExt, time::Duration}; +use std::time::Duration; use iceoryx2_bb_log::{fail, trace, warn}; use crate::service::port_factory::publisher::UnableToDeliverStrategy; +/// Path to the default config file +pub const DEFAULT_CONFIG_FILE: &[u8] = b"config/iceoryx2.toml"; + /// Failures occurring while creating a new [`Config`] object with [`Config::from_file()`] or /// [`Config::setup_global_config_from_file()`] #[derive(Debug, Clone, Copy, Eq, Hash, PartialEq)] @@ -394,21 +397,21 @@ impl Config { /// config was already populated. pub fn global_config() -> &'static Config { - if !ICEORYX2_CONFIG.is_initialized() - && Config::setup_global_config_from_file(unsafe { - &FilePath::new_unchecked( - dirs::config_dir() - .unwrap() - .join("iceoryx2") - .join("config.toml") - .as_os_str() - .as_bytes(), - ) - }) - .is_err() - { - warn!(from "Config::global_config()", "Default config file found but unable to read data, populate config with default values."); - ICEORYX2_CONFIG.set_value(Config::default()); + if !ICEORYX2_CONFIG.is_initialized() { + let config_path = config_dir().unwrap().join("iceoryx2").join("config.toml"); + + match FilePath::new(config_path.as_os_str().as_encoded_bytes()) { + Ok(path) => { + if Config::setup_global_config_from_file(&path).is_err() { + warn!(from "Config::global_config()", "Default config file found but unable to read data, populate config with default values."); + ICEORYX2_CONFIG.set_value(Config::default()); + } + } + Err(e) => { + warn!(from "Config::global_config()", "Error: {:?}", e); + ICEORYX2_CONFIG.set_value(Config::default()); + } + } } ICEORYX2_CONFIG.get()