diff --git a/Cargo.lock b/Cargo.lock index e15afdfbab..1a69cf919a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -655,7 +655,7 @@ dependencies = [ "ipnetwork", "omicron-common", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "regress", "reqwest", "schemars", @@ -1315,7 +1315,7 @@ dependencies = [ "chrono", "crucible-workspace-hack", "percent-encoding", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "reqwest", "schemars", "serde", @@ -1331,7 +1331,7 @@ dependencies = [ "chrono", "crucible-workspace-hack", "percent-encoding", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "reqwest", "schemars", "serde", @@ -1568,8 +1568,8 @@ dependencies = [ "omicron-common", "omicron-workspace-hack", "omicron-zone-package", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", - "progenitor-client 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", + "progenitor-client", "quote", "reqwest", "rustfmt-wrapper", @@ -1891,7 +1891,7 @@ dependencies = [ "chrono", "http 0.2.11", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "reqwest", "schemars", "serde", @@ -1945,8 +1945,8 @@ dependencies = [ "ipnetwork", "omicron-workspace-hack", "omicron-zone-package", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", - "progenitor-client 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", + "progenitor-client", "quote", "rand 0.8.5", "regress", @@ -2584,7 +2584,7 @@ dependencies = [ "chrono", "gateway-messages", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "rand 0.8.5", "reqwest", "schemars", @@ -3506,7 +3506,7 @@ version = "0.1.0" dependencies = [ "installinator-common", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "regress", "reqwest", "schemars", @@ -3586,7 +3586,7 @@ dependencies = [ "omicron-common", "omicron-test-utils", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "reqwest", "serde", "serde_json", @@ -4083,8 +4083,8 @@ dependencies = [ "omicron-common", "omicron-workspace-hack", "omicron-zone-package", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", - "progenitor-client 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", + "progenitor-client", "quote", "reqwest", "rustfmt-wrapper", @@ -4305,7 +4305,7 @@ dependencies = [ "omicron-common", "omicron-passwords", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "regress", "reqwest", "schemars", @@ -4887,7 +4887,7 @@ dependencies = [ "omicron-workspace-hack", "once_cell", "parse-display", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "proptest", "rand 0.8.5", "regress", @@ -5062,7 +5062,7 @@ dependencies = [ "petgraph", "pq-sys", "pretty_assertions", - "progenitor-client 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor-client", "propolis-client", "rand 0.8.5", "rcgen", @@ -5671,7 +5671,7 @@ dependencies = [ "http 0.2.11", "hyper 0.14.27", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "rand 0.8.5", "regress", "reqwest", @@ -5727,7 +5727,7 @@ dependencies = [ "futures", "omicron-common", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "reqwest", "serde", "slog", @@ -6540,43 +6540,16 @@ dependencies = [ [[package]] name = "progenitor" version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor?branch=main#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" dependencies = [ - "progenitor-client 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", - "progenitor-impl 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", - "progenitor-macro 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", - "serde_json", -] - -[[package]] -name = "progenitor" -version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" -dependencies = [ - "progenitor-client 0.5.0 (git+https://github.com/oxidecomputer/progenitor)", - "progenitor-impl 0.5.0 (git+https://github.com/oxidecomputer/progenitor)", - "progenitor-macro 0.5.0 (git+https://github.com/oxidecomputer/progenitor)", + "progenitor-client", + "progenitor-impl", + "progenitor-macro", "serde_json", ] [[package]] name = "progenitor-client" version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor?branch=main#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" -dependencies = [ - "bytes", - "futures-core", - "percent-encoding", - "reqwest", - "serde", - "serde_json", - "serde_urlencoded", -] - -[[package]] -name = "progenitor-client" -version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" dependencies = [ "bytes", "futures-core", @@ -6590,7 +6563,6 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor?branch=main#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" dependencies = [ "getopts", "heck 0.4.1", @@ -6609,53 +6581,13 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "progenitor-impl" -version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" -dependencies = [ - "getopts", - "heck 0.4.1", - "http 0.2.11", - "indexmap 2.2.3", - "openapiv3", - "proc-macro2", - "quote", - "regex", - "schemars", - "serde", - "serde_json", - "syn 2.0.48", - "thiserror", - "typify", - "unicode-ident", -] - -[[package]] -name = "progenitor-macro" -version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor?branch=main#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" -dependencies = [ - "openapiv3", - "proc-macro2", - "progenitor-impl 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", - "quote", - "schemars", - "serde", - "serde_json", - "serde_tokenstream 0.2.0", - "serde_yaml", - "syn 2.0.48", -] - [[package]] name = "progenitor-macro" version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" dependencies = [ "openapiv3", "proc-macro2", - "progenitor-impl 0.5.0 (git+https://github.com/oxidecomputer/progenitor)", + "progenitor-impl", "quote", "schemars", "serde", @@ -6673,7 +6605,7 @@ dependencies = [ "async-trait", "base64", "futures", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor)", + "progenitor", "rand 0.8.5", "reqwest", "schemars", @@ -6698,7 +6630,7 @@ dependencies = [ "dropshot", "futures", "hyper 0.14.27", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor)", + "progenitor", "propolis_types", "rand 0.8.5", "reqwest", @@ -8164,7 +8096,7 @@ dependencies = [ "ipnetwork", "omicron-common", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "regress", "reqwest", "schemars", @@ -8194,6 +8126,7 @@ dependencies = [ "schemars", "serde", "slog", + "slog-error-chain", "thiserror", "tofino", "tokio", @@ -10478,7 +10411,7 @@ dependencies = [ "installinator-common", "ipnetwork", "omicron-workspace-hack", - "progenitor 0.5.0 (git+https://github.com/oxidecomputer/progenitor?branch=main)", + "progenitor", "regress", "reqwest", "schemars", diff --git a/Cargo.toml b/Cargo.toml index db37547ea0..39738af32d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -607,8 +607,9 @@ opt-level = 3 # # Local client generation during development. # -#[patch."https://github.com/oxidecomputer/progenitor"] -#progenitor = { path = "../progenitor/progenitor" } +[patch."https://github.com/oxidecomputer/progenitor"] +progenitor = { path = "../progenitor/progenitor" } +progenitor-client = { path = "../progenitor/progenitor-client" } #[patch."https://github.com/oxidecomputer/typify"] #typify = { path = "../typify/typify" } diff --git a/dev-tools/oxlog/src/lib.rs b/dev-tools/oxlog/src/lib.rs index 589b113928..a4774fabbc 100644 --- a/dev-tools/oxlog/src/lib.rs +++ b/dev-tools/oxlog/src/lib.rs @@ -351,8 +351,7 @@ fn load_svc_logs(dir: Utf8PathBuf, logs: &mut BTreeMap) { let is_current = filename.ends_with(".log"); - let svc_logs = - logs.entry(svc_name.to_string()).or_insert(SvcLogs::default()); + let svc_logs = logs.entry(svc_name.to_string()).or_default(); if is_current { svc_logs.current = Some(logfile.clone()); @@ -374,8 +373,7 @@ fn load_extra_logs( return; }; - let svc_logs = - logs.entry(svc_name.to_string()).or_insert(SvcLogs::default()); + let svc_logs = logs.entry(svc_name.to_string()).or_default(); for entry in entries { let Ok(entry) = entry else { diff --git a/dev-tools/xtask/src/main.rs b/dev-tools/xtask/src/main.rs index 4ab42736ca..42e6c10d64 100644 --- a/dev-tools/xtask/src/main.rs +++ b/dev-tools/xtask/src/main.rs @@ -26,23 +26,35 @@ enum Cmds { /// workspace CheckWorkspaceDeps, /// Run configured clippy checks - Clippy, + Clippy(ClippyArgs), +} + +#[derive(Parser)] +struct ClippyArgs { + /// Automatically apply lint suggestions. + #[clap(long)] + fix: bool, } fn main() -> Result<()> { let args = Args::parse(); match args.cmd { - Cmds::Clippy => cmd_clippy(), + Cmds::Clippy(args) => cmd_clippy(args), Cmds::CheckWorkspaceDeps => cmd_check_workspace_deps(), } } -fn cmd_clippy() -> Result<()> { +fn cmd_clippy(args: ClippyArgs) -> Result<()> { let cargo = std::env::var("CARGO").unwrap_or_else(|_| String::from("cargo")); let mut command = Command::new(&cargo); + command.arg("clippy"); + + if args.fix { + command.arg("--fix"); + } + command - .arg("clippy") // Make sure we check everything. .arg("--all-targets") .arg("--") diff --git a/nexus/src/app/background/mod.rs b/nexus/src/app/background/mod.rs index 27cdddfe15..0065a41a9e 100644 --- a/nexus/src/app/background/mod.rs +++ b/nexus/src/app/background/mod.rs @@ -20,6 +20,4 @@ mod region_replacement; mod status; mod sync_service_zone_nat; -pub use common::Driver; -pub use common::TaskHandle; pub use init::BackgroundTasks; diff --git a/nexus/src/cidata.rs b/nexus/src/cidata.rs index 8f776501b6..08e4926af1 100644 --- a/nexus/src/cidata.rs +++ b/nexus/src/cidata.rs @@ -6,8 +6,6 @@ use serde::Serialize; use std::io::{self, Cursor, Write}; use uuid::Uuid; -pub use nexus_types::external_api::params::MAX_USER_DATA_BYTES; - pub trait InstanceCiData { fn generate_cidata(&self, public_keys: &[String]) -> Result, Error>; @@ -93,6 +91,8 @@ fn build_vfat(meta_data: &[u8], user_data: &[u8]) -> io::Result> { #[cfg(test)] mod tests { + use nexus_types::external_api::params::MAX_USER_DATA_BYTES; + /// the fatfs crate has some unfortunate panics if you ask it to do /// incredibly stupid things, like format an empty disk or create a /// filesystem with an invalid cluster size. @@ -104,7 +104,7 @@ mod tests { /// little further.) #[test] fn build_vfat_works_with_arbitrarily_sized_input() { - let upper = crate::cidata::MAX_USER_DATA_BYTES + 4096; + let upper = MAX_USER_DATA_BYTES + 4096; // somewhat arbitrarily-chosen prime numbers near 1 KiB and 256 bytes for md_size in (0..upper).step_by(1019) { for ud_size in (0..upper).step_by(269) { diff --git a/sled-hardware/Cargo.toml b/sled-hardware/Cargo.toml index 3d1259f46f..50e3cce072 100644 --- a/sled-hardware/Cargo.toml +++ b/sled-hardware/Cargo.toml @@ -19,6 +19,7 @@ rand.workspace = true schemars.workspace = true serde.workspace = true slog.workspace = true +slog-error-chain.workspace = true thiserror.workspace = true tofino.workspace = true tokio.workspace = true diff --git a/sled-hardware/src/cleanup.rs b/sled-hardware/src/cleanup.rs index 1a7f8be2f7..f438098792 100644 --- a/sled-hardware/src/cleanup.rs +++ b/sled-hardware/src/cleanup.rs @@ -18,6 +18,7 @@ use illumos_utils::ExecutionError; use illumos_utils::{execute, PFEXEC}; use slog::warn; use slog::Logger; +use slog_error_chain::InlineErrorChain; use std::process::Command; pub fn delete_underlay_addresses(log: &Logger) -> Result<(), Error> { @@ -45,7 +46,17 @@ fn delete_addresses_matching_prefixes( let addrobjs = output .stdout .lines() - .flatten() + .filter_map(|line| match line { + Ok(line) => Some(line), + Err(err) => { + warn!( + log, + "ipadm show-addr returned line that wasn't valid UTF-8"; + InlineErrorChain::new(&err), + ); + None + } + }) .collect::>(); for addrobj in addrobjs { diff --git a/wicket/src/state/mod.rs b/wicket/src/state/mod.rs index e20ba1c9c3..d287a153a9 100644 --- a/wicket/src/state/mod.rs +++ b/wicket/src/state/mod.rs @@ -12,15 +12,14 @@ mod update; pub use force_update::ForceUpdateState; pub use inventory::{ - Component, ComponentId, Inventory, ParsableComponentId, PowerState, Sp, - ALL_COMPONENT_IDS, + Component, ComponentId, Inventory, ParsableComponentId, ALL_COMPONENT_IDS, }; pub use rack::{KnightRiderMode, RackState}; -pub use status::{Liveness, ServiceStatus}; +pub use status::ServiceStatus; pub use update::{ parse_event_report_map, update_component_title, CreateClearUpdateStateOptions, CreateStartUpdateOptions, RackUpdateState, - UpdateItemState, UpdateRunningState, + UpdateItemState, }; use serde::{Deserialize, Serialize}; diff --git a/wicket/src/ui/widgets/mod.rs b/wicket/src/ui/widgets/mod.rs index 9527b68e2f..fd5ed18e3a 100644 --- a/wicket/src/ui/widgets/mod.rs +++ b/wicket/src/ui/widgets/mod.rs @@ -16,6 +16,6 @@ pub use animated_logo::{Logo, LogoState, LOGO_HEIGHT, LOGO_WIDTH}; pub use box_connector::{BoxConnector, BoxConnectorKind}; pub use fade::Fade; pub use ignition::IgnitionPopup; -pub use popup::{ButtonText, Popup, PopupBuilder, PopupScrollOffset}; +pub use popup::{ButtonText, PopupBuilder, PopupScrollOffset}; pub use rack::Rack; pub use status_view::StatusView;