From 06f7d73672645b30bc41de7248edf3e6e13841f3 Mon Sep 17 00:00:00 2001 From: Rain Date: Sat, 21 Dec 2024 01:04:07 +0000 Subject: [PATCH] [spr] initial version Created using spr 1.3.6-beta.1 --- Cargo.lock | 60 +++++++++------------------ Cargo.toml | 2 +- clients/dpd-client/build.rs | 6 ++- dev-tools/releng/src/main.rs | 66 +++++++++++++++--------------- package/src/bin/omicron-package.rs | 28 +++++++------ package/src/cargo_plan.rs | 12 +++--- package/src/config.rs | 16 ++++---- package/src/dot.rs | 6 +-- package/src/lib.rs | 5 ++- package/src/target.rs | 14 +++---- 10 files changed, 102 insertions(+), 113 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5048914c74..1d329a9348 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3139,7 +3139,7 @@ dependencies = [ "futures-core", "futures-sink", "nanorand", - "spin 0.9.8", + "spin", ] [[package]] @@ -3769,7 +3769,7 @@ dependencies = [ "atomic-polyfill", "hash32 0.2.1", "rustc_version 0.4.1", - "spin 0.9.8", + "spin", "stable_deref_trait", ] @@ -5028,7 +5028,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.9.8", + "spin", ] [[package]] @@ -5599,7 +5599,7 @@ dependencies = [ "httparse", "memchr", "mime", - "spin 0.9.8", + "spin", "version_check", ] @@ -7030,7 +7030,7 @@ dependencies = [ "ref-cast", "regex", "reqwest", - "ring 0.17.8", + "ring", "rustls 0.22.4", "rustls-pemfile 2.2.0", "samael", @@ -7151,7 +7151,7 @@ dependencies = [ "petgraph", "rayon", "reqwest", - "ring 0.17.8", + "ring", "semver 1.0.23", "serde", "shell-words", @@ -7364,7 +7364,7 @@ dependencies = [ "rcgen", "regex", "reqwest", - "ring 0.17.8", + "ring", "rustls 0.22.4", "serde", "slog", @@ -7497,7 +7497,7 @@ dependencies = [ "similar", "slog", "smallvec 1.13.2", - "spin 0.9.8", + "spin", "string_cache", "subtle", "syn 1.0.109", @@ -7529,8 +7529,7 @@ dependencies = [ [[package]] name = "omicron-zone-package" version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5cd917080e98f2e325ad3d803432be83fbe7eb9ccabb0f0f20390072982f550" +source = "git+https://github.com/oxidecomputer/omicron-package?branch=main#ac5c649c619716f625e858940d584b819ad0c159" dependencies = [ "anyhow", "async-trait", @@ -7544,11 +7543,11 @@ dependencies = [ "futures-util", "hex", "reqwest", - "ring 0.16.20", "semver 1.0.23", "serde", "serde_derive", "serde_json", + "sha2", "slog", "tar", "thiserror 1.0.69", @@ -9210,7 +9209,7 @@ checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand", - "ring 0.17.8", + "ring", "rustc-hash 2.0.0", "rustls 0.23.19", "slab", @@ -9393,7 +9392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48406db8ac1f3cbc7dcdb56ec355343817958a356ff430259bb07baf7607e1e1" dependencies = [ "pem", - "ring 0.17.8", + "ring", "time", "yasna", ] @@ -9668,21 +9667,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -9693,7 +9677,7 @@ dependencies = [ "cfg-if", "getrandom", "libc", - "spin 0.9.8", + "spin", "untrusted 0.9.0", "windows-sys 0.52.0", ] @@ -9992,7 +9976,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.8", + "ring", "rustls-webpki 0.101.7", "sct", ] @@ -10004,7 +9988,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", - "ring 0.17.8", + "ring", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -10020,7 +10004,7 @@ dependencies = [ "aws-lc-rs", "log", "once_cell", - "ring 0.17.8", + "ring", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -10070,7 +10054,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", + "ring", "untrusted 0.9.0", ] @@ -10081,7 +10065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "aws-lc-rs", - "ring 0.17.8", + "ring", "rustls-pki-types", "untrusted 0.9.0", ] @@ -10293,7 +10277,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", + "ring", "untrusted 0.9.0", ] @@ -11101,12 +11085,6 @@ dependencies = [ "toml 0.8.19", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" diff --git a/Cargo.toml b/Cargo.toml index 3d29f61cf9..94a28e6582 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -498,7 +498,7 @@ omicron-rpaths = { path = "rpaths" } omicron-sled-agent = { path = "sled-agent" } omicron-test-utils = { path = "test-utils" } omicron-workspace-hack = "0.1.0" -omicron-zone-package = "0.11.1" +omicron-zone-package = { git = "https://github.com/oxidecomputer/omicron-package", branch = "main" } oxide-client = { path = "clients/oxide-client" } oxide-vpc = { git = "https://github.com/oxidecomputer/opte", rev = "b56afeeb14e0042cbd7bda85b166ed86ee17820e", features = [ "api", "std" ] } oxlog = { path = "dev-tools/oxlog" } diff --git a/clients/dpd-client/build.rs b/clients/dpd-client/build.rs index 313c1a452f..3f14fe7cc7 100644 --- a/clients/dpd-client/build.rs +++ b/clients/dpd-client/build.rs @@ -14,12 +14,16 @@ use anyhow::bail; use anyhow::Context; use anyhow::Result; use omicron_zone_package::config::Config; +use omicron_zone_package::config::PackageName; use omicron_zone_package::package::PackageSource; use quote::quote; use std::env; use std::fs; use std::path::Path; +const DENDRITE_ASIC_PACKAGE: PackageName = + PackageName::new_const("dendrite-asic"); + fn main() -> Result<()> { // Find the current dendrite repo commit from our package manifest. let manifest = fs::read_to_string("../../package-manifest.toml") @@ -31,7 +35,7 @@ fn main() -> Result<()> { let dendrite = config .packages - .get("dendrite-asic") + .get(&DENDRITE_ASIC_PACKAGE) .context("missing dendrite package in ../../package-manifest.toml")?; let local_path = match &dendrite.source { diff --git a/dev-tools/releng/src/main.rs b/dev-tools/releng/src/main.rs index 9f95344862..b20b7729fb 100644 --- a/dev-tools/releng/src/main.rs +++ b/dev-tools/releng/src/main.rs @@ -19,6 +19,7 @@ use chrono::Utc; use clap::Parser; use fs_err::tokio as fs; use omicron_zone_package::config::Config; +use omicron_zone_package::config::PackageName; use once_cell::sync::Lazy; use semver::Version; use slog::debug; @@ -56,34 +57,33 @@ enum InstallMethod { } /// Packages to install or bundle in the host OS image. -const HOST_IMAGE_PACKAGES: [(&str, InstallMethod); 8] = [ - ("mg-ddm-gz", InstallMethod::Install), - ("omicron-sled-agent", InstallMethod::Install), - ("overlay", InstallMethod::Bundle), - ("oxlog", InstallMethod::Install), - ("propolis-server", InstallMethod::Bundle), - ("pumpkind-gz", InstallMethod::Install), - ("crucible-dtrace", InstallMethod::Install), - ("switch-asic", InstallMethod::Bundle), +const HOST_IMAGE_PACKAGES: [(&PackageName, InstallMethod); 8] = [ + (&PackageName::new_const("mg-ddm-gz"), InstallMethod::Install), + (&PackageName::new_const("omicron-sled-agent"), InstallMethod::Install), + (&PackageName::new_const("overlay"), InstallMethod::Bundle), + (&PackageName::new_const("oxlog"), InstallMethod::Install), + (&PackageName::new_const("propolis-server"), InstallMethod::Bundle), + (&PackageName::new_const("pumpkind-gz"), InstallMethod::Install), + (&PackageName::new_const("crucible-dtrace"), InstallMethod::Install), + (&PackageName::new_const("switch-asic"), InstallMethod::Bundle), ]; /// Packages to install or bundle in the recovery (trampoline) OS image. -const RECOVERY_IMAGE_PACKAGES: [(&str, InstallMethod); 2] = [ - ("installinator", InstallMethod::Install), - ("mg-ddm-gz", InstallMethod::Install), +const RECOVERY_IMAGE_PACKAGES: [(&PackageName, InstallMethod); 2] = [ + (&PackageName::new_const("installinator"), InstallMethod::Install), + (&PackageName::new_const("mg-ddm-gz"), InstallMethod::Install), ]; -/// Packages to ship with the TUF repo. -const TUF_PACKAGES: [&str; 11] = [ - "clickhouse_keeper", - "clickhouse", - "cockroachdb", - "crucible-pantry-zone", - "crucible-zone", - "external-dns", - "internal-dns", - "nexus", - "ntp", - "oximeter", - "probe", +const TUF_PACKAGES: [&PackageName; 11] = [ + &PackageName::new_const("clickhouse_keeper"), + &PackageName::new_const("clickhouse"), + &PackageName::new_const("cockroachdb"), + &PackageName::new_const("crucible-pantry-zone"), + &PackageName::new_const("crucible-zone"), + &PackageName::new_const("external-dns"), + &PackageName::new_const("internal-dns"), + &PackageName::new_const("nexus"), + &PackageName::new_const("ntp"), + &PackageName::new_const("oximeter"), + &PackageName::new_const("probe"), ]; const HELIOS_REPO: &str = "https://pkg.oxide.computer/helios/2/dev/"; @@ -430,7 +430,7 @@ async fn main() -> Result<()> { "--artifacts", $target.artifacts_path(&args).as_str(), "stamp", - package, + package.as_str(), &version_str, ]) .env_remove("CARGO_MANIFEST_DIR"), @@ -655,14 +655,16 @@ impl Target { } } - fn proto_packages(self) -> &'static [(&'static str, InstallMethod)] { + fn proto_packages( + self, + ) -> &'static [(&'static PackageName, InstallMethod)] { match self { Target::Host => &HOST_IMAGE_PACKAGES, Target::Recovery => &RECOVERY_IMAGE_PACKAGES, } } - fn proto_package_names(self) -> impl Iterator { + fn proto_package_names(self) -> impl Iterator { self.proto_packages().iter().map(|(name, _)| *name) } @@ -694,7 +696,7 @@ impl std::fmt::Display for Target { async fn build_proto_area( mut package_dir: Utf8PathBuf, proto_dir: Utf8PathBuf, - packages: &'static [(&'static str, InstallMethod)], + packages: &'static [(&'static PackageName, InstallMethod)], manifest: Arc, ) -> Result<()> { let opt_oxide = proto_dir.join("root/opt/oxide"); @@ -709,7 +711,7 @@ async fn build_proto_area( manifest.packages.get(package_name).expect("checked in preflight"); match method { InstallMethod::Install => { - let path = opt_oxide.join(&package.service_name); + let path = opt_oxide.join(package.service_name.as_str()); fs::create_dir(&path).await?; let cloned_path = path.clone(); @@ -717,7 +719,7 @@ async fn build_proto_area( tokio::task::spawn_blocking(move || -> Result<()> { let mut archive = tar::Archive::new(std::fs::File::open( cloned_package_dir - .join(package_name) + .join(package_name.as_str()) .with_extension("tar"), )?); archive.unpack(cloned_path).with_context(|| { @@ -733,7 +735,7 @@ async fn build_proto_area( fs::rename( smf_manifest, manifest_site - .join(&package.service_name) + .join(package.service_name.as_str()) .with_extension("xml"), ) .await?; diff --git a/package/src/bin/omicron-package.rs b/package/src/bin/omicron-package.rs index 2cb0512169..a22312c42a 100644 --- a/package/src/bin/omicron-package.rs +++ b/package/src/bin/omicron-package.rs @@ -14,10 +14,10 @@ use omicron_package::cargo_plan::build_cargo_plan; use omicron_package::config::{Config, ConfigArgs}; use omicron_package::target::{target_command_help, KnownTarget}; use omicron_package::{parse, BuildCommand, DeployCommand, TargetCommand}; -use omicron_zone_package::config::Config as PackageConfig; +use omicron_zone_package::config::{Config as PackageConfig, PackageName}; use omicron_zone_package::package::{Package, PackageOutput, PackageSource}; use omicron_zone_package::progress::Progress; -use omicron_zone_package::target::Target; +use omicron_zone_package::target::TargetMap; use rayon::prelude::*; use ring::digest::{Context as DigestContext, Digest, SHA256}; use sled_hardware::cleanup::cleanup_networking_resources; @@ -32,6 +32,9 @@ use std::time::Duration; use tokio::io::{AsyncReadExt, AsyncWriteExt, BufReader}; use tokio::process::Command; +const OMICRON_SLED_AGENT: PackageName = + PackageName::new_const("omicron-sled-agent"); + /// All packaging subcommands. #[derive(Debug, Subcommand)] enum SubCommand { @@ -181,7 +184,7 @@ async fn do_target( )?; let (name, path) = get_required_named_target(&target_dir, name)?; - tokio::fs::write(&path, Target::from(target).to_string()) + tokio::fs::write(&path, TargetMap::from(target).to_string()) .await .with_context(|| { format!("failed to write target to {}", path) @@ -266,7 +269,7 @@ async fn replace_active_link( let dst = target_dir.join(Config::ACTIVE); if !target_dir.join(src).exists() { - bail!("Target file {} does not exist", src); + bail!("TargetMap file {} does not exist", src); } let _ = tokio::fs::remove_file(&dst).await; tokio::fs::symlink(src, &dst).await.with_context(|| { @@ -301,7 +304,7 @@ async fn get_sha256_digest(path: &Utf8PathBuf) -> Result { async fn download_prebuilt( progress: &PackageProgress, - package_name: &str, + package_name: &PackageName, repo: &str, commit: &str, expected_digest: &Vec, @@ -368,7 +371,7 @@ async fn download_prebuilt( async fn ensure_package( config: &Config, ui: &Arc, - package_name: &String, + package_name: &PackageName, package: &Package, output_directory: &Utf8Path, disable_cache: bool, @@ -497,7 +500,7 @@ async fn do_package( async fn do_stamp( config: &Config, output_directory: &Utf8Path, - package_name: &str, + package_name: &PackageName, version: &semver::Version, ) -> Result<()> { // Find the package which should be stamped @@ -506,7 +509,7 @@ async fn do_stamp( .packages_to_deploy(config.target()) .0 .into_iter() - .find(|(name, _pkg)| name.as_str() == package_name) + .find(|(name, _pkg)| *name == package_name) .ok_or_else(|| anyhow!("Package {package_name} not found"))?; // Stamp it @@ -533,8 +536,7 @@ async fn do_unpack( |(package_name, package)| -> Result<()> { let tarfile = package.get_output_path(&package_name, artifact_dir); let src = tarfile.as_path(); - let dst = - package.get_output_path(&package.service_name, install_dir); + let dst = package.get_output_path_for_service(install_dir); info!( config.log(), "Installing service"; @@ -566,7 +568,7 @@ async fn do_unpack( for service_name in global_zone_service_names { let tar_path = install_dir.join(format!("{}.tar", service_name)); - let service_path = install_dir.join(service_name); + let service_path = install_dir.join(service_name.as_str()); info!( config.log(), "Unpacking service tarball"; @@ -588,10 +590,10 @@ fn do_activate(config: &Config, install_dir: &Utf8Path) -> Result<()> { // Install the bootstrap service, which itself extracts and // installs other services. if let Some(package) = - config.package_config().packages.get("omicron-sled-agent") + config.package_config().packages.get(&OMICRON_SLED_AGENT) { let manifest_path = install_dir - .join(&package.service_name) + .join(package.service_name.as_str()) .join("pkg") .join("manifest.xml"); info!( diff --git a/package/src/cargo_plan.rs b/package/src/cargo_plan.rs index 1a32b199fb..88702452a2 100644 --- a/package/src/cargo_plan.rs +++ b/package/src/cargo_plan.rs @@ -11,6 +11,7 @@ use anyhow::Context; use anyhow::Result; use cargo_metadata::Metadata; use omicron_zone_package::config::PackageMap; +use omicron_zone_package::config::PackageName; use omicron_zone_package::package::PackageSource; use slog::info; use slog::Logger; @@ -46,9 +47,10 @@ pub fn build_cargo_plan<'a>( // Add the package name to the plan plan.packages.insert(name); // Get the package metadata - let metadata = workspace_pkgs.get(name).with_context(|| { - format!("package '{name}' is not a workspace package") - })?; + let metadata = + workspace_pkgs.get(name.as_str()).with_context(|| { + format!("package '{name}' is not a workspace package") + })?; // Add the binaries we want to build to the plan let bins = metadata .targets @@ -92,7 +94,7 @@ impl CargoPlan<'_> { #[derive(Debug)] pub struct CargoTargets<'a> { pub kind: BuildKind, - pub packages: BTreeSet<&'a String>, + pub packages: BTreeSet<&'a PackageName>, pub bins: BTreeSet<&'a String>, pub features: BTreeSet<&'a String>, } @@ -120,7 +122,7 @@ impl CargoTargets<'_> { // --package, and without any --package options Cargo unifies features // across all workspace default members. See rust-lang/cargo#8157. for package in &self.packages { - cmd.arg("--package").arg(package); + cmd.arg("--package").arg(package.as_str()); } for bin in &self.bins { cmd.arg("--bin").arg(bin); diff --git a/package/src/config.rs b/package/src/config.rs index 800af7a0de..1efd523496 100644 --- a/package/src/config.rs +++ b/package/src/config.rs @@ -6,9 +6,9 @@ use anyhow::{bail, Result}; use camino::Utf8Path; use clap::Args; use omicron_zone_package::{ - config::{Config as PackageConfig, PackageMap}, + config::{Config as PackageConfig, PackageMap, PackageName}, package::PackageSource, - target::Target, + target::TargetMap, }; use slog::{debug, Logger}; use std::{collections::BTreeMap, io::Write, str::FromStr, time::Duration}; @@ -50,9 +50,9 @@ pub struct Config { // Description of all possible packages. package_config: PackageConfig, // Description of the target we're trying to operate on. - target: Target, + target: TargetMap, // The list of packages the user wants us to build (all, if empty) - only: Vec, + only: Vec, // True if we should skip confirmations for destructive operations. force: bool, // Number of times to retry failed downloads. @@ -91,7 +91,7 @@ impl Config { target_help_str() ); })?; - let target: Target = KnownTarget::from_str(&raw_target) + let target: TargetMap = KnownTarget::from_str(&raw_target) .inspect_err(|_| { eprintln!( "Failed to parse {} as target\n{}", @@ -115,7 +115,7 @@ impl Config { /// Sets the `only` field. #[inline] - pub fn set_only(&mut self, only: Vec) -> &mut Self { + pub fn set_only(&mut self, only: Vec) -> &mut Self { self.only = only; self } @@ -128,7 +128,7 @@ impl Config { /// Returns the target currently being operated on. #[inline] - pub fn target(&self) -> &Target { + pub fn target(&self) -> &TargetMap { &self.target } @@ -212,7 +212,7 @@ impl Config { output ) }); - if dep_name.as_str() == package_name { + if *dep_name == package_name { panic!("'{}' depends on itself", package_name); } // if we've seen this package already, it will be in diff --git a/package/src/dot.rs b/package/src/dot.rs index 141adcf368..8a3d3bb4a6 100644 --- a/package/src/dot.rs +++ b/package/src/dot.rs @@ -4,7 +4,7 @@ use anyhow::anyhow; use omicron_zone_package::config::Config; use omicron_zone_package::package::PackageOutput; use omicron_zone_package::package::PackageSource; -use omicron_zone_package::target::Target; +use omicron_zone_package::target::TargetMap; use petgraph::dot::Dot; use petgraph::graph::EdgeReference; use petgraph::graph::NodeIndex; @@ -70,7 +70,7 @@ impl std::fmt::Display for GraphNode { // Returns a string that can be passed to dot(1) to visualize a package manifest pub fn do_dot( - target: &Target, + target: &TargetMap, package_config: &Config, ) -> anyhow::Result { let packages = &package_config.packages; @@ -295,7 +295,7 @@ mod test { fn dot_output_for(raw_toml: &str) -> Result { let package_config = parse_manifest(raw_toml).expect("test toml was invalid"); - do_dot(&Target::default(), &package_config) + do_dot(&TargetMap::default(), &package_config) } #[test] diff --git a/package/src/lib.rs b/package/src/lib.rs index 8ef9a4c951..969cf6db21 100644 --- a/package/src/lib.rs +++ b/package/src/lib.rs @@ -2,6 +2,7 @@ use camino::{Utf8Path, Utf8PathBuf}; use clap::Subcommand; +use omicron_zone_package::config::PackageName; use serde::de::DeserializeOwned; use thiserror::Error; @@ -122,12 +123,12 @@ pub enum BuildCommand { disable_cache: bool, /// Limit to building only these packages #[clap(long)] - only: Vec, + only: Vec, }, /// Stamps semver versions onto packages within a manifest Stamp { /// The name of the artifact to be stamped. - package_name: String, + package_name: PackageName, /// The version to be stamped onto the package. version: semver::Version, diff --git a/package/src/target.rs b/package/src/target.rs index d56f7e87c5..4e3f9a04c6 100644 --- a/package/src/target.rs +++ b/package/src/target.rs @@ -6,7 +6,7 @@ use anyhow::{bail, Result}; use clap::ValueEnum; -use omicron_zone_package::target::Target; +use omicron_zone_package::target::TargetMap; use std::collections::BTreeMap; /// Type of OS image to build @@ -123,8 +123,8 @@ impl Default for KnownTarget { } } -impl From for Target { - fn from(kt: KnownTarget) -> Target { +impl From for TargetMap { + fn from(kt: KnownTarget) -> TargetMap { let mut map = BTreeMap::new(); map.insert("image".to_string(), kt.image.to_string()); if let Some(machine) = kt.machine { @@ -138,13 +138,13 @@ impl From for Target { "clickhouse-topology".to_string(), kt.clickhouse_topology.to_string(), ); - Target(map) + TargetMap(map) } } impl std::fmt::Display for KnownTarget { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let target: Target = self.clone().into(); + let target: TargetMap = self.clone().into(); target.fmt(f) } } @@ -153,7 +153,7 @@ impl std::str::FromStr for KnownTarget { type Err = anyhow::Error; fn from_str(s: &str) -> Result { - let target = Target::from_str(s)?; + let target = TargetMap::from_str(s)?; let mut image = Self::default().image; let mut machine = None; @@ -181,7 +181,7 @@ impl std::str::FromStr for KnownTarget { _ => { bail!( "Unknown target key {k}\nValid keys include: [{}]", - Target::from(Self::default()) + TargetMap::from(Self::default()) .0 .keys() .cloned()