From 75b85c47b31538b7a58ff2754a26f78a92634332 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 11 Mar 2024 11:53:20 -0400 Subject: [PATCH 01/24] feat(manifest-reform): stub out new manifest parts --- cargo-dist-schema/src/lib.rs | 56 +++++++++++++++++++++++++++--------- cargo-dist/src/manifest.rs | 5 ++++ cargo-dist/src/tasks.rs | 4 ++- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/cargo-dist-schema/src/lib.rs b/cargo-dist-schema/src/lib.rs index fce84ebfd..53c8abbf0 100644 --- a/cargo-dist-schema/src/lib.rs +++ b/cargo-dist-schema/src/lib.rs @@ -26,6 +26,10 @@ pub type LocalPath = String; pub type RelPath = String; /// The unique ID of an Artifact pub type ArtifactId = String; +/// The unique ID of a System +pub type SystemId = String; +/// The unique ID of an Asset +pub type AssetId = String; /// A report of the releases and artifacts that cargo-dist generated #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] @@ -59,6 +63,8 @@ pub struct DistManifest { #[serde(skip_serializing_if = "Option::is_none")] pub announcement_github_body: Option, /// Info about the toolchain used to build this announcement + /// + /// DEPRECATED: never appears anymore #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] pub system_info: Option, @@ -70,6 +76,14 @@ pub struct DistManifest { #[serde(default)] #[serde(skip_serializing_if = "BTreeMap::is_empty")] pub artifacts: BTreeMap, + /// The systems that artifacts were built on + #[serde(default)] + #[serde(skip_serializing_if = "BTreeMap::is_empty")] + pub systems: BTreeMap, + /// The assets contained within artifacts (binaries) + #[serde(default)] + #[serde(skip_serializing_if = "BTreeMap::is_empty")] + pub assets: BTreeMap, /// Whether to publish prereleases to package managers #[serde(default)] pub publish_prereleases: bool, @@ -77,10 +91,25 @@ pub struct DistManifest { #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] pub ci: Option, + #[serde(default)] + #[serde(skip_serializing_if = "Vec::is_empty")] /// Data about dynamic linkage in the built libraries pub linkage: Vec, } +/// Info about an Asset (binary) +#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] +pub struct AssetInfo { + /// unique id of the Asset + pub id: AssetId, + /// filename of the Asset + pub name: String, + /// the system it was built on + pub system: SystemId, + /// the linkage of this Asset + pub linkage: Option, +} + /// CI backend info #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] pub struct CiInfo { @@ -166,24 +195,17 @@ impl std::fmt::Display for PrRunMode { } } -/// Info about the system/toolchain used to build this announcement. -/// -/// Note that this is info from the machine that generated this file, -/// which *ideally* should be similar to the machines that built all the artifacts, but -/// we can't guarantee that. -/// -/// dist-manifest.json is by default generated at the start of the build process, -/// and typically on a linux machine because that's usually the fastest/cheapest -/// part of CI infra. +/// Info about a system used to build this announcement. #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] pub struct SystemInfo { + /// The unique id of the System + pub id: SystemId, /// The version of Cargo used (first line of cargo -vV) - /// - /// Note that this is the version used on the machine that generated this file, - /// which presumably should be the same version used on all the machines that - /// built all the artifacts, but maybe not! It's more likely to be correct - /// if rust-toolchain.toml is used with a specific pinned version. pub cargo_version_line: Option, + /// The Artifacts built by this system + pub artifacts: Vec, + /// The Assets built by this system + pub assets: Vec, } /// A Release of an Application @@ -249,6 +271,10 @@ pub struct Artifact { /// An asset contained in an artifact (executable, license, etc.) #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] pub struct Asset { + /// A unique opaque id for an Asset + #[serde(default)] + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, /// The high-level name of the asset #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] @@ -387,6 +413,8 @@ impl DistManifest { system_info: None, releases, artifacts, + systems: Default::default(), + assets: Default::default(), publish_prereleases: false, ci: None, linkage: vec![], diff --git a/cargo-dist/src/manifest.rs b/cargo-dist/src/manifest.rs index fb5dac2e3..ecac0b851 100644 --- a/cargo-dist/src/manifest.rs +++ b/cargo-dist/src/manifest.rs @@ -39,6 +39,8 @@ pub fn load_and_merge_manifests( announcement_title, announcement_changelog, announcement_github_body, + systems, + assets, ci, linkage, } = manifest; @@ -172,6 +174,7 @@ fn manifest_artifact( let binary = &dist.binary(binary_idx); let symbols_artifact = binary.symbols_artifact.map(|a| dist.artifact(a).id.clone()); Asset { + id: None, name: Some(binary.name.clone()), // Always copied to the root... for now path: Some(exe_path.file_name().unwrap().to_owned()), @@ -194,6 +197,7 @@ fn manifest_artifact( StaticAssetKind::Other => AssetKind::Unknown, }; Asset { + id: None, name: Some(asset.file_name().unwrap().to_owned()), path: Some(asset.file_name().unwrap().to_owned()), kind, @@ -221,6 +225,7 @@ fn manifest_artifact( } TemplateEntry::File(file) => { static_assets.push(Asset { + id: None, name: Some(file.name.clone()), path: Some(file.path_from_ancestor(root_dir).to_string()), kind: AssetKind::Unknown, diff --git a/cargo-dist/src/tasks.rs b/cargo-dist/src/tasks.rs index ff70959cb..40794b5c4 100644 --- a/cargo-dist/src/tasks.rs +++ b/cargo-dist/src/tasks.rs @@ -1006,7 +1006,7 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { }, manifest: DistManifest { dist_version: Some(env!("CARGO_PKG_VERSION").to_owned()), - system_info: Some(cargo_dist_schema::SystemInfo { cargo_version_line }), + system_info: None, announcement_tag: None, announcement_is_prerelease: false, announcement_tag_is_implicit, @@ -1015,6 +1015,8 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { announcement_github_body: None, releases: vec![], artifacts: Default::default(), + systems: Default::default(), + assets: Default::default(), publish_prereleases, ci: None, linkage: vec![], From e5884cf6c78f65dc7403a06153b506dfbef0ed3e Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 11 Mar 2024 12:03:46 -0400 Subject: [PATCH 02/24] feat(manifest-reform): move build logic into a shared module --- cargo-dist/src/{cargo_build.rs => build/cargo.rs} | 0 cargo-dist/src/{generic_build.rs => build/generic.rs} | 0 cargo-dist/src/build/mod.rs | 4 ++++ cargo-dist/src/lib.rs | 7 +++---- 4 files changed, 7 insertions(+), 4 deletions(-) rename cargo-dist/src/{cargo_build.rs => build/cargo.rs} (100%) rename cargo-dist/src/{generic_build.rs => build/generic.rs} (100%) create mode 100644 cargo-dist/src/build/mod.rs diff --git a/cargo-dist/src/cargo_build.rs b/cargo-dist/src/build/cargo.rs similarity index 100% rename from cargo-dist/src/cargo_build.rs rename to cargo-dist/src/build/cargo.rs diff --git a/cargo-dist/src/generic_build.rs b/cargo-dist/src/build/generic.rs similarity index 100% rename from cargo-dist/src/generic_build.rs rename to cargo-dist/src/build/generic.rs diff --git a/cargo-dist/src/build/mod.rs b/cargo-dist/src/build/mod.rs new file mode 100644 index 000000000..172012272 --- /dev/null +++ b/cargo-dist/src/build/mod.rs @@ -0,0 +1,4 @@ +//! Compiling Things + +pub mod cargo; +pub mod generic; diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index a4e611129..cc0b4c11c 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -19,13 +19,13 @@ use backend::{ installer::{self, msi::MsiInstallerInfo, InstallerImpl}, }; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_build::{build_cargo_target, rustup_toolchain}; +use build::cargo::{build_cargo_target, rustup_toolchain}; use cargo_dist_schema::DistManifest; use config::{ ArtifactMode, ChecksumStyle, CompressionImpl, Config, DirtyMode, GenerateMode, ZipStyle, }; use console::Term; -use generic_build::{build_generic_target, run_extra_artifacts_build}; +use build::generic::{build_generic_target, run_extra_artifacts_build}; use semver::Version; use temp_dir::TempDir; use tracing::info; @@ -37,11 +37,10 @@ pub use tasks::*; pub mod announce; pub mod backend; -pub mod cargo_build; +pub mod build; pub mod config; pub mod env; pub mod errors; -pub mod generic_build; pub mod host; mod init; pub mod linkage; From 1ed0973c0f5c0cbc6d3f0e5015a1a88b9cd472e4 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 11 Mar 2024 14:28:01 -0400 Subject: [PATCH 03/24] chore: build proper abstraction for managing build outputs --- cargo-dist/src/build/cargo.rs | 124 +++------------------ cargo-dist/src/build/generic.rs | 51 +++++---- cargo-dist/src/build/mod.rs | 188 ++++++++++++++++++++++++++++++++ cargo-dist/src/errors.rs | 10 ++ cargo-dist/src/lib.rs | 68 ++++++------ cargo-dist/src/linkage.rs | 3 +- 6 files changed, 272 insertions(+), 172 deletions(-) diff --git a/cargo-dist/src/build/cargo.rs b/cargo-dist/src/build/cargo.rs index f4fcbfe0c..900e50399 100644 --- a/cargo-dist/src/build/cargo.rs +++ b/cargo-dist/src/build/cargo.rs @@ -3,16 +3,15 @@ use std::env; use axoprocess::Cmd; -use camino::Utf8PathBuf; -use miette::{miette, Context, IntoDiagnostic}; -use tracing::{info, warn}; +use miette::{Context, IntoDiagnostic}; +use tracing::warn; +use crate::build::BuildExpectations; use crate::env::{calculate_ldflags, fetch_brew_env, parse_env, select_brew_env}; +use crate::{errors::*, BinaryIdx, BuildStep, DistGraphBuilder, TargetTriple, PROFILE_DIST}; use crate::{ - copy_file, CargoBuildStep, CargoTargetFeatureList, CargoTargetPackages, DistGraph, FastMap, - RustupStep, SortedMap, + CargoBuildStep, CargoTargetFeatureList, CargoTargetPackages, DistGraph, RustupStep, SortedMap, }; -use crate::{errors::*, BinaryIdx, BuildStep, DistGraphBuilder, TargetTriple, PROFILE_DIST}; impl<'a> DistGraphBuilder<'a> { pub(crate) fn compute_cargo_builds(&mut self) -> Vec { @@ -118,7 +117,7 @@ impl<'a> DistGraphBuilder<'a> { } /// Build a cargo target -pub fn build_cargo_target(dist_graph: &DistGraph, target: &CargoBuildStep) -> Result<()> { +pub fn build_cargo_target(dist_graph: &DistGraph, target: &CargoBuildStep) -> DistResult<()> { eprint!( "building cargo target ({}/{}", target.target_triple, target.profile @@ -178,45 +177,7 @@ pub fn build_cargo_target(dist_graph: &DistGraph, target: &CargoBuildStep) -> Re command.envs(desired_extra_env); let mut task = command.spawn()?; - // Create entries for all the binaries we expect to find, and the paths they should - // be copied to (according to the copy_exe_to subscribers list). - // - // Structure is: - // - // package-id (key) - // binary-name (key) - // subscribers (list) - // src-path (initially blank, must be filled in by rustc) - // dest-path (where to copy the file to) - let mut expected_exes = - FastMap::>>::new(); - let mut expected_symbols = - FastMap::>>::new(); - for &binary_idx in &target.expected_binaries { - let binary = &dist_graph.binary(binary_idx); - let package_id = binary - .pkg_id - .clone() - .expect("pkg_id is mandatory for cargo builds") - .to_string(); - let exe_name = binary.name.clone(); - for exe_dest in &binary.copy_exe_to { - expected_exes - .entry(package_id.clone()) - .or_default() - .entry(exe_name.clone()) - .or_default() - .push((Utf8PathBuf::new(), exe_dest.clone())); - } - for sym_dest in &binary.copy_symbols_to { - expected_symbols - .entry(package_id.clone()) - .or_default() - .entry(exe_name.clone()) - .or_default() - .push((Utf8PathBuf::new(), sym_dest.clone())); - } - } + let mut expected = BuildExpectations::new(dist_graph, &target.expected_binaries); // Collect up the compiler messages to find out where binaries ended up let reader = std::io::BufReader::new(task.stdout.take().unwrap()); @@ -232,41 +193,11 @@ pub fn build_cargo_target(dist_graph: &DistGraph, target: &CargoBuildStep) -> Re }; match message { cargo_metadata::Message::CompilerArtifact(artifact) => { - // Hey we got an executable, is it one we wanted? - if let Some(new_exe) = artifact.executable { - info!("got a new exe: {}", new_exe); - let package_id = artifact.package_id.to_string(); - let exe_name = new_exe.file_stem().unwrap(); - - // If we expected some symbols, pull them out of the paths of this executable - let expected_sym = expected_symbols - .get_mut(&package_id) - .and_then(|m| m.get_mut(exe_name)); - if let Some(expected) = expected_sym { - for (src_sym_path, _) in expected { - for path in &artifact.filenames { - // FIXME: unhardcode this when we add support for other symbol kinds! - let is_symbols = - path.extension().map(|e| e == "pdb").unwrap_or(false); - if is_symbols { - // These are symbols we expected! Save the path. - *src_sym_path = path.to_owned(); - } - } - } - } - - // Get the exe path - let expected_exe = expected_exes - .get_mut(&package_id) - .and_then(|m| m.get_mut(exe_name)); - if let Some(expected) = expected_exe { - for (src_bin_path, _) in expected { - // This is an exe we expected! Save the path. - *src_bin_path = new_exe.clone(); - } - } - } + let Some(new_exe) = artifact.executable else { + continue; + }; + // Hey we got an executable, record that fact + expected.found_bin(artifact.package_id.to_string(), new_exe, artifact.filenames); } _ => { // Nothing else interesting? @@ -274,35 +205,8 @@ pub fn build_cargo_target(dist_graph: &DistGraph, target: &CargoBuildStep) -> Re } } - // Check that we got everything we expected, and normalize to ArtifactIdx => Artifact Path - for (package_id, exes) in expected_exes { - for (exe_name, to_copy) in &exes { - for (src_path, dest_path) in to_copy { - if src_path.as_str().is_empty() { - return Err(miette!( - "failed to find bin {} ({}) -- did the cargo build above have errors?", - exe_name, - package_id - )); - } - copy_file(src_path, dest_path)?; - } - } - } - for (package_id, symbols) in expected_symbols { - for (exe, to_copy) in &symbols { - for (src_path, dest_path) in to_copy { - if src_path.as_str().is_empty() { - return Err(miette!( - "failed to find symbols for bin {} ({}) -- did the cargo build above have errors?", - exe, - package_id - )); - } - copy_file(src_path, dest_path)?; - } - } - } + // Process all the resulting binaries + expected.process_bins(dist_graph)?; Ok(()) } diff --git a/cargo-dist/src/build/generic.rs b/cargo-dist/src/build/generic.rs index 135e571b0..99b35a7d8 100644 --- a/cargo-dist/src/build/generic.rs +++ b/cargo-dist/src/build/generic.rs @@ -3,15 +3,14 @@ use std::{env, process::ExitStatus}; use axoprocess::Cmd; -use camino::Utf8Path; -use miette::miette; +use camino::{Utf8Path, Utf8PathBuf}; use crate::{ + build::{package_id_string, BuildExpectations}, copy_file, env::{calculate_cflags, calculate_ldflags, fetch_brew_env, parse_env, select_brew_env}, - errors::Result, - BinaryIdx, BuildStep, DistGraph, DistGraphBuilder, ExtraBuildStep, GenericBuildStep, SortedMap, - TargetTriple, + BinaryIdx, BuildStep, DistError, DistGraph, DistGraphBuilder, DistResult, ExtraBuildStep, + GenericBuildStep, SortedMap, TargetTriple, }; impl<'a> DistGraphBuilder<'a> { @@ -73,7 +72,7 @@ fn run_build( dist_graph: &DistGraph, command_string: &[String], target: Option<&str>, -) -> Result { +) -> DistResult { let mut command_string = command_string.to_owned(); let mut desired_extra_env = vec![]; @@ -129,7 +128,7 @@ fn run_build( } /// Build a generic target -pub fn build_generic_target(dist_graph: &DistGraph, target: &GenericBuildStep) -> Result<()> { +pub fn build_generic_target(dist_graph: &DistGraph, target: &GenericBuildStep) -> DistResult<()> { eprintln!( "building generic target ({} via {})", target.target_triple, @@ -143,31 +142,31 @@ pub fn build_generic_target(dist_graph: &DistGraph, target: &GenericBuildStep) - )?; if !result.success() { - println!("Build exited non-zero: {}", result); + eprintln!("Build exited non-zero: {}", result); } - // Check that we got everything we expected, and normalize to ArtifactIdx => Artifact Path + let mut expected = BuildExpectations::new(dist_graph, &target.expected_binaries); + + // Since generic builds provide no feedback, blindly assume we got what + // we expected, BuildExpectations will check for us for binary_idx in &target.expected_binaries { let binary = dist_graph.binary(*binary_idx); - let binary_path = Utf8Path::new(&binary.file_name); - if binary_path.exists() { - for dest in &binary.copy_exe_to { - copy_file(binary_path, dest)?; - } - } else { - return Err(miette!( - "failed to find bin {} -- did the build above have errors?", - binary_path - )); - } + let src_path = Utf8PathBuf::from(&binary.file_name); + expected.found_bin(package_id_string(binary.pkg_id.as_ref()), src_path, vec![]); } + // Check and process the binaries + expected.process_bins(dist_graph)?; + Ok(()) } /// Similar to the above, but with slightly different signatures since /// it's not based around axoproject-identified binaries -pub fn run_extra_artifacts_build(dist_graph: &DistGraph, target: &ExtraBuildStep) -> Result<()> { +pub fn run_extra_artifacts_build( + dist_graph: &DistGraph, + target: &ExtraBuildStep, +) -> DistResult<()> { eprintln!( "building extra artifacts target (via {})", target.build_command.join(" ") @@ -177,7 +176,7 @@ pub fn run_extra_artifacts_build(dist_graph: &DistGraph, target: &ExtraBuildStep let dest = dist_graph.dist_dir.to_owned(); if !result.success() { - println!("Build exited non-zero: {}", result); + eprintln!("Build exited non-zero: {}", result); } // Check that we got everything we expected, and copy into the distribution path @@ -186,10 +185,10 @@ pub fn run_extra_artifacts_build(dist_graph: &DistGraph, target: &ExtraBuildStep if binary_path.exists() { copy_file(binary_path, &dest.join(artifact))?; } else { - return Err(miette!( - "failed to find bin {} -- did the build above have errors?", - binary_path - )); + return Err(DistError::MissingBinaries { + pkg_name: "extra build".to_owned(), + bin_name: artifact.clone(), + }); } } diff --git a/cargo-dist/src/build/mod.rs b/cargo-dist/src/build/mod.rs index 172012272..71b93fc97 100644 --- a/cargo-dist/src/build/mod.rs +++ b/cargo-dist/src/build/mod.rs @@ -1,4 +1,192 @@ //! Compiling Things +use axoproject::PackageId; +use camino::Utf8PathBuf; +use tracing::info; + +use crate::{ + copy_file, + linkage::{determine_linkage, Linkage}, + Binary, BinaryIdx, DistError, DistGraph, DistResult, FastMap, TargetTriple, +}; + pub mod cargo; pub mod generic; + +/// Output expectations for builds, and computed facts (all packages) +pub struct BuildExpectations { + /// Expectations grouped by package + pub packages: FastMap, +} + +/// Output expectations for builds, and computed facts (one package) +#[derive(Default)] +pub struct BinaryExpectations { + /// Expected binaries + pub binaries: FastMap, +} + +/// Binaries we expect +pub struct ExpectedBinary { + /// idx of the binary in the DistGraph + pub idx: BinaryIdx, + /// path to the binary in the build output + /// + /// Initially this is None, but should be Some by the end of the build from calls to found_bin + pub src_path: Option, + /// paths to the symbols of this binary in the build output + /// + /// Initially this is empty, but should be Some by the end of the build from calls to found_bin + pub sym_paths: Vec, + /// linkage for the binary + /// + /// Initially this is None, but can be Some by the end of process_bins + pub linkage: Option, +} + +impl BuildExpectations { + /// Create a new BuildExpectations + pub fn new(dist: &DistGraph, expected_binaries: &[BinaryIdx]) -> Self { + let mut packages = FastMap::::new(); + for &binary_idx in expected_binaries { + let binary = &dist.binary(binary_idx); + + // Get the package id or an empty string (for generic builds) + let package_id = package_id_string(binary.pkg_id.as_ref()); + let exe_name = binary.name.clone(); + + packages.entry(package_id).or_default().binaries.insert( + exe_name, + ExpectedBinary { + idx: binary_idx, + src_path: None, + sym_paths: vec![], + linkage: None, + }, + ); + } + + Self { packages } + } + + /// Report that a binary was found, which might have been expected + /// + /// This subroutine is responsible for sorting out whether we care about the binary, + /// and if the maybe_symbols are in fact symbols we care about. + pub fn found_bin( + &mut self, + pkg_id: String, + src_path: Utf8PathBuf, + maybe_symbols: Vec, + ) { + info!("got a new binary: {}", src_path); + + // lookup the package + let Some(pkg) = self.packages.get_mut(&pkg_id) else { + return; + }; + + // lookup the binary in the package + let Some(bin_name) = src_path.file_stem() else { + return; + }; + let Some(bin_result) = pkg.binaries.get_mut(bin_name) else { + return; + }; + + // Cool, we expected this binary, register its location! + bin_result.src_path = Some(src_path); + + // Also register symbols + for sym_path in maybe_symbols { + // FIXME: unhardcode this when we add support for other symbol kinds! + let is_symbols = sym_path.extension().map(|e| e == "pdb").unwrap_or(false); + if !is_symbols { + continue; + } + + // These are symbols we expected! Save the path. + bin_result.sym_paths.push(sym_path); + } + } + + /// Assuming the build is now complete, process the binaries as needed + /// + /// Currently this is: + /// + /// * checking src_path was set by found_bin + /// * computing linkage for the binary + /// * copying the binary and symbols to their final homes + /// + /// In the future this may also include: + /// + /// * code signing / hashing + /// * stripping + pub fn process_bins(&mut self, dist: &DistGraph) -> DistResult<()> { + let mut missing = vec![]; + for (pkg_id, pkg) in self.packages.iter_mut() { + for (bin_name, result_bin) in pkg.binaries.iter_mut() { + // If the src_path is missing, everything is bad + let Some(src_path) = result_bin.src_path.as_deref() else { + missing.push((pkg_id.to_owned(), bin_name.to_owned())); + continue; + }; + if !src_path.exists() { + missing.push((pkg_id.to_owned(), bin_name.to_owned())); + continue; + } + let bin = dist.binary(result_bin.idx); + + // compute linkage for the binary + compute_linkage(result_bin, &bin.target)?; + + // copy files to their final homes + copy_assets(result_bin, bin)?; + } + } + + // FIXME: properly bulk these together instead of just returning the first + #[allow(clippy::never_loop)] + for (pkg_name, bin_name) in missing { + return Err(DistError::MissingBinaries { pkg_name, bin_name }); + } + + Ok(()) + } +} + +// Compute the linkage info for this binary +fn compute_linkage(src: &mut ExpectedBinary, target: &TargetTriple) -> DistResult<()> { + let src_path = src + .src_path + .as_ref() + .expect("bin src_path should have been checked by caller"); + let linkage = determine_linkage(src_path, target)?; + src.linkage = Some(linkage); + Ok(()) +} + +// Copy the assets for this binary +fn copy_assets(src: &ExpectedBinary, dests: &Binary) -> DistResult<()> { + // Copy the main binary + let src_path = src + .src_path + .as_deref() + .expect("bin src_path should have been checked by caller"); + for dest_path in &dests.copy_exe_to { + copy_file(src_path, dest_path)?; + } + + // Copy the symbols + for sym_path in &src.sym_paths { + for dest_path in &dests.copy_symbols_to { + copy_file(sym_path, dest_path)?; + } + } + + Ok(()) +} + +fn package_id_string(id: Option<&PackageId>) -> String { + id.map(ToString::to_string).unwrap_or_default() +} diff --git a/cargo-dist/src/errors.rs b/cargo-dist/src/errors.rs index 6207ad504..8f43b2c0b 100644 --- a/cargo-dist/src/errors.rs +++ b/cargo-dist/src/errors.rs @@ -295,6 +295,16 @@ pub enum DistError { /// The file extension of the unrecognized file extension: String, }, + + /// Binaries were missing + #[error("failed to find bin {bin_name} for {pkg_name}")] + #[diagnostic(help("did the above build fail?"))] + MissingBinaries { + /// Name of package + pkg_name: String, + /// Name of binary + bin_name: String, + }, } impl From for DistError { diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index cc0b4c11c..a127cb5a3 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -18,14 +18,14 @@ use backend::{ ci::CiInfo, installer::{self, msi::MsiInstallerInfo, InstallerImpl}, }; -use camino::{Utf8Path, Utf8PathBuf}; use build::cargo::{build_cargo_target, rustup_toolchain}; +use build::generic::{build_generic_target, run_extra_artifacts_build}; +use camino::{Utf8Path, Utf8PathBuf}; use cargo_dist_schema::DistManifest; use config::{ ArtifactMode, ChecksumStyle, CompressionImpl, Config, DirtyMode, GenerateMode, ZipStyle, }; use console::Term; -use build::generic::{build_generic_target, run_extra_artifacts_build}; use semver::Version; use temp_dir::TempDir; use tracing::info; @@ -112,45 +112,42 @@ fn run_build_step( manifest: &DistManifest, ) -> Result<()> { match target { - BuildStep::Generic(target) => build_generic_target(dist_graph, target), - BuildStep::Cargo(target) => build_cargo_target(dist_graph, target), - BuildStep::Rustup(cmd) => rustup_toolchain(dist_graph, cmd), + BuildStep::Generic(target) => build_generic_target(dist_graph, target)?, + BuildStep::Cargo(target) => build_cargo_target(dist_graph, target)?, + BuildStep::Rustup(cmd) => rustup_toolchain(dist_graph, cmd)?, BuildStep::CopyFile(CopyStep { src_path, dest_path, - }) => copy_file(src_path, dest_path), + }) => copy_file(src_path, dest_path)?, BuildStep::CopyDir(CopyStep { src_path, dest_path, - }) => copy_dir(src_path, dest_path), + }) => copy_dir(src_path, dest_path)?, BuildStep::CopyFileOrDir(CopyStep { src_path, dest_path, - }) => copy_file_or_dir(src_path, dest_path), + }) => copy_file_or_dir(src_path, dest_path)?, BuildStep::Zip(ZipDirStep { src_path, dest_path, zip_style, with_root, - }) => zip_dir(src_path, dest_path, zip_style, with_root.as_deref()), - BuildStep::GenerateInstaller(installer) => { - generate_installer(dist_graph, installer, manifest) - } + }) => zip_dir(src_path, dest_path, zip_style, with_root.as_deref())?, + BuildStep::GenerateInstaller(installer) => generate_installer(dist_graph, installer, manifest)?, BuildStep::Checksum(ChecksumImpl { checksum, src_path, dest_path, - }) => Ok(generate_and_write_checksum(checksum, src_path, dest_path)?), + }) => generate_and_write_checksum(checksum, src_path, dest_path)?, BuildStep::GenerateSourceTarball(SourceTarballStep { committish, prefix, target, - }) => Ok(generate_source_tarball( - dist_graph, committish, prefix, target, - )?), - BuildStep::Extra(target) => run_extra_artifacts_build(dist_graph, target), - BuildStep::Updater(updater) => fetch_updater(dist_graph, updater), - } + }) => generate_source_tarball(dist_graph, committish, prefix, target)?, + BuildStep::Extra(target) => run_extra_artifacts_build(dist_graph, target)?, + BuildStep::Updater(updater) => fetch_updater(dist_graph, updater)?, + }; + Ok(()) } /// Fetches an installer executable and installs it in the expected target path. @@ -252,40 +249,40 @@ fn build_fake(dist_graph: &DistGraph, target: &BuildStep, manifest: &DistManifes match target { // These two are the meat: don't actually run these at all, just // fake them out - BuildStep::Generic(target) => build_fake_generic_artifacts(dist_graph, target), - BuildStep::Cargo(target) => build_fake_cargo_artifacts(dist_graph, target), + BuildStep::Generic(target) => build_fake_generic_artifacts(dist_graph, target)?, + BuildStep::Cargo(target) => build_fake_cargo_artifacts(dist_graph, target)?, // Never run rustup - BuildStep::Rustup(_) => Ok(()), + BuildStep::Rustup(_) => { }, // Copying files is fairly safe BuildStep::CopyFile(CopyStep { src_path, dest_path, - }) => copy_file(src_path, dest_path), + }) => copy_file(src_path, dest_path)?, BuildStep::CopyDir(CopyStep { src_path, dest_path, - }) => copy_dir(src_path, dest_path), + }) => copy_dir(src_path, dest_path)?, BuildStep::CopyFileOrDir(CopyStep { src_path, dest_path, - }) => copy_file_or_dir(src_path, dest_path), + }) => copy_file_or_dir(src_path, dest_path)?, // The remainder of these are mostly safe to run as fake steps BuildStep::Zip(ZipDirStep { src_path, dest_path, zip_style, with_root, - }) => zip_dir(src_path, dest_path, zip_style, with_root.as_deref()), + }) => zip_dir(src_path, dest_path, zip_style, with_root.as_deref())?, BuildStep::GenerateInstaller(installer) => match installer { // MSI, unlike other installers, isn't safe to generate on any platform - InstallerImpl::Msi(msi) => generate_fake_msi(dist_graph, msi, manifest), - _ => generate_installer(dist_graph, installer, manifest), + InstallerImpl::Msi(msi) => generate_fake_msi(dist_graph, msi, manifest)?, + _ => generate_installer(dist_graph, installer, manifest)?, }, BuildStep::Checksum(ChecksumImpl { checksum, src_path, dest_path, - }) => Ok(generate_and_write_checksum(checksum, src_path, dest_path)?), + }) => generate_and_write_checksum(checksum, src_path, dest_path)?, // Except source tarballs, which are definitely not okay // We mock these because it requires: // 1. git to be installed; @@ -297,13 +294,14 @@ fn build_fake(dist_graph: &DistGraph, target: &BuildStep, manifest: &DistManifes committish, prefix, target, - }) => Ok(generate_fake_source_tarball( + }) => generate_fake_source_tarball( dist_graph, committish, prefix, target, - )?), + )?, // Or extra artifacts, which may involve real builds - BuildStep::Extra(target) => run_fake_extra_artifacts_build(dist_graph, target), + BuildStep::Extra(target) => run_fake_extra_artifacts_build(dist_graph, target)?, BuildStep::Updater(_) => todo!(), } + Ok(()) } fn build_fake_cargo_artifacts(dist: &DistGraph, target: &CargoBuildStep) -> Result<()> { @@ -470,17 +468,17 @@ fn init_artifact_dir(_dist: &DistGraph, artifact: &Artifact) -> Result<()> { Ok(()) } -pub(crate) fn copy_file(src_path: &Utf8Path, dest_path: &Utf8Path) -> Result<()> { +pub(crate) fn copy_file(src_path: &Utf8Path, dest_path: &Utf8Path) -> DistResult<()> { LocalAsset::copy_named(src_path, dest_path)?; Ok(()) } -pub(crate) fn copy_dir(src_path: &Utf8Path, dest_path: &Utf8Path) -> Result<()> { +pub(crate) fn copy_dir(src_path: &Utf8Path, dest_path: &Utf8Path) -> DistResult<()> { LocalAsset::copy_dir_named(src_path, dest_path)?; Ok(()) } -pub(crate) fn copy_file_or_dir(src_path: &Utf8Path, dest_path: &Utf8Path) -> Result<()> { +pub(crate) fn copy_file_or_dir(src_path: &Utf8Path, dest_path: &Utf8Path) -> DistResult<()> { if src_path.is_dir() { copy_dir(src_path, dest_path) } else { diff --git a/cargo-dist/src/linkage.rs b/cargo-dist/src/linkage.rs index 57bde2635..352485174 100644 --- a/cargo-dist/src/linkage.rs +++ b/cargo-dist/src/linkage.rs @@ -443,7 +443,8 @@ fn do_pe(path: &Utf8PathBuf) -> DistResult> { } } -fn determine_linkage(path: &Utf8PathBuf, target: &str) -> DistResult { +/// Get the linkage for a single binary +pub fn determine_linkage(path: &Utf8PathBuf, target: &str) -> DistResult { let libraries = match target { // Can be run on any OS "i686-apple-darwin" | "x86_64-apple-darwin" | "aarch64-apple-darwin" => do_otool(path)?, From 09daab0cec2ea0e0f53eb23a2adf283db3865f90 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 11 Mar 2024 17:10:03 -0400 Subject: [PATCH 04/24] chore: pass down the dist-manifest to be mutated by builds, adding linkage --- cargo-dist/src/build/cargo.rs | 9 +- cargo-dist/src/build/generic.rs | 11 +- cargo-dist/src/build/mod.rs | 45 ++++--- cargo-dist/src/config.rs | 13 ++ cargo-dist/src/lib.rs | 23 ++-- cargo-dist/src/linkage.rs | 3 +- cargo-dist/src/manifest.rs | 45 +++---- cargo-dist/src/tasks.rs | 43 +++++-- cargo-dist/src/tests/tag.rs | 220 ++++++++++++++++++++++++++++---- 9 files changed, 319 insertions(+), 93 deletions(-) diff --git a/cargo-dist/src/build/cargo.rs b/cargo-dist/src/build/cargo.rs index 900e50399..72a829072 100644 --- a/cargo-dist/src/build/cargo.rs +++ b/cargo-dist/src/build/cargo.rs @@ -3,6 +3,7 @@ use std::env; use axoprocess::Cmd; +use cargo_dist_schema::DistManifest; use miette::{Context, IntoDiagnostic}; use tracing::warn; @@ -117,7 +118,11 @@ impl<'a> DistGraphBuilder<'a> { } /// Build a cargo target -pub fn build_cargo_target(dist_graph: &DistGraph, target: &CargoBuildStep) -> DistResult<()> { +pub fn build_cargo_target( + dist_graph: &DistGraph, + manifest: &mut DistManifest, + target: &CargoBuildStep, +) -> DistResult<()> { eprint!( "building cargo target ({}/{}", target.target_triple, target.profile @@ -206,7 +211,7 @@ pub fn build_cargo_target(dist_graph: &DistGraph, target: &CargoBuildStep) -> Di } // Process all the resulting binaries - expected.process_bins(dist_graph)?; + expected.process_bins(dist_graph, manifest)?; Ok(()) } diff --git a/cargo-dist/src/build/generic.rs b/cargo-dist/src/build/generic.rs index 99b35a7d8..46eb1687e 100644 --- a/cargo-dist/src/build/generic.rs +++ b/cargo-dist/src/build/generic.rs @@ -4,6 +4,7 @@ use std::{env, process::ExitStatus}; use axoprocess::Cmd; use camino::{Utf8Path, Utf8PathBuf}; +use cargo_dist_schema::DistManifest; use crate::{ build::{package_id_string, BuildExpectations}, @@ -127,8 +128,12 @@ fn run_build( Ok(command.status()?) } -/// Build a generic target -pub fn build_generic_target(dist_graph: &DistGraph, target: &GenericBuildStep) -> DistResult<()> { +/// Build a generic targets +pub fn build_generic_target( + dist_graph: &DistGraph, + manifest: &mut DistManifest, + target: &GenericBuildStep, +) -> DistResult<()> { eprintln!( "building generic target ({} via {})", target.target_triple, @@ -156,7 +161,7 @@ pub fn build_generic_target(dist_graph: &DistGraph, target: &GenericBuildStep) - } // Check and process the binaries - expected.process_bins(dist_graph)?; + expected.process_bins(dist_graph, manifest)?; Ok(()) } diff --git a/cargo-dist/src/build/mod.rs b/cargo-dist/src/build/mod.rs index 71b93fc97..4c4fc05d3 100644 --- a/cargo-dist/src/build/mod.rs +++ b/cargo-dist/src/build/mod.rs @@ -2,12 +2,12 @@ use axoproject::PackageId; use camino::Utf8PathBuf; +use cargo_dist_schema::{AssetInfo, DistManifest}; use tracing::info; use crate::{ - copy_file, - linkage::{determine_linkage, Linkage}, - Binary, BinaryIdx, DistError, DistGraph, DistResult, FastMap, TargetTriple, + copy_file, linkage::determine_linkage, Binary, BinaryIdx, DistError, DistGraph, DistResult, + SortedMap, TargetTriple, }; pub mod cargo; @@ -16,14 +16,14 @@ pub mod generic; /// Output expectations for builds, and computed facts (all packages) pub struct BuildExpectations { /// Expectations grouped by package - pub packages: FastMap, + pub packages: SortedMap, } /// Output expectations for builds, and computed facts (one package) #[derive(Default)] pub struct BinaryExpectations { /// Expected binaries - pub binaries: FastMap, + pub binaries: SortedMap, } /// Binaries we expect @@ -38,16 +38,12 @@ pub struct ExpectedBinary { /// /// Initially this is empty, but should be Some by the end of the build from calls to found_bin pub sym_paths: Vec, - /// linkage for the binary - /// - /// Initially this is None, but can be Some by the end of process_bins - pub linkage: Option, } impl BuildExpectations { /// Create a new BuildExpectations pub fn new(dist: &DistGraph, expected_binaries: &[BinaryIdx]) -> Self { - let mut packages = FastMap::::new(); + let mut packages = SortedMap::::new(); for &binary_idx in expected_binaries { let binary = &dist.binary(binary_idx); @@ -61,7 +57,6 @@ impl BuildExpectations { idx: binary_idx, src_path: None, sym_paths: vec![], - linkage: None, }, ); } @@ -122,7 +117,11 @@ impl BuildExpectations { /// /// * code signing / hashing /// * stripping - pub fn process_bins(&mut self, dist: &DistGraph) -> DistResult<()> { + pub fn process_bins( + &mut self, + dist: &DistGraph, + manifest: &mut DistManifest, + ) -> DistResult<()> { let mut missing = vec![]; for (pkg_id, pkg) in self.packages.iter_mut() { for (bin_name, result_bin) in pkg.binaries.iter_mut() { @@ -138,7 +137,7 @@ impl BuildExpectations { let bin = dist.binary(result_bin.idx); // compute linkage for the binary - compute_linkage(result_bin, &bin.target)?; + compute_linkage(dist, manifest, result_bin, &bin.target)?; // copy files to their final homes copy_assets(result_bin, bin)?; @@ -156,13 +155,27 @@ impl BuildExpectations { } // Compute the linkage info for this binary -fn compute_linkage(src: &mut ExpectedBinary, target: &TargetTriple) -> DistResult<()> { +fn compute_linkage( + dist: &DistGraph, + manifest: &mut DistManifest, + src: &mut ExpectedBinary, + target: &TargetTriple, +) -> DistResult<()> { let src_path = src .src_path .as_ref() .expect("bin src_path should have been checked by caller"); - let linkage = determine_linkage(src_path, target)?; - src.linkage = Some(linkage); + let linkage = determine_linkage(src_path, target)?.to_schema(); + let bin = dist.binary(src.idx); + manifest.assets.insert( + bin.id.clone(), + AssetInfo { + id: bin.id.clone(), + name: bin.name.clone(), + system: dist.system_id.clone(), + linkage: Some(linkage), + }, + ); Ok(()) } diff --git a/cargo-dist/src/config.rs b/cargo-dist/src/config.rs index bf9b3f983..191211c70 100644 --- a/cargo-dist/src/config.rs +++ b/cargo-dist/src/config.rs @@ -624,6 +624,19 @@ pub enum ArtifactMode { Lies, } +impl std::fmt::Display for ArtifactMode { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let string = match self { + ArtifactMode::Local => "local", + ArtifactMode::Global => "global", + ArtifactMode::Host => "host", + ArtifactMode::All => "all", + ArtifactMode::Lies => "lies", + }; + string.fmt(f) + } +} + /// The style of CI we should generate #[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] #[serde(rename_all = "kebab-case")] diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index a127cb5a3..bd0ee96e6 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -78,11 +78,12 @@ pub fn do_build(cfg: &Config) -> Result { if dist.local_builds_are_lies { build_fake(&dist, step, &manifest)?; } else { - run_build_step(&dist, step, &manifest)?; + run_build_step(&dist, step, &mut manifest)?; } } - // Compute linkage data now that we're done all builds + // Compute linkage data now that we've done all builds + // TODO(#848): delete this line to remove the old linkage system linkage::add_linkage_to_manifest(cfg, &dist, &mut manifest)?; // Next the global steps @@ -90,7 +91,7 @@ pub fn do_build(cfg: &Config) -> Result { if dist.local_builds_are_lies { build_fake(&dist, step, &manifest)?; } else { - run_build_step(&dist, step, &manifest)?; + run_build_step(&dist, step, &mut manifest)?; } } @@ -109,11 +110,11 @@ pub fn do_manifest(cfg: &Config) -> Result { fn run_build_step( dist_graph: &DistGraph, target: &BuildStep, - manifest: &DistManifest, + manifest: &mut DistManifest, ) -> Result<()> { match target { - BuildStep::Generic(target) => build_generic_target(dist_graph, target)?, - BuildStep::Cargo(target) => build_cargo_target(dist_graph, target)?, + BuildStep::Generic(target) => build_generic_target(dist_graph, manifest, target)?, + BuildStep::Cargo(target) => build_cargo_target(dist_graph, manifest, target)?, BuildStep::Rustup(cmd) => rustup_toolchain(dist_graph, cmd)?, BuildStep::CopyFile(CopyStep { src_path, @@ -133,7 +134,9 @@ fn run_build_step( zip_style, with_root, }) => zip_dir(src_path, dest_path, zip_style, with_root.as_deref())?, - BuildStep::GenerateInstaller(installer) => generate_installer(dist_graph, installer, manifest)?, + BuildStep::GenerateInstaller(installer) => { + generate_installer(dist_graph, installer, manifest)? + } BuildStep::Checksum(ChecksumImpl { checksum, src_path, @@ -252,7 +255,7 @@ fn build_fake(dist_graph: &DistGraph, target: &BuildStep, manifest: &DistManifes BuildStep::Generic(target) => build_fake_generic_artifacts(dist_graph, target)?, BuildStep::Cargo(target) => build_fake_cargo_artifacts(dist_graph, target)?, // Never run rustup - BuildStep::Rustup(_) => { }, + BuildStep::Rustup(_) => {} // Copying files is fairly safe BuildStep::CopyFile(CopyStep { src_path, @@ -294,9 +297,7 @@ fn build_fake(dist_graph: &DistGraph, target: &BuildStep, manifest: &DistManifes committish, prefix, target, - }) => generate_fake_source_tarball( - dist_graph, committish, prefix, target, - )?, + }) => generate_fake_source_tarball(dist_graph, committish, prefix, target)?, // Or extra artifacts, which may involve real builds BuildStep::Extra(target) => run_fake_extra_artifacts_build(dist_graph, target)?, BuildStep::Updater(_) => todo!(), diff --git a/cargo-dist/src/linkage.rs b/cargo-dist/src/linkage.rs index 352485174..c29e9ac0f 100644 --- a/cargo-dist/src/linkage.rs +++ b/cargo-dist/src/linkage.rs @@ -192,7 +192,8 @@ impl Linkage { s.to_owned() } - fn to_schema(&self) -> cargo_dist_schema::Linkage { + /// Construct a cargo_dist_schema::Linkage from a Linkage + pub fn to_schema(&self) -> cargo_dist_schema::Linkage { cargo_dist_schema::Linkage { binary: self.binary.clone(), target: self.target.clone(), diff --git a/cargo-dist/src/manifest.rs b/cargo-dist/src/manifest.rs index ecac0b851..ffbf3b41c 100644 --- a/cargo-dist/src/manifest.rs +++ b/cargo-dist/src/manifest.rs @@ -4,6 +4,7 @@ use std::collections::BTreeMap; use camino::{Utf8Path, Utf8PathBuf}; use cargo_dist_schema::{Asset, AssetKind, DistManifest, ExecutableAsset, Hosting}; +use tracing::warn; use crate::{ backend::{ @@ -30,21 +31,27 @@ pub fn load_and_merge_manifests( dist_version: _, // one value N machines system_info: _, - artifacts: _, - releases, - publish_prereleases, announcement_tag, - announcement_tag_is_implicit, - announcement_is_prerelease, - announcement_title, - announcement_changelog, - announcement_github_body, + announcement_tag_is_implicit: _, + announcement_is_prerelease: _, + announcement_title: _, + announcement_changelog: _, + announcement_github_body: _, + publish_prereleases: _, + artifacts, + releases, systems, assets, ci, linkage, } = manifest; + // Discard clearly unrelated manifests + if output.announcement_tag != announcement_tag { + warn!("found old manifest for the tag {announcement_tag:?}, ignoring it"); + continue; + } + // Merge every release for release in releases { // Ensure a release with this name and version exists @@ -63,28 +70,18 @@ pub fn load_and_merge_manifests( // in artifacts from other machines (`cargo dist plan` should know them all for now). } - if let Some(val) = announcement_tag { - output.announcement_tag = Some(val); - // Didn't wrap these in an option, so use announcement_tag as a proxy - output.announcement_is_prerelease = announcement_is_prerelease; - output.announcement_tag_is_implicit = announcement_tag_is_implicit; - output.publish_prereleases = publish_prereleases; - } - if let Some(val) = announcement_title { - output.announcement_title = Some(val); - } - if let Some(val) = announcement_changelog { - output.announcement_changelog = Some(val); - } - if let Some(val) = announcement_github_body { - output.announcement_github_body = Some(val); + for (artifact_id, artifact) in artifacts { + // TODO: merge these } + if let Some(val) = ci { // Don't bother doing an inner merge here, all or nothing output.ci = Some(val); }; - // Just merge all the linkage + // Just merge all the system-specific info + output.systems.extend(systems); + output.assets.extend(assets); output.linkage.extend(linkage); } diff --git a/cargo-dist/src/tasks.rs b/cargo-dist/src/tasks.rs index 40794b5c4..a1355b5ab 100644 --- a/cargo-dist/src/tasks.rs +++ b/cargo-dist/src/tasks.rs @@ -53,7 +53,7 @@ use std::collections::HashMap; use axoprocess::Cmd; use axoproject::{PackageId, PackageIdx, WorkspaceInfo}; use camino::Utf8PathBuf; -use cargo_dist_schema::DistManifest; +use cargo_dist_schema::{DistManifest, SystemId, SystemInfo}; use miette::{miette, Context, IntoDiagnostic}; use semver::Version; use serde::Serialize; @@ -137,6 +137,12 @@ pub struct BinaryIdx(pub usize); /// It also allows us to report what *should* happen without actually doing it. #[derive(Debug)] pub struct DistGraph { + /// Unique id for the system we're building on. + /// + /// Since the whole premise of cargo-dist is to invoke it once on each machine, and no + /// two machines have any reason to have the exact same CLI args for cargo-dist, we + /// just use a mangled form of the CLI arguments here. + pub system_id: SystemId, /// Whether it looks like `cargo dist init` has been run pub is_init: bool, @@ -703,6 +709,7 @@ pub(crate) struct DistGraphBuilder<'pkg_graph> { impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { pub(crate) fn new( + system_id: SystemId, tools: Tools, workspace: &'pkg_graph WorkspaceInfo, artifact_mode: ArtifactMode, @@ -958,8 +965,17 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { let hosting = crate::host::select_hosting(workspace, hosting.clone(), ci.as_deref()); + let system = SystemInfo { + id: system_id.clone(), + cargo_version_line, + artifacts: vec![], + assets: vec![], + }; + let systems = SortedMap::from_iter([(system_id.clone(), system)]); + Ok(Self { inner: DistGraph { + system_id, is_init: desired_cargo_dist_version.is_some(), target_dir, workspace_dir, @@ -1015,7 +1031,7 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { announcement_github_body: None, releases: vec![], artifacts: Default::default(), - systems: Default::default(), + systems, assets: Default::default(), publish_prereleases, ci: None, @@ -1131,8 +1147,8 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { .. } = self.release_mut(to_release); let static_assets = static_assets.clone(); - let id = format!("{release_id}-{target}"); - info!("added variant {id}"); + let variant_id = format!("{release_id}-{target}"); + info!("added variant {variant_id}"); variants.push(idx); targets.push(target.clone()); @@ -1142,20 +1158,16 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { for (pkg_idx, binary_name) in bins.clone() { let package = self.workspace.package(pkg_idx); let package_metadata = self.package_metadata(pkg_idx); - let version = package - .version - .as_ref() - .expect("Package version is mandatory!") - .semver(); let pkg_id = package.cargo_package_id.clone(); // For now we just use the name of the package as its package_spec. // I'm not sure if there are situations where this is ambiguous when // referring to a package in your workspace that you want to build an app for. // If they do exist, that's deeply cursed and I want a user to tell me about it. let pkg_spec = package.name.clone(); - let id = format!("{binary_name}-v{version}-{target}"); + // FIXME: make this more of a GUID to allow variants to share binaries? + let bin_id = format!("{variant_id}-{binary_name}"); - let idx = if let Some(&idx) = self.binaries_by_id.get(&id) { + let idx = if let Some(&idx) = self.binaries_by_id.get(&bin_id) { // If we already are building this binary we don't need to do it again! idx } else { @@ -1176,10 +1188,10 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { let file_name = format!("{binary_name}{platform_exe_ext}"); - info!("added binary {id}"); + info!("added binary {bin_id}"); let idx = BinaryIdx(self.inner.binaries.len()); let binary = Binary { - id, + id: bin_id.clone(), pkg_id, pkg_spec, pkg_idx, @@ -1192,6 +1204,7 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { features, }; self.inner.binaries.push(binary); + self.binaries_by_id.insert(bin_id, idx); idx }; @@ -1200,7 +1213,7 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { self.inner.variants.push(ReleaseVariant { target, - id, + id: variant_id, local_artifacts: vec![], binaries, static_assets, @@ -2807,7 +2820,9 @@ pub fn gather_work(cfg: &Config) -> Result<(DistGraph, DistManifest)> { info!("analyzing workspace:"); let tools = tool_info()?; let workspace = crate::config::get_project()?; + let system_id = format!("{}:{}", cfg.artifact_mode, cfg.targets.join(",")); let mut graph = DistGraphBuilder::new( + system_id, tools, &workspace, cfg.artifact_mode, diff --git a/cargo-dist/src/tests/tag.rs b/cargo-dist/src/tests/tag.rs index 2bcfa4814..715823424 100644 --- a/cargo-dist/src/tests/tag.rs +++ b/cargo-dist/src/tests/tag.rs @@ -18,7 +18,15 @@ fn parse_one() { let tag = format!("{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -35,7 +43,15 @@ fn parse_one_v() { let tag = format!("v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -52,7 +68,15 @@ fn parse_one_package_v() { let tag = format!("{BIN_AXO_NAME}-v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -69,7 +93,15 @@ fn parse_one_package() { let tag = format!("{BIN_AXO_NAME}-{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -86,7 +118,15 @@ fn parse_one_v_alpha() { let tag = format!("v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(announcing.prerelease); @@ -103,7 +143,15 @@ fn parse_one_package_v_alpha() { let tag = format!("{BIN_AXO_NAME}-v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(announcing.prerelease); @@ -120,7 +168,15 @@ fn parse_one_prefix_slashv() { let tag = format!("release/v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -137,7 +193,15 @@ fn parse_one_prefix_slash() { let tag = format!("release/{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -154,7 +218,15 @@ fn parse_one_prefix_slash_package_v() { let tag = format!("release/{BIN_AXO_NAME}-v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -171,7 +243,15 @@ fn parse_one_prefix_slash_package_slashv() { let tag = format!("releases/{BIN_AXO_NAME}/v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -188,7 +268,15 @@ fn parse_one_package_slashv() { let tag = format!("{BIN_AXO_NAME}/v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -205,7 +293,15 @@ fn parse_one_prefix_slash_package_slash() { let tag = format!("releases/{BIN_AXO_NAME}/{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -222,7 +318,15 @@ fn parse_one_prefix_many_slash_package_slash() { let tag = format!("blah/blah/releases/{BIN_AXO_NAME}/{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -239,7 +343,15 @@ fn parse_one_package_slash() { let tag = format!("{BIN_AXO_NAME}/{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -256,7 +368,15 @@ fn parse_one_infer() { let tag = format!("v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, None, true).unwrap(); assert!(!announcing.prerelease); @@ -273,7 +393,15 @@ fn parse_unified_v() { let tag = format!("v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -293,7 +421,15 @@ fn parse_unified_infer() { let tag = format!("v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, None, true).unwrap(); assert!(!announcing.prerelease); @@ -313,7 +449,15 @@ fn parse_unified_lib() { let tag = format!("{LIB_SOME_NAME}-v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -330,7 +474,15 @@ fn parse_disjoint_v() { let tag = format!("v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -351,7 +503,15 @@ fn parse_disjoint_infer() { let tag = format!("v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, None, true).unwrap(); assert!(!announcing.prerelease); @@ -371,7 +531,15 @@ fn parse_disjoint_v_oddball() { let tag = format!("v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); @@ -388,7 +556,15 @@ fn parse_disjoint_lib() { let tag = format!("{LIB_OTHER_NAME}-v{version}"); let tools = mock_tools(); - let graph = DistGraphBuilder::new(tools, &workspace, ArtifactMode::All, true, false).unwrap(); + let graph = DistGraphBuilder::new( + "a".to_owned(), + tools, + &workspace, + ArtifactMode::All, + true, + false, + ) + .unwrap(); let announcing = select_tag(&graph, Some(&tag), true).unwrap(); assert!(!announcing.prerelease); From 950a3190e38ffe4983fedc1a6743a0faaa0c3a5a Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Tue, 12 Mar 2024 12:37:55 -0400 Subject: [PATCH 05/24] feat(manifest-reform): add upload_files array to dist-manifest this makes it possible to include files not built on this machine in the manifest --- cargo-dist-schema/src/lib.rs | 5 +++++ cargo-dist/src/manifest.rs | 15 ++++++++++++--- cargo-dist/src/tasks.rs | 1 + cargo-dist/templates/ci/github_ci.yml.j2 | 4 ++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/cargo-dist-schema/src/lib.rs b/cargo-dist-schema/src/lib.rs index 53c8abbf0..580b80e4d 100644 --- a/cargo-dist-schema/src/lib.rs +++ b/cargo-dist-schema/src/lib.rs @@ -95,6 +95,10 @@ pub struct DistManifest { #[serde(skip_serializing_if = "Vec::is_empty")] /// Data about dynamic linkage in the built libraries pub linkage: Vec, + /// Files to upload + #[serde(default)] + #[serde(skip_serializing_if = "Vec::is_empty")] + pub upload_files: Vec, } /// Info about an Asset (binary) @@ -418,6 +422,7 @@ impl DistManifest { publish_prereleases: false, ci: None, linkage: vec![], + upload_files: vec![], } } diff --git a/cargo-dist/src/manifest.rs b/cargo-dist/src/manifest.rs index ffbf3b41c..38ef5ea8c 100644 --- a/cargo-dist/src/manifest.rs +++ b/cargo-dist/src/manifest.rs @@ -38,6 +38,7 @@ pub fn load_and_merge_manifests( announcement_changelog: _, announcement_github_body: _, publish_prereleases: _, + upload_files: _, artifacts, releases, systems, @@ -65,9 +66,9 @@ pub fn load_and_merge_manifests( if let Some(hosting) = github { out_release.hosting.github = Some(hosting); } - // NOTE: *do not* merge artifact info, it's currently load-bearing for each machine - // to only list the artifacts it specifically generates, so we don't want to merge - // in artifacts from other machines (`cargo dist plan` should know them all for now). + if !release.artifacts.is_empty() { + // TODO: merge these? or just always use our own? + } } for (artifact_id, artifact) in artifacts { @@ -136,6 +137,10 @@ pub(crate) fn add_releases_to_manifest( let id = &dist.artifact(artifact_idx).id; all_artifacts.insert(id.clone(), manifest_artifact(cfg, dist, artifact_idx)); artifacts.push(id.clone()); + if !cfg.no_local_paths { + let artifact = dist.artifact(artifact_idx); + manifest.upload_files.push(artifact.file_path.to_string()); + } } for &variant_idx in &release.variants { let variant = dist.variant(variant_idx); @@ -143,6 +148,10 @@ pub(crate) fn add_releases_to_manifest( let id = &dist.artifact(artifact_idx).id; all_artifacts.insert(id.clone(), manifest_artifact(cfg, dist, artifact_idx)); artifacts.push(id.clone()); + if !cfg.no_local_paths { + let artifact = dist.artifact(artifact_idx); + manifest.upload_files.push(artifact.file_path.to_string()); + } } } diff --git a/cargo-dist/src/tasks.rs b/cargo-dist/src/tasks.rs index a1355b5ab..327fb0a55 100644 --- a/cargo-dist/src/tasks.rs +++ b/cargo-dist/src/tasks.rs @@ -1036,6 +1036,7 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { publish_prereleases, ci: None, linkage: vec![], + upload_files: vec![], }, package_metadata, workspace_metadata, diff --git a/cargo-dist/templates/ci/github_ci.yml.j2 b/cargo-dist/templates/ci/github_ci.yml.j2 index ca3fe8a47..e26d0bdff 100644 --- a/cargo-dist/templates/ci/github_ci.yml.j2 +++ b/cargo-dist/templates/ci/github_ci.yml.j2 @@ -200,7 +200,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -270,7 +270,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" From f3dbf362e0799f4e08bd125e1b2a1b608d740aca Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Tue, 12 Mar 2024 14:56:03 -0400 Subject: [PATCH 06/24] feat(manifest-reform): properly merge and populate artifact/asset info --- cargo-dist-schema/src/lib.rs | 12 ++-- cargo-dist/src/manifest.rs | 127 ++++++++++++++++++++++++++--------- cargo-dist/src/tasks.rs | 2 - 3 files changed, 101 insertions(+), 40 deletions(-) diff --git a/cargo-dist-schema/src/lib.rs b/cargo-dist-schema/src/lib.rs index 580b80e4d..e990c0251 100644 --- a/cargo-dist-schema/src/lib.rs +++ b/cargo-dist-schema/src/lib.rs @@ -91,9 +91,13 @@ pub struct DistManifest { #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] pub ci: Option, - #[serde(default)] - #[serde(skip_serializing_if = "Vec::is_empty")] /// Data about dynamic linkage in the built libraries + #[serde(default)] + // FIXME: turn on this skip_serializing_if at some point. + // old dist-manifest consumers don't think this field can + // be missing, so it's unsafe to stop emitting it, but + // we want to deprecate it at some point. + // #[serde(skip_serializing_if = "Vec::is_empty")] pub linkage: Vec, /// Files to upload #[serde(default)] @@ -206,10 +210,6 @@ pub struct SystemInfo { pub id: SystemId, /// The version of Cargo used (first line of cargo -vV) pub cargo_version_line: Option, - /// The Artifacts built by this system - pub artifacts: Vec, - /// The Assets built by this system - pub assets: Vec, } /// A Release of an Application diff --git a/cargo-dist/src/manifest.rs b/cargo-dist/src/manifest.rs index 38ef5ea8c..42c2a4d1f 100644 --- a/cargo-dist/src/manifest.rs +++ b/cargo-dist/src/manifest.rs @@ -1,9 +1,45 @@ //! Utilities for managing DistManifests +//! +//! dist-manifest.json serves 3 purposes: +//! +//! * providing a preview of what the build will produce before doing it +//! * providing final information for a build +//! * being a communication protocol between build machines +//! +//! The flow of data into the manifest is as follows (see gather_work): +//! +//! 1. Create DistGraphBuilder with a nearly default/empty manifest. +//! This is a baseline value that will be iteratively refined. +//! +//! 2. Find dist-manifest files in the dist dir, import and merge them. +//! This typically is importing manifests from other machines, such +//! as the 'plan' machine which allocated a hosting bucket or +//! the 'build-*' machines which computed system info and linkage. +//! +//! 3. Compute Hosting (if not covered by 2), potentially allocating a +//! hosting bucket that we'll be uploading final results to. This needs +//! to be known early because the resulting URLs need to be baked into +//! installers. +//! +//! 3. Build the DistGraph, representing the things the current machine +//! is supposed to build. Update the dist-manifest.json with those +//! entries (Releases and Artifacts). +//! +//! 4. Compute Announcement info, potentially populating things like +//! changelogs and titles. +//! +//! 5. Compute CI Info, potentially populating things like github ci matrices. +//! +//! 6. Build binaries, adding information about each built binary to Assets. +//! +//! 7. Build installers, using information in the manifest from steps 2, 3, and 4. -use std::collections::BTreeMap; +use std::collections::btree_map::Entry; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{Asset, AssetKind, DistManifest, ExecutableAsset, Hosting}; +use cargo_dist_schema::{ + Artifact, ArtifactId, Asset, AssetKind, DistManifest, ExecutableAsset, Hosting, +}; use tracing::warn; use crate::{ @@ -13,7 +49,7 @@ use crate::{ }, config::Config, errors::DistResult, - ArtifactIdx, ArtifactKind, DistGraph, StaticAssetKind, + ArtifactIdx, ArtifactKind, DistGraph, Release, StaticAssetKind, }; /// Load DistManifests into the given dir and merge them into the current one @@ -66,13 +102,16 @@ pub fn load_and_merge_manifests( if let Some(hosting) = github { out_release.hosting.github = Some(hosting); } - if !release.artifacts.is_empty() { - // TODO: merge these? or just always use our own? + // If the input has a list of artifacts for this release, merge them + for artifact in release.artifacts { + if !out_release.artifacts.contains(&artifact) { + out_release.artifacts.push(artifact); + } } } for (artifact_id, artifact) in artifacts { - // TODO: merge these + merge_artifact(output, artifact_id, artifact); } if let Some(val) = ci { @@ -89,6 +128,36 @@ pub fn load_and_merge_manifests( Ok(()) } +/// Merge the artifact entries at a more granular level. +/// +/// At a fundamental level here we're trying to populate artifact[].assets[].id +/// if another machine set it (indicating they actually built that asset), while +/// still allowing for other manifests to contain these same artifacts entries +/// without any conflict. +fn merge_artifact(output: &mut DistManifest, artifact_id: ArtifactId, artifact: Artifact) { + match output.artifacts.entry(artifact_id) { + Entry::Vacant(out_artifact) => { + out_artifact.insert(artifact); + } + Entry::Occupied(mut out_artifact) => { + let out_artifact = out_artifact.get_mut(); + for asset in artifact.assets { + if let Some(out_asset) = out_artifact + .assets + .iter_mut() + .find(|a| a.path == asset.path) + { + if let Some(id) = asset.id { + out_asset.id = Some(id); + } + } else { + out_artifact.assets.push(asset); + } + } + } + } +} + /// Load manifests from the current dir fn load_manifests(manifest_dir: &Utf8Path) -> DistResult> { // This happens on clean builds with no manifests to slurp up, and the dist-dir @@ -129,47 +198,29 @@ pub(crate) fn add_releases_to_manifest( dist: &DistGraph, manifest: &mut DistManifest, ) -> DistResult<()> { - let mut all_artifacts = BTreeMap::::new(); for release in &dist.releases { // Gather up all the local and global artifacts - let mut artifacts = vec![]; for &artifact_idx in &release.global_artifacts { - let id = &dist.artifact(artifact_idx).id; - all_artifacts.insert(id.clone(), manifest_artifact(cfg, dist, artifact_idx)); - artifacts.push(id.clone()); - if !cfg.no_local_paths { - let artifact = dist.artifact(artifact_idx); - manifest.upload_files.push(artifact.file_path.to_string()); - } + add_manifest_artifact(cfg, dist, manifest, release, artifact_idx); } for &variant_idx in &release.variants { let variant = dist.variant(variant_idx); for &artifact_idx in &variant.local_artifacts { - let id = &dist.artifact(artifact_idx).id; - all_artifacts.insert(id.clone(), manifest_artifact(cfg, dist, artifact_idx)); - artifacts.push(id.clone()); - if !cfg.no_local_paths { - let artifact = dist.artifact(artifact_idx); - manifest.upload_files.push(artifact.file_path.to_string()); - } + add_manifest_artifact(cfg, dist, manifest, release, artifact_idx); } } - - // Add the artifacts to this release - manifest - .ensure_release(release.app_name.clone(), release.version.to_string()) - .artifacts = artifacts; } - manifest.artifacts = all_artifacts; Ok(()) } -fn manifest_artifact( +fn add_manifest_artifact( cfg: &Config, dist: &DistGraph, + manifest: &mut DistManifest, + release: &Release, artifact_idx: ArtifactIdx, -) -> cargo_dist_schema::Artifact { +) { let artifact = dist.artifact(artifact_idx); let mut assets = vec![]; @@ -180,7 +231,7 @@ fn manifest_artifact( let binary = &dist.binary(binary_idx); let symbols_artifact = binary.symbols_artifact.map(|a| dist.artifact(a).id.clone()); Asset { - id: None, + id: Some(binary.id.clone()), name: Some(binary.name.clone()), // Always copied to the root... for now path: Some(exe_path.file_name().unwrap().to_owned()), @@ -301,7 +352,7 @@ fn manifest_artifact( let checksum = artifact.checksum.map(|idx| dist.artifact(idx).id.clone()); - cargo_dist_schema::Artifact { + let out_artifact = cargo_dist_schema::Artifact { name: Some(artifact.id.clone()), path: if cfg.no_local_paths { None @@ -314,5 +365,17 @@ fn manifest_artifact( assets, kind, checksum, + }; + + if !cfg.no_local_paths { + manifest.upload_files.push(artifact.file_path.to_string()); + } + merge_artifact(manifest, artifact.id.clone(), out_artifact); + + // If the input has a list of artifacts for this release, merge them + let out_release = + manifest.ensure_release(release.app_name.clone(), release.version.to_string()); + if !out_release.artifacts.contains(&artifact.id) { + out_release.artifacts.push(artifact.id.clone()); } } diff --git a/cargo-dist/src/tasks.rs b/cargo-dist/src/tasks.rs index 327fb0a55..1e309d544 100644 --- a/cargo-dist/src/tasks.rs +++ b/cargo-dist/src/tasks.rs @@ -968,8 +968,6 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { let system = SystemInfo { id: system_id.clone(), cargo_version_line, - artifacts: vec![], - assets: vec![], }; let systems = SortedMap::from_iter([(system_id.clone(), system)]); From da8e187a4d41cbb7b9a1ef142b129048b3604db2 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Tue, 12 Mar 2024 15:03:26 -0400 Subject: [PATCH 07/24] chore: regenerate snapshots --- .../snapshots/cargo_dist_schema__emit.snap | 79 +++++++++++++++++-- .../tests/snapshots/akaikatana_basic.snap | 25 ++++-- .../tests/snapshots/akaikatana_musl.snap | 25 ++++-- .../akaikatana_repo_with_dot_git.snap | 25 ++++-- .../tests/snapshots/akaikatana_updaters.snap | 25 ++++-- .../tests/snapshots/axolotlsay_abyss.snap | 18 +++-- .../snapshots/axolotlsay_abyss_only.snap | 18 +++-- .../tests/snapshots/axolotlsay_basic.snap | 18 +++-- .../snapshots/axolotlsay_custom_formula.snap | 17 ++-- .../axolotlsay_custom_github_runners.snap | 17 ++-- .../tests/snapshots/axolotlsay_dispatch.snap | 17 ++-- .../snapshots/axolotlsay_dispatch_abyss.snap | 17 ++-- .../axolotlsay_dispatch_abyss_only.snap | 17 ++-- .../snapshots/axolotlsay_edit_existing.snap | 17 ++-- .../tests/snapshots/axolotlsay_musl.snap | 17 ++-- .../snapshots/axolotlsay_musl_no_gnu.snap | 16 ++-- .../axolotlsay_no_homebrew_publish.snap | 17 ++-- .../tests/snapshots/axolotlsay_no_locals.snap | 15 +++- .../axolotlsay_no_locals_but_custom.snap | 15 +++- .../axolotlsay_ssldotcom_windows_sign.snap | 18 +++-- ...xolotlsay_ssldotcom_windows_sign_prod.snap | 18 +++-- .../snapshots/axolotlsay_tag_namespace.snap | 17 ++-- .../tests/snapshots/axolotlsay_updaters.snap | 18 +++-- .../axolotlsay_user_global_build_job.snap | 17 ++-- .../snapshots/axolotlsay_user_host_job.snap | 17 ++-- .../axolotlsay_user_local_build_job.snap | 17 ++-- .../snapshots/axolotlsay_user_plan_job.snap | 17 ++-- .../axolotlsay_user_publish_job.snap | 17 ++-- .../snapshots/install_path_cargo_home.snap | 13 ++- .../snapshots/install_path_env_no_subdir.snap | 13 ++- .../snapshots/install_path_env_subdir.snap | 13 ++- .../install_path_env_subdir_space.snap | 13 ++- .../install_path_env_subdir_space_deeper.snap | 13 ++- .../install_path_home_subdir_deeper.snap | 13 ++- .../install_path_home_subdir_min.snap | 13 ++- .../install_path_home_subdir_space.snap | 13 ++- ...install_path_home_subdir_space_deeper.snap | 13 ++- cargo-dist/tests/snapshots/lib_manifest.snap | 11 +-- .../tests/snapshots/lib_manifest_slash.snap | 11 +-- cargo-dist/tests/snapshots/manifest.snap | 18 +++-- 40 files changed, 547 insertions(+), 181 deletions(-) diff --git a/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap b/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap index b38bdca6c..90469760a 100644 --- a/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap +++ b/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap @@ -7,9 +7,6 @@ expression: json_schema "title": "DistManifest", "description": "A report of the releases and artifacts that cargo-dist generated", "type": "object", - "required": [ - "linkage" - ], "properties": { "announcement_changelog": { "description": "A changelog for the announcement", @@ -56,6 +53,13 @@ expression: json_schema "$ref": "#/definitions/Artifact" } }, + "assets": { + "description": "The assets contained within artifacts (binaries)", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AssetInfo" + } + }, "ci": { "description": "ci backend info", "anyOf": [ @@ -76,6 +80,7 @@ expression: json_schema }, "linkage": { "description": "Data about dynamic linkage in the built libraries", + "default": [], "type": "array", "items": { "$ref": "#/definitions/Linkage" @@ -94,7 +99,7 @@ expression: json_schema } }, "system_info": { - "description": "Info about the toolchain used to build this announcement", + "description": "Info about the toolchain used to build this announcement\n\nDEPRECATED: never appears anymore", "anyOf": [ { "$ref": "#/definitions/SystemInfo" @@ -103,6 +108,20 @@ expression: json_schema "type": "null" } ] + }, + "systems": { + "description": "The systems that artifacts were built on", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/SystemInfo" + } + }, + "upload_files": { + "description": "Files to upload", + "type": "array", + "items": { + "type": "string" + } } }, "definitions": { @@ -411,6 +430,13 @@ expression: json_schema } ], "properties": { + "id": { + "description": "A unique opaque id for an Asset", + "type": [ + "string", + "null" + ] + }, "name": { "description": "The high-level name of the asset", "type": [ @@ -427,6 +453,40 @@ expression: json_schema } } }, + "AssetInfo": { + "description": "Info about an Asset (binary)", + "type": "object", + "required": [ + "id", + "name", + "system" + ], + "properties": { + "id": { + "description": "unique id of the Asset", + "type": "string" + }, + "linkage": { + "description": "the linkage of this Asset", + "anyOf": [ + { + "$ref": "#/definitions/Linkage" + }, + { + "type": "null" + } + ] + }, + "name": { + "description": "filename of the Asset", + "type": "string" + }, + "system": { + "description": "the system it was built on", + "type": "string" + } + } + }, "CiInfo": { "description": "CI backend info", "type": "object", @@ -708,15 +768,22 @@ expression: json_schema } }, "SystemInfo": { - "description": "Info about the system/toolchain used to build this announcement.\n\nNote that this is info from the machine that generated this file, which *ideally* should be similar to the machines that built all the artifacts, but we can't guarantee that.\n\ndist-manifest.json is by default generated at the start of the build process, and typically on a linux machine because that's usually the fastest/cheapest part of CI infra.", + "description": "Info about a system used to build this announcement.", "type": "object", + "required": [ + "id" + ], "properties": { "cargo_version_line": { - "description": "The version of Cargo used (first line of cargo -vV)\n\nNote that this is the version used on the machine that generated this file, which presumably should be the same version used on all the machines that built all the artifacts, but maybe not! It's more likely to be correct if rust-toolchain.toml is used with a specific pinned version.", + "description": "The version of Cargo used (first line of cargo -vV)", "type": [ "string", "null" ] + }, + "id": { + "description": "The unique id of the System", + "type": "string" } } } diff --git a/cargo-dist/tests/snapshots/akaikatana_basic.snap b/cargo-dist/tests/snapshots/akaikatana_basic.snap index 310dfea09..8af056919 100644 --- a/cargo-dist/tests/snapshots/akaikatana_basic.snap +++ b/cargo-dist/tests/snapshots/akaikatana_basic.snap @@ -1243,9 +1243,6 @@ try { "announcement_is_prerelease": false, "announcement_title": "v0.2.0", "announcement_github_body": "## Install akaikatana-repack 0.2.0\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install mistydemeo/homebrew-formulae/akaikatana-repack\n```\n\n## Download akaikatana-repack 0.2.0\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [akaikatana-repack-aarch64-apple-darwin.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz.sha256) |\n| [akaikatana-repack-x86_64-apple-darwin.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz.sha256) |\n| [akaikatana-repack-x86_64-pc-windows-msvc.zip](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip.sha256) |\n| [akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "akaikatana-repack", @@ -1291,16 +1288,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1353,16 +1353,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1395,16 +1398,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-pc-windows-msvc-akextract", "name": "akextract", "path": "akextract.exe", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-pc-windows-msvc-akmetadata", "name": "akmetadata", "path": "akmetadata.exe", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-pc-windows-msvc-akrepack", "name": "akrepack", "path": "akrepack.exe", "kind": "executable" @@ -1437,16 +1443,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1482,6 +1491,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -1669,7 +1684,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -1714,7 +1729,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/akaikatana_musl.snap b/cargo-dist/tests/snapshots/akaikatana_musl.snap index bbdd76c4c..786e96b34 100644 --- a/cargo-dist/tests/snapshots/akaikatana_musl.snap +++ b/cargo-dist/tests/snapshots/akaikatana_musl.snap @@ -858,9 +858,6 @@ download_binary_and_run_installer "$@" || exit 1 "announcement_is_prerelease": false, "announcement_title": "v0.2.0", "announcement_github_body": "## Install akaikatana-repack 0.2.0\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.sh | sh\n```\n\n## Download akaikatana-repack 0.2.0\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [akaikatana-repack-aarch64-apple-darwin.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz.sha256) |\n| [akaikatana-repack-x86_64-apple-darwin.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz.sha256) |\n| [akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n| [akaikatana-repack-x86_64-unknown-linux-musl.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-musl.tar.xz) | x64 MUSL Linux | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-musl.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "akaikatana-repack", @@ -904,16 +901,19 @@ download_binary_and_run_installer "$@" || exit 1 "kind": "readme" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -958,16 +958,19 @@ download_binary_and_run_installer "$@" || exit 1 "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1000,16 +1003,19 @@ download_binary_and_run_installer "$@" || exit 1 "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1042,16 +1048,19 @@ download_binary_and_run_installer "$@" || exit 1 "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-musl-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-musl-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-musl-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1076,6 +1085,12 @@ download_binary_and_run_installer "$@" || exit 1 "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -1264,7 +1279,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -1309,7 +1324,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/akaikatana_repo_with_dot_git.snap b/cargo-dist/tests/snapshots/akaikatana_repo_with_dot_git.snap index 310dfea09..8af056919 100644 --- a/cargo-dist/tests/snapshots/akaikatana_repo_with_dot_git.snap +++ b/cargo-dist/tests/snapshots/akaikatana_repo_with_dot_git.snap @@ -1243,9 +1243,6 @@ try { "announcement_is_prerelease": false, "announcement_title": "v0.2.0", "announcement_github_body": "## Install akaikatana-repack 0.2.0\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install mistydemeo/homebrew-formulae/akaikatana-repack\n```\n\n## Download akaikatana-repack 0.2.0\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [akaikatana-repack-aarch64-apple-darwin.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz.sha256) |\n| [akaikatana-repack-x86_64-apple-darwin.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz.sha256) |\n| [akaikatana-repack-x86_64-pc-windows-msvc.zip](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip.sha256) |\n| [akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "akaikatana-repack", @@ -1291,16 +1288,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1353,16 +1353,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1395,16 +1398,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-pc-windows-msvc-akextract", "name": "akextract", "path": "akextract.exe", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-pc-windows-msvc-akmetadata", "name": "akmetadata", "path": "akmetadata.exe", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-pc-windows-msvc-akrepack", "name": "akrepack", "path": "akrepack.exe", "kind": "executable" @@ -1437,16 +1443,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1482,6 +1491,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -1669,7 +1684,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -1714,7 +1729,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/akaikatana_updaters.snap b/cargo-dist/tests/snapshots/akaikatana_updaters.snap index 0ac771907..65fe0f765 100644 --- a/cargo-dist/tests/snapshots/akaikatana_updaters.snap +++ b/cargo-dist/tests/snapshots/akaikatana_updaters.snap @@ -1259,9 +1259,6 @@ try { "announcement_is_prerelease": false, "announcement_title": "v0.2.0", "announcement_github_body": "## Install akaikatana-repack 0.2.0\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install mistydemeo/homebrew-formulae/akaikatana-repack\n```\n\n## Download akaikatana-repack 0.2.0\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [akaikatana-repack-aarch64-apple-darwin.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz.sha256) |\n| [akaikatana-repack-x86_64-apple-darwin.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz.sha256) |\n| [akaikatana-repack-x86_64-pc-windows-msvc.zip](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip.sha256) |\n| [akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/mistydemeo/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "akaikatana-repack", @@ -1318,16 +1315,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-aarch64-apple-darwin-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1387,16 +1387,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-apple-darwin-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1436,16 +1439,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-pc-windows-msvc-akextract", "name": "akextract", "path": "akextract.exe", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-pc-windows-msvc-akmetadata", "name": "akmetadata", "path": "akmetadata.exe", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-pc-windows-msvc-akrepack", "name": "akrepack", "path": "akrepack.exe", "kind": "executable" @@ -1485,16 +1491,19 @@ try { "kind": "readme" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akextract", "name": "akextract", "path": "akextract", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akmetadata", "name": "akmetadata", "path": "akmetadata", "kind": "executable" }, { + "id": "akaikatana-repack-x86_64-unknown-linux-gnu-akrepack", "name": "akrepack", "path": "akrepack", "kind": "executable" @@ -1530,6 +1539,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -1717,7 +1732,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -1762,7 +1777,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_abyss.snap b/cargo-dist/tests/snapshots/axolotlsay_abyss.snap index 9d02c2285..f94ad3f17 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_abyss.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_abyss.snap @@ -2077,9 +2077,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.msi](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-pc-windows-msvc.msi) | x64 Windows | [checksum](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-pc-windows-msvc.msi.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2146,6 +2143,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2272,6 +2270,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2294,6 +2293,7 @@ maybeInstall(true).then(run); ], "assets": [ { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2337,6 +2337,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2379,6 +2380,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2414,6 +2416,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2599,7 +2607,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2642,7 +2650,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap b/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap index 2a7ec6655..b43a5559e 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap @@ -2076,9 +2076,6 @@ maybeInstall(true).then(run); "announcement_is_prerelease": false, "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2142,6 +2139,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2268,6 +2266,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2290,6 +2289,7 @@ maybeInstall(true).then(run); ], "assets": [ { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2333,6 +2333,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2375,6 +2376,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2410,6 +2412,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2591,7 +2599,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2634,7 +2642,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic.snap b/cargo-dist/tests/snapshots/axolotlsay_basic.snap index c8f79b9d1..5204b29d8 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic.snap @@ -2077,9 +2077,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.msi](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2138,6 +2135,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2264,6 +2262,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2286,6 +2285,7 @@ maybeInstall(true).then(run); ], "assets": [ { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2329,6 +2329,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2371,6 +2372,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2406,6 +2408,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2589,7 +2597,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2632,7 +2640,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_custom_formula.snap b/cargo-dist/tests/snapshots/axolotlsay_custom_formula.snap index ddd0ebbb8..708673893 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_custom_formula.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_custom_formula.snap @@ -57,9 +57,6 @@ end "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotl-brew\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -124,6 +121,7 @@ end "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -166,6 +164,7 @@ end "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -208,6 +207,7 @@ end "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -250,6 +250,7 @@ end "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -274,6 +275,12 @@ end "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -457,7 +464,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -500,7 +507,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_custom_github_runners.snap b/cargo-dist/tests/snapshots/axolotlsay_custom_github_runners.snap index ea07a46d8..058deaab5 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_custom_github_runners.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_custom_github_runners.snap @@ -11,9 +11,6 @@ expression: self.payload "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-unknown-linux-gnu.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-unknown-linux-gnu.tar.xz) | ARM64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-unknown-linux-gnu.tar.xz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n| [axolotlsay-aarch64-unknown-linux-musl.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-unknown-linux-musl.tar.xz) | ARM64 MUSL Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-unknown-linux-musl.tar.xz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-musl.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-musl.tar.xz) | x64 MUSL Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-musl.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -66,6 +63,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-aarch64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -108,6 +106,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-aarch64-unknown-linux-musl-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -150,6 +149,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -192,6 +192,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-musl-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -216,6 +217,12 @@ expression: self.payload "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -401,7 +408,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -444,7 +451,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_dispatch.snap b/cargo-dist/tests/snapshots/axolotlsay_dispatch.snap index 40857f5fe..ad6df6d26 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_dispatch.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_dispatch.snap @@ -11,9 +11,6 @@ expression: self.payload "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.zip](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.zip.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -66,6 +63,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -108,6 +106,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -150,6 +149,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -192,6 +192,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -216,6 +217,12 @@ expression: self.payload "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -403,7 +410,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -446,7 +453,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss.snap b/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss.snap index e2cffdfbf..8de155039 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss.snap @@ -11,9 +11,6 @@ expression: self.payload "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.xz](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-aarch64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.xz](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.zip](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-pc-windows-msvc.zip.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.xz](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://fake.axo.dev/faker/axolotlsay/fake-id-do-not-upload/axolotlsay-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -74,6 +71,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -116,6 +114,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -158,6 +157,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -200,6 +200,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -224,6 +225,12 @@ expression: self.payload "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -413,7 +420,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -456,7 +463,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss_only.snap b/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss_only.snap index 5780a1601..9631b61c3 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss_only.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss_only.snap @@ -10,9 +10,6 @@ expression: self.payload "announcement_is_prerelease": false, "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -70,6 +67,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -112,6 +110,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -154,6 +153,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -196,6 +196,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -220,6 +221,12 @@ expression: self.payload "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -405,7 +412,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -448,7 +455,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap b/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap index 90209975a..14e562369 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap @@ -2077,9 +2077,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2136,6 +2133,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2262,6 +2260,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2304,6 +2303,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2346,6 +2346,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2381,6 +2382,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2564,7 +2571,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2607,7 +2614,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_musl.snap b/cargo-dist/tests/snapshots/axolotlsay_musl.snap index b30eb0618..7410cd512 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_musl.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_musl.snap @@ -1696,9 +1696,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-musl.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-musl.tar.gz) | x64 MUSL Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-musl.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1753,6 +1750,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1871,6 +1869,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1913,6 +1912,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1955,6 +1955,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-musl-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1979,6 +1980,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2163,7 +2170,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2206,7 +2213,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap b/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap index 0ace95e58..5dadda95c 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap @@ -1696,9 +1696,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-musl.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-musl.tar.gz) | x64 MUSL Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-musl.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1751,6 +1748,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1867,6 +1865,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1909,6 +1908,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-musl-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1933,6 +1933,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2109,7 +2115,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2152,7 +2158,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap b/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap index 054bf6b63..4fee80da9 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap @@ -2077,9 +2077,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2136,6 +2133,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2262,6 +2260,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2304,6 +2303,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2346,6 +2346,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2381,6 +2382,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2564,7 +2571,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2607,7 +2614,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_no_locals.snap b/cargo-dist/tests/snapshots/axolotlsay_no_locals.snap index b94f04d0c..1f528c27a 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_no_locals.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_no_locals.snap @@ -11,9 +11,6 @@ expression: self.payload "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.zip](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.zip.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -66,6 +63,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -108,6 +106,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -150,6 +149,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -192,6 +192,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -216,6 +217,12 @@ expression: self.payload "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -374,7 +381,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_no_locals_but_custom.snap b/cargo-dist/tests/snapshots/axolotlsay_no_locals_but_custom.snap index 0dc1b3367..3546ed5a8 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_no_locals_but_custom.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_no_locals_but_custom.snap @@ -11,9 +11,6 @@ expression: self.payload "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.zip](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.zip.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -66,6 +63,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -108,6 +106,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -150,6 +149,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -192,6 +192,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -216,6 +217,12 @@ expression: self.payload "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -384,7 +391,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap index d1afb98bb..956d32356 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap @@ -1199,9 +1199,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.msi](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1258,6 +1255,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1320,6 +1318,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1342,6 +1341,7 @@ try { ], "assets": [ { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1385,6 +1385,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1427,6 +1428,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1451,6 +1453,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -1634,7 +1642,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -1677,7 +1685,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap index 356498a90..3b44d8052 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap @@ -1199,9 +1199,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.msi](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1258,6 +1255,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1320,6 +1318,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1342,6 +1341,7 @@ try { ], "assets": [ { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1385,6 +1385,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1427,6 +1428,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1451,6 +1453,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -1634,7 +1642,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -1677,7 +1685,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_tag_namespace.snap b/cargo-dist/tests/snapshots/axolotlsay_tag_namespace.snap index 56f566066..c5df9e1ed 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_tag_namespace.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_tag_namespace.snap @@ -11,9 +11,6 @@ expression: self.payload "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.xz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.zip](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.zip.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.xz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.xz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -66,6 +63,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -108,6 +106,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -150,6 +149,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -192,6 +192,7 @@ expression: self.payload "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -216,6 +217,12 @@ expression: self.payload "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -399,7 +406,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -442,7 +449,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_updaters.snap b/cargo-dist/tests/snapshots/axolotlsay_updaters.snap index 154b37bf3..0db5d2643 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_updaters.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_updaters.snap @@ -2093,9 +2093,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.msi](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2165,6 +2162,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2298,6 +2296,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2327,6 +2326,7 @@ maybeInstall(true).then(run); ], "assets": [ { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2370,6 +2370,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2419,6 +2420,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2454,6 +2456,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2637,7 +2645,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2680,7 +2688,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap index 0841b4ec4..60a76956a 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap @@ -2077,9 +2077,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2136,6 +2133,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2262,6 +2260,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2304,6 +2303,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2346,6 +2346,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2381,6 +2382,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2564,7 +2571,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2607,7 +2614,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap index e0a58e843..ef3248be4 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap @@ -2077,9 +2077,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2136,6 +2133,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2262,6 +2260,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2304,6 +2303,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2346,6 +2346,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2381,6 +2382,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2564,7 +2571,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2607,7 +2614,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap index 0b648c4a3..88967616f 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap @@ -2077,9 +2077,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2136,6 +2133,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2262,6 +2260,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2304,6 +2303,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2346,6 +2346,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2381,6 +2382,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2564,7 +2571,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2627,7 +2634,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap index 6466ceef5..dc2617596 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap @@ -2077,9 +2077,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2136,6 +2133,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2262,6 +2260,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2304,6 +2303,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2346,6 +2346,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2381,6 +2382,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2574,7 +2581,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2617,7 +2624,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap index 58fa6e571..5d3301a32 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap @@ -2077,9 +2077,6 @@ maybeInstall(true).then(run); "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -2136,6 +2133,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2262,6 +2260,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2304,6 +2303,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -2346,6 +2346,7 @@ maybeInstall(true).then(run); "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -2381,6 +2382,12 @@ maybeInstall(true).then(run); "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -2564,7 +2571,7 @@ jobs: run: | # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2607,7 +2614,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" diff --git a/cargo-dist/tests/snapshots/install_path_cargo_home.snap b/cargo-dist/tests/snapshots/install_path_cargo_home.snap index 7d83dc1a7..15c6bfd7a 100644 --- a/cargo-dist/tests/snapshots/install_path_cargo_home.snap +++ b/cargo-dist/tests/snapshots/install_path_cargo_home.snap @@ -1245,9 +1245,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1303,6 +1300,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1365,6 +1363,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1407,6 +1406,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1449,6 +1449,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1484,6 +1485,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { diff --git a/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap b/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap index 838a26ce9..d894f96e9 100644 --- a/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap +++ b/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap @@ -1221,9 +1221,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1279,6 +1276,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1341,6 +1339,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1383,6 +1382,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1425,6 +1425,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1460,6 +1461,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir.snap b/cargo-dist/tests/snapshots/install_path_env_subdir.snap index 6ce34faa9..2cb5211f5 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir.snap @@ -1221,9 +1221,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1279,6 +1276,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1341,6 +1339,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1383,6 +1382,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1425,6 +1425,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1460,6 +1461,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap b/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap index 4311431a1..7c8dcc18b 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap @@ -1221,9 +1221,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1279,6 +1276,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1341,6 +1339,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1383,6 +1382,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1425,6 +1425,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1460,6 +1461,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap b/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap index 0419dbb22..c2081d8fe 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap @@ -1221,9 +1221,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1279,6 +1276,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1341,6 +1339,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1383,6 +1382,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1425,6 +1425,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1460,6 +1461,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap index fcb56fd74..55972c9db 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap @@ -1221,9 +1221,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1279,6 +1276,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1341,6 +1339,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1383,6 +1382,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1425,6 +1425,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1460,6 +1461,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap index 84a841c85..358810aca 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap @@ -1221,9 +1221,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1279,6 +1276,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1341,6 +1339,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1383,6 +1382,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1425,6 +1425,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1460,6 +1461,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap index bba3eb02e..d74a314cf 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap @@ -1221,9 +1221,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1279,6 +1276,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1341,6 +1339,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1383,6 +1382,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1425,6 +1425,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1460,6 +1461,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap index 6653f4ca3..06e3403d9 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap @@ -1221,9 +1221,6 @@ try { "announcement_title": "Version 0.2.1", "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axolotlsay\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "axolotlsay", @@ -1279,6 +1276,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1341,6 +1339,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1383,6 +1382,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "path": "axolotlsay.exe", "kind": "executable" @@ -1425,6 +1425,7 @@ try { "kind": "readme" }, { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "path": "axolotlsay", "kind": "executable" @@ -1460,6 +1461,12 @@ try { "kind": "checksum" } }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { diff --git a/cargo-dist/tests/snapshots/lib_manifest.snap b/cargo-dist/tests/snapshots/lib_manifest.snap index 4eec39377..93c5ad256 100644 --- a/cargo-dist/tests/snapshots/lib_manifest.snap +++ b/cargo-dist/tests/snapshots/lib_manifest.snap @@ -11,9 +11,6 @@ stdout: "announcement_title": "CENSORED" "announcement_changelog": "CENSORED" "announcement_github_body": "CENSORED" - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "cargo-dist-schema", @@ -33,6 +30,12 @@ stdout: } } ], + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -47,5 +50,3 @@ stderr: INFO: You've enabled Axo Releases, which is currently in Closed Beta. If you haven't yet signed up, please join our discord (https://discord.gg/ECnWuUUXQk) or message hello@axo.dev to get started! - - diff --git a/cargo-dist/tests/snapshots/lib_manifest_slash.snap b/cargo-dist/tests/snapshots/lib_manifest_slash.snap index 98721622e..417d0aaee 100644 --- a/cargo-dist/tests/snapshots/lib_manifest_slash.snap +++ b/cargo-dist/tests/snapshots/lib_manifest_slash.snap @@ -11,9 +11,6 @@ stdout: "announcement_title": "CENSORED" "announcement_changelog": "CENSORED" "announcement_github_body": "CENSORED" - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "cargo-dist-schema", @@ -33,6 +30,12 @@ stdout: } } ], + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -47,5 +50,3 @@ stderr: INFO: You've enabled Axo Releases, which is currently in Closed Beta. If you haven't yet signed up, please join our discord (https://discord.gg/ECnWuUUXQk) or message hello@axo.dev to get started! - - diff --git a/cargo-dist/tests/snapshots/manifest.snap b/cargo-dist/tests/snapshots/manifest.snap index e42ece1f8..3dc111206 100644 --- a/cargo-dist/tests/snapshots/manifest.snap +++ b/cargo-dist/tests/snapshots/manifest.snap @@ -11,9 +11,6 @@ stdout: "announcement_title": "CENSORED" "announcement_changelog": "CENSORED" "announcement_github_body": "CENSORED" - "system_info": { - "cargo_version_line": "CENSORED" - }, "releases": [ { "app_name": "cargo-dist", @@ -84,6 +81,7 @@ stdout: "kind": "readme" }, { + "id": "cargo-dist-aarch64-apple-darwin-cargo-dist", "name": "cargo-dist", "path": "cargo-dist", "kind": "executable" @@ -126,6 +124,7 @@ stdout: "kind": "readme" }, { + "id": "cargo-dist-aarch64-unknown-linux-gnu-cargo-dist", "name": "cargo-dist", "path": "cargo-dist", "kind": "executable" @@ -168,6 +167,7 @@ stdout: "kind": "readme" }, { + "id": "cargo-dist-aarch64-unknown-linux-musl-cargo-dist", "name": "cargo-dist", "path": "cargo-dist", "kind": "executable" @@ -233,6 +233,7 @@ stdout: "kind": "readme" }, { + "id": "cargo-dist-x86_64-apple-darwin-cargo-dist", "name": "cargo-dist", "path": "cargo-dist", "kind": "executable" @@ -275,6 +276,7 @@ stdout: "kind": "readme" }, { + "id": "cargo-dist-x86_64-pc-windows-msvc-cargo-dist", "name": "cargo-dist", "path": "cargo-dist.exe", "kind": "executable" @@ -317,6 +319,7 @@ stdout: "kind": "readme" }, { + "id": "cargo-dist-x86_64-unknown-linux-gnu-cargo-dist", "name": "cargo-dist", "path": "cargo-dist", "kind": "executable" @@ -359,6 +362,7 @@ stdout: "kind": "readme" }, { + "id": "cargo-dist-x86_64-unknown-linux-musl-cargo-dist", "name": "cargo-dist", "path": "cargo-dist", "kind": "executable" @@ -401,6 +405,12 @@ stdout: "kind": "checksum" } }, + "systems": { + "lies:": { + "id": "lies:", + "cargo_version_line": "CENSORED" + } + }, "publish_prereleases": false, "ci": { "github": { @@ -476,5 +486,3 @@ stderr: INFO: You've enabled Axo Releases, which is currently in Closed Beta. If you haven't yet signed up, please join our discord (https://discord.gg/ECnWuUUXQk) or message hello@axo.dev to get started! - - From fce72e42c496172906853567e22437cce97413ac Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Tue, 12 Mar 2024 15:18:38 -0400 Subject: [PATCH 08/24] release: 0.12.0-prerelease.2 --- Cargo.lock | 4 ++-- cargo-dist-schema/Cargo.toml | 2 +- cargo-dist/Cargo.toml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c170ffbe..8d673f45c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "cargo-dist" -version = "0.12.0-prerelease.1" +version = "0.12.0-prerelease.2" dependencies = [ "axoasset 0.8.0", "axocli", @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "cargo-dist-schema" -version = "0.12.0-prerelease.1" +version = "0.12.0-prerelease.2" dependencies = [ "camino", "gazenot", diff --git a/cargo-dist-schema/Cargo.toml b/cargo-dist-schema/Cargo.toml index 6204c01a1..d817b68fb 100644 --- a/cargo-dist-schema/Cargo.toml +++ b/cargo-dist-schema/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist-schema" description = "Schema information for cargo-dist's dist-manifest.json" -version = "0.12.0-prerelease.1" +version = "0.12.0-prerelease.2" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" diff --git a/cargo-dist/Cargo.toml b/cargo-dist/Cargo.toml index 6d971b1fb..23af373a8 100644 --- a/cargo-dist/Cargo.toml +++ b/cargo-dist/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist" description = "Shippable application packaging for Rust" -version = "0.12.0-prerelease.1" +version = "0.12.0-prerelease.2" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" @@ -34,7 +34,7 @@ axocli = { version = "0.2.0", optional = true } # Features used by the cli and library axotag = "0.1.0" -cargo-dist-schema = { version = "=0.12.0-prerelease.1", path = "../cargo-dist-schema" } +cargo-dist-schema = { version = "=0.12.0-prerelease.2", path = "../cargo-dist-schema" } axoasset = { version = "0.8.0", features = ["json-serde", "toml-serde", "toml-edit", "compression"] } axoprocess = { version = "0.2.0" } From de30c44e179ea00d7ddb9e84fc8fbb88c4d60e34 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 10:00:18 -0400 Subject: [PATCH 09/24] fix: compute tag before merging --- cargo-dist/src/manifest.rs | 12 ++++++++---- cargo-dist/src/tasks.rs | 14 +++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/cargo-dist/src/manifest.rs b/cargo-dist/src/manifest.rs index 42c2a4d1f..e95fb94a5 100644 --- a/cargo-dist/src/manifest.rs +++ b/cargo-dist/src/manifest.rs @@ -43,6 +43,7 @@ use cargo_dist_schema::{ use tracing::warn; use crate::{ + announce::AnnouncementTag, backend::{ installer::{homebrew::HomebrewInstallerInfo, npm::NpmInstallerInfo, InstallerImpl}, templates::{TemplateEntry, TEMPLATE_INSTALLER_NPM}, @@ -53,9 +54,10 @@ use crate::{ }; /// Load DistManifests into the given dir and merge them into the current one -pub fn load_and_merge_manifests( +pub(crate) fn load_and_merge_manifests( manifest_dir: &Utf8Path, output: &mut DistManifest, + announcing: &AnnouncementTag, ) -> DistResult<()> { // Hey! Update the loop below too if you're adding a field! @@ -84,9 +86,11 @@ pub fn load_and_merge_manifests( } = manifest; // Discard clearly unrelated manifests - if output.announcement_tag != announcement_tag { - warn!("found old manifest for the tag {announcement_tag:?}, ignoring it"); - continue; + if let Some(tag) = &announcement_tag { + if tag != &announcing.tag { + warn!("found old manifest for the tag {announcement_tag:?}, ignoring it"); + continue; + } } // Merge every release diff --git a/cargo-dist/src/tasks.rs b/cargo-dist/src/tasks.rs index 1e309d544..8c3961c7c 100644 --- a/cargo-dist/src/tasks.rs +++ b/cargo-dist/src/tasks.rs @@ -2829,11 +2829,6 @@ pub fn gather_work(cfg: &Config) -> Result<(DistGraph, DistManifest)> { cfg.announcement_tag.is_none(), )?; - // Immediately check if there's other manifests kicking around that provide info - // we don't want to recompute (lets us move towards more of an architecture where - // `plan` figures out what to do and subsequent steps Simply Obey). - crate::manifest::load_and_merge_manifests(&graph.inner.dist_dir, &mut graph.manifest)?; - // Prefer the CLI (cfg) if it's non-empty, but only select a subset // of what the workspace supports if it's non-empty let workspace_ci = graph.workspace_metadata.ci.clone().unwrap_or_default(); @@ -2892,6 +2887,15 @@ pub fn gather_work(cfg: &Config) -> Result<(DistGraph, DistManifest)> { cfg.needs_coherent_announcement_tag, )?; + // Immediately check if there's other manifests kicking around that provide info + // we don't want to recompute (lets us move towards more of an architecture where + // `plan` figures out what to do and subsequent steps Simply Obey). + crate::manifest::load_and_merge_manifests( + &graph.inner.dist_dir, + &mut graph.manifest, + &announcing, + )?; + // Figure out how artifacts should be hosted graph.compute_hosting(cfg, &announcing)?; From 5b15f5ef836e48c3020d6f0db6e127108f297550 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 10:01:08 -0400 Subject: [PATCH 10/24] release: 0.12.0-prerelease.3 --- Cargo.lock | 4 ++-- cargo-dist-schema/Cargo.toml | 2 +- cargo-dist/Cargo.toml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8d673f45c..dff2ebf12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "cargo-dist" -version = "0.12.0-prerelease.2" +version = "0.12.0-prerelease.3" dependencies = [ "axoasset 0.8.0", "axocli", @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "cargo-dist-schema" -version = "0.12.0-prerelease.2" +version = "0.12.0-prerelease.3" dependencies = [ "camino", "gazenot", diff --git a/cargo-dist-schema/Cargo.toml b/cargo-dist-schema/Cargo.toml index d817b68fb..e28937c47 100644 --- a/cargo-dist-schema/Cargo.toml +++ b/cargo-dist-schema/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist-schema" description = "Schema information for cargo-dist's dist-manifest.json" -version = "0.12.0-prerelease.2" +version = "0.12.0-prerelease.3" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" diff --git a/cargo-dist/Cargo.toml b/cargo-dist/Cargo.toml index 23af373a8..909cca9bd 100644 --- a/cargo-dist/Cargo.toml +++ b/cargo-dist/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist" description = "Shippable application packaging for Rust" -version = "0.12.0-prerelease.2" +version = "0.12.0-prerelease.3" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" @@ -34,7 +34,7 @@ axocli = { version = "0.2.0", optional = true } # Features used by the cli and library axotag = "0.1.0" -cargo-dist-schema = { version = "=0.12.0-prerelease.2", path = "../cargo-dist-schema" } +cargo-dist-schema = { version = "=0.12.0-prerelease.3", path = "../cargo-dist-schema" } axoasset = { version = "0.8.0", features = ["json-serde", "toml-serde", "toml-edit", "compression"] } axoprocess = { version = "0.2.0" } From b514aee633a296a7017260567f26070e0403eec7 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 15:16:11 -0400 Subject: [PATCH 11/24] chore: add convenience for getting merged linkage --- cargo-dist-schema/src/lib.rs | 69 +++++++++++++++++++++++++++++++----- cargo-dist/src/linkage.rs | 8 ++--- 2 files changed, 64 insertions(+), 13 deletions(-) diff --git a/cargo-dist-schema/src/lib.rs b/cargo-dist-schema/src/lib.rs index e990c0251..9e09aa7c6 100644 --- a/cargo-dist-schema/src/lib.rs +++ b/cargo-dist-schema/src/lib.rs @@ -30,6 +30,8 @@ pub type ArtifactId = String; pub type SystemId = String; /// The unique ID of an Asset pub type AssetId = String; +/// A sorted set of values +pub type SortedSet = std::collections::BTreeSet; /// A report of the releases and artifacts that cargo-dist generated #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] @@ -503,6 +505,29 @@ impl DistManifest { self.releases.last_mut().unwrap() } } + + /// Get the merged linkage for an artifact + /// + /// This lets you know what system dependencies an entire archive of binaries requires + pub fn linkage_for_artifact(&self, artifact_id: &ArtifactId) -> Linkage { + let artifact = &self.artifacts[artifact_id]; + let mut output = Linkage::default(); + + for base_asset in &artifact.assets { + let Some(asset_id) = &base_asset.id else { + continue + }; + let Some(true_asset) = self.assets.get(asset_id) else { + continue + }; + let Some(linkage) = &true_asset.linkage else { + continue + }; + output.extend(linkage); + } + + output + } } impl Release { @@ -554,26 +579,40 @@ impl Hosting { } /// Information about dynamic libraries used by a binary -#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] +#[derive(Clone, Default, Debug, Deserialize, Serialize, JsonSchema)] pub struct Linkage { /// The filename of the binary - pub binary: String, + #[serde(default)] + #[serde(skip_serializing_if = "Option::is_none")] + pub binary: Option, /// The target triple for which the binary was built - pub target: String, + #[serde(default)] + #[serde(skip_serializing_if = "Option::is_none")] + pub target: Option, /// Libraries included with the operating system - pub system: Vec, + #[serde(default)] + #[serde(skip_serializing_if = "SortedSet::is_empty")] + pub system: SortedSet, /// Libraries provided by the Homebrew package manager - pub homebrew: Vec, + #[serde(default)] + #[serde(skip_serializing_if = "SortedSet::is_empty")] + pub homebrew: SortedSet, /// Public libraries not provided by the system and not managed by any package manager - pub public_unmanaged: Vec, + #[serde(default)] + #[serde(skip_serializing_if = "SortedSet::is_empty")] + pub public_unmanaged: SortedSet, /// Libraries which don't fall into any other categories - pub other: Vec, + #[serde(default)] + #[serde(skip_serializing_if = "SortedSet::is_empty")] + pub other: SortedSet, /// Frameworks, only used on macOS - pub frameworks: Vec, + #[serde(default)] + #[serde(skip_serializing_if = "SortedSet::is_empty")] + pub frameworks: SortedSet, } /// Represents a dynamic library located somewhere on the system -#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] +#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq, Eq, PartialOrd, Ord)] pub struct Library { /// The path to the library; on platforms without that information, it will be a basename instead pub path: String, @@ -582,6 +621,18 @@ pub struct Library { pub source: Option, } +impl Linkage { + /// merge another linkage into this one + pub fn extend(&mut self, val: &Linkage) { + let Linkage { binary: _, target: _, system, homebrew, public_unmanaged, other, frameworks } = val; + self.system.extend(system.iter().cloned()); + self.homebrew.extend(homebrew.iter().cloned()); + self.public_unmanaged.extend(public_unmanaged.iter().cloned()); + self.other.extend(other.iter().cloned()); + self.frameworks.extend(frameworks.iter().cloned()); + } +} + /// Helper to read the raw version from serialized json fn dist_version(input: &str) -> Option { #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] diff --git a/cargo-dist/src/linkage.rs b/cargo-dist/src/linkage.rs index c29e9ac0f..199f878fb 100644 --- a/cargo-dist/src/linkage.rs +++ b/cargo-dist/src/linkage.rs @@ -195,8 +195,8 @@ impl Linkage { /// Construct a cargo_dist_schema::Linkage from a Linkage pub fn to_schema(&self) -> cargo_dist_schema::Linkage { cargo_dist_schema::Linkage { - binary: self.binary.clone(), - target: self.target.clone(), + binary: None, + target: None, system: self.system.iter().map(|s| s.to_schema()).collect(), homebrew: self.homebrew.iter().map(|s| s.to_schema()).collect(), public_unmanaged: self @@ -212,8 +212,8 @@ impl Linkage { /// Constructs a Linkage from a cargo_dist_schema::Linkage pub fn from_schema(other: &cargo_dist_schema::Linkage) -> Self { Self { - binary: other.binary.clone(), - target: other.target.clone(), + binary: other.binary.clone().unwrap_or_default(), + target: other.target.clone().unwrap_or_default(), system: other.system.iter().map(Library::from_schema).collect(), homebrew: other.homebrew.iter().map(Library::from_schema).collect(), public_unmanaged: other From dd8ea428f0505f9693f90ac4dfb0253553d3269a Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 16:10:01 -0400 Subject: [PATCH 12/24] feat(manifest-reform): add checksum values to manifest and always compute the sha256 checksum for archives --- cargo-dist-schema/src/lib.rs | 28 +++++++-- .../snapshots/cargo_dist_schema__emit.snap | 43 ++++++++------ cargo-dist/src/backend/installer/homebrew.rs | 58 ++++++++----------- cargo-dist/src/lib.rs | 44 +++++++++++--- cargo-dist/src/manifest.rs | 6 ++ cargo-dist/src/tasks.rs | 22 +++++-- 6 files changed, 130 insertions(+), 71 deletions(-) diff --git a/cargo-dist-schema/src/lib.rs b/cargo-dist-schema/src/lib.rs index 9e09aa7c6..9b10362f2 100644 --- a/cargo-dist-schema/src/lib.rs +++ b/cargo-dist-schema/src/lib.rs @@ -268,10 +268,17 @@ pub struct Artifact { #[serde(skip_serializing_if = "Option::is_none")] #[serde(default)] pub description: Option, - /// id of an that contains the checksum for this artifact + /// id of an Artifact that contains the checksum for this Artifact #[serde(skip_serializing_if = "Option::is_none")] #[serde(default)] pub checksum: Option, + /// checksums for this artifact + /// + /// keys are the name of an algorithm like "sha256" or "sha512" + /// values are the actual hex string of the checksum + #[serde(default)] + #[serde(skip_serializing_if = "BTreeMap::is_empty")] + pub checksums: BTreeMap, } /// An asset contained in an artifact (executable, license, etc.) @@ -515,13 +522,13 @@ impl DistManifest { for base_asset in &artifact.assets { let Some(asset_id) = &base_asset.id else { - continue + continue; }; let Some(true_asset) = self.assets.get(asset_id) else { - continue + continue; }; let Some(linkage) = &true_asset.linkage else { - continue + continue; }; output.extend(linkage); } @@ -624,10 +631,19 @@ pub struct Library { impl Linkage { /// merge another linkage into this one pub fn extend(&mut self, val: &Linkage) { - let Linkage { binary: _, target: _, system, homebrew, public_unmanaged, other, frameworks } = val; + let Linkage { + binary: _, + target: _, + system, + homebrew, + public_unmanaged, + other, + frameworks, + } = val; self.system.extend(system.iter().cloned()); self.homebrew.extend(homebrew.iter().cloned()); - self.public_unmanaged.extend(public_unmanaged.iter().cloned()); + self.public_unmanaged + .extend(public_unmanaged.iter().cloned()); self.other.extend(other.iter().cloned()); self.frameworks.extend(frameworks.iter().cloned()); } diff --git a/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap b/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap index 90469760a..4c3f41c71 100644 --- a/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap +++ b/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap @@ -259,12 +259,19 @@ expression: json_schema } }, "checksum": { - "description": "id of an that contains the checksum for this artifact", + "description": "id of an Artifact that contains the checksum for this Artifact", "type": [ "string", "null" ] }, + "checksums": { + "description": "checksums for this artifact\n\nkeys are the name of an algorithm like \"sha256\" or \"sha512\" values are the actual hex string of the checksum", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "description": { "description": "A brief description of what this artifact is", "type": [ @@ -653,58 +660,60 @@ expression: json_schema "Linkage": { "description": "Information about dynamic libraries used by a binary", "type": "object", - "required": [ - "binary", - "frameworks", - "homebrew", - "other", - "public_unmanaged", - "system", - "target" - ], "properties": { "binary": { "description": "The filename of the binary", - "type": "string" + "type": [ + "string", + "null" + ] }, "frameworks": { "description": "Frameworks, only used on macOS", "type": "array", "items": { "$ref": "#/definitions/Library" - } + }, + "uniqueItems": true }, "homebrew": { "description": "Libraries provided by the Homebrew package manager", "type": "array", "items": { "$ref": "#/definitions/Library" - } + }, + "uniqueItems": true }, "other": { "description": "Libraries which don't fall into any other categories", "type": "array", "items": { "$ref": "#/definitions/Library" - } + }, + "uniqueItems": true }, "public_unmanaged": { "description": "Public libraries not provided by the system and not managed by any package manager", "type": "array", "items": { "$ref": "#/definitions/Library" - } + }, + "uniqueItems": true }, "system": { "description": "Libraries included with the operating system", "type": "array", "items": { "$ref": "#/definitions/Library" - } + }, + "uniqueItems": true }, "target": { "description": "The target triple for which the binary was built", - "type": "string" + "type": [ + "string", + "null" + ] } } }, diff --git a/cargo-dist/src/backend/installer/homebrew.rs b/cargo-dist/src/backend/installer/homebrew.rs index d0ff38f6d..b04717587 100644 --- a/cargo-dist/src/backend/installer/homebrew.rs +++ b/cargo-dist/src/backend/installer/homebrew.rs @@ -1,15 +1,14 @@ //! Code for generating installer.sh use axoasset::LocalAsset; -use camino::Utf8PathBuf; use cargo_dist_schema::DistManifest; use serde::Serialize; use super::InstallerInfo; use crate::{ backend::templates::{Templates, TEMPLATE_INSTALLER_RB}, + config::ChecksumStyle, errors::DistResult, - generate_checksum, installer::ExecutableZipFragment, tasks::DistGraph, }; @@ -53,7 +52,7 @@ pub struct HomebrewInstallerInfo { pub(crate) fn write_homebrew_formula( templates: &Templates, - graph: &DistGraph, + _graph: &DistGraph, source_info: &HomebrewInstallerInfo, manifest: &DistManifest, ) -> DistResult<()> { @@ -68,44 +67,33 @@ pub(crate) fn write_homebrew_formula( // Merge with the manually-specified deps info.dependencies.extend(dependencies); - // Generate sha256 as late as possible; the artifacts might not exist - // earlier to do that. - if let Some(arm64_ref) = &info.arm64_macos { - let path = Utf8PathBuf::from(&graph.dist_dir).join(&arm64_ref.id); - if path.exists() { - let sha256 = generate_checksum(&crate::config::ChecksumStyle::Sha256, &path)?; - info.arm64_macos_sha256 = Some(sha256); - } - } - if let Some(x86_64_ref) = &info.x86_64_macos { - let path = Utf8PathBuf::from(&graph.dist_dir).join(&x86_64_ref.id); - if path.exists() { - let sha256 = generate_checksum(&crate::config::ChecksumStyle::Sha256, &path)?; - info.x86_64_macos_sha256 = Some(sha256); - } - } - - // Linuxbrew - if let Some(arm64_ref) = &info.arm64_linux { - let path = Utf8PathBuf::from(&graph.dist_dir).join(&arm64_ref.id); - if path.exists() { - let sha256 = generate_checksum(&crate::config::ChecksumStyle::Sha256, &path)?; - info.arm64_linux_sha256 = Some(sha256); - } - } - if let Some(x86_64_ref) = &info.x86_64_linux { - let path = Utf8PathBuf::from(&graph.dist_dir).join(&x86_64_ref.id); - if path.exists() { - let sha256 = generate_checksum(&crate::config::ChecksumStyle::Sha256, &path)?; - info.x86_64_linux_sha256 = Some(sha256); - } - } + // Grab checksums + sha256_checksum(manifest, &info.arm64_macos, &mut info.arm64_macos_sha256); + sha256_checksum(manifest, &info.x86_64_macos, &mut info.x86_64_macos_sha256); + sha256_checksum(manifest, &info.arm64_linux, &mut info.arm64_linux_sha256); + sha256_checksum(manifest, &info.x86_64_linux, &mut info.x86_64_linux_sha256); let script = templates.render_file_to_clean_string(TEMPLATE_INSTALLER_RB, &info)?; LocalAsset::write_new(&script, &info.inner.dest_path)?; Ok(()) } +/// Grab the sha256 checksum for this artifact from the manifest +fn sha256_checksum( + manifest: &DistManifest, + fragment: &Option, + checksum: &mut Option, +) { + let checksum_key = ChecksumStyle::Sha256.ext(); + if let Some(frag) = &fragment { + *checksum = manifest + .artifacts + .get(&frag.id) + .and_then(|a| a.checksums.get(checksum_key)) + .cloned() + } +} + /// Converts the provided app name into a Ruby class-compatible /// string suitable for use as the class in a Homebrew formula. // Homebrew implementation is Formulary.class_s: diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index bd0ee96e6..9b8aa95b7 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -21,7 +21,7 @@ use backend::{ use build::cargo::{build_cargo_target, rustup_toolchain}; use build::generic::{build_generic_target, run_extra_artifacts_build}; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::DistManifest; +use cargo_dist_schema::{ArtifactId, DistManifest}; use config::{ ArtifactMode, ChecksumStyle, CompressionImpl, Config, DirtyMode, GenerateMode, ZipStyle, }; @@ -76,7 +76,7 @@ pub fn do_build(cfg: &Config) -> Result { // Run all the local build steps first for step in &dist.local_build_steps { if dist.local_builds_are_lies { - build_fake(&dist, step, &manifest)?; + build_fake(&dist, step, &mut manifest)?; } else { run_build_step(&dist, step, &mut manifest)?; } @@ -89,7 +89,7 @@ pub fn do_build(cfg: &Config) -> Result { // Next the global steps for step in &dist.global_build_steps { if dist.local_builds_are_lies { - build_fake(&dist, step, &manifest)?; + build_fake(&dist, step, &mut manifest)?; } else { run_build_step(&dist, step, &mut manifest)?; } @@ -141,7 +141,14 @@ fn run_build_step( checksum, src_path, dest_path, - }) => generate_and_write_checksum(checksum, src_path, dest_path)?, + for_artifact, + }) => generate_and_write_checksum( + manifest, + checksum, + src_path, + dest_path.as_deref(), + for_artifact.as_ref(), + )?, BuildStep::GenerateSourceTarball(SourceTarballStep { committish, prefix, @@ -248,7 +255,11 @@ fn fetch_updater_from_binary( Ok(()) } -fn build_fake(dist_graph: &DistGraph, target: &BuildStep, manifest: &DistManifest) -> Result<()> { +fn build_fake( + dist_graph: &DistGraph, + target: &BuildStep, + manifest: &mut DistManifest, +) -> Result<()> { match target { // These two are the meat: don't actually run these at all, just // fake them out @@ -285,7 +296,14 @@ fn build_fake(dist_graph: &DistGraph, target: &BuildStep, manifest: &DistManifes checksum, src_path, dest_path, - }) => generate_and_write_checksum(checksum, src_path, dest_path)?, + for_artifact, + }) => generate_and_write_checksum( + manifest, + checksum, + src_path, + dest_path.as_deref(), + for_artifact.as_ref(), + )?, // Except source tarballs, which are definitely not okay // We mock these because it requires: // 1. git to be installed; @@ -350,12 +368,22 @@ fn generate_fake_artifacts(dist: &DistGraph, binaries: &[BinaryIdx]) -> Result<( /// Generate a checksum for the src_path to dest_path fn generate_and_write_checksum( + manifest: &mut DistManifest, checksum: &ChecksumStyle, src_path: &Utf8Path, - dest_path: &Utf8Path, + dest_path: Option<&Utf8Path>, + for_artifact: Option<&ArtifactId>, ) -> DistResult<()> { let output = generate_checksum(checksum, src_path)?; - write_checksum(&output, src_path, dest_path) + if let Some(dest_path) = dest_path { + write_checksum(&output, src_path, dest_path)?; + } + if let Some(artifact_id) = for_artifact { + if let Some(artifact) = manifest.artifacts.get_mut(artifact_id) { + artifact.checksums.insert(checksum.ext().to_owned(), output); + } + } + Ok(()) } /// Generate a checksum for the src_path and return it as a string diff --git a/cargo-dist/src/manifest.rs b/cargo-dist/src/manifest.rs index e95fb94a5..bb8cfe57f 100644 --- a/cargo-dist/src/manifest.rs +++ b/cargo-dist/src/manifest.rs @@ -145,6 +145,11 @@ fn merge_artifact(output: &mut DistManifest, artifact_id: ArtifactId, artifact: } Entry::Occupied(mut out_artifact) => { let out_artifact = out_artifact.get_mut(); + + // Merge checksums + out_artifact.checksums.extend(artifact.checksums); + + // Merge assets for asset in artifact.assets { if let Some(out_asset) = out_artifact .assets @@ -369,6 +374,7 @@ fn add_manifest_artifact( assets, kind, checksum, + checksums: Default::default(), }; if !cfg.no_local_paths { diff --git a/cargo-dist/src/tasks.rs b/cargo-dist/src/tasks.rs index 8c3961c7c..defd73610 100644 --- a/cargo-dist/src/tasks.rs +++ b/cargo-dist/src/tasks.rs @@ -53,7 +53,7 @@ use std::collections::HashMap; use axoprocess::Cmd; use axoproject::{PackageId, PackageIdx, WorkspaceInfo}; use camino::Utf8PathBuf; -use cargo_dist_schema::{DistManifest, SystemId, SystemInfo}; +use cargo_dist_schema::{ArtifactId, DistManifest, SystemId, SystemInfo}; use miette::{miette, Context, IntoDiagnostic}; use semver::Version; use serde::Serialize; @@ -420,8 +420,10 @@ pub struct ChecksumImpl { pub checksum: ChecksumStyle, /// of this file pub src_path: Utf8PathBuf, - /// and write it to here - pub dest_path: Utf8PathBuf, + /// potentially write it to here + pub dest_path: Option, + /// record it for this artifact in the dist-manifest + pub for_artifact: Option, } /// Create a source tarball @@ -1377,6 +1379,7 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { is_global: true, }; + let for_artifact = Some(artifact.id.clone()); let artifact_idx = self.add_global_artifact(to_release, artifact); if checksum != ChecksumStyle::False { @@ -1391,7 +1394,8 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { kind: ArtifactKind::Checksum(ChecksumImpl { checksum, src_path: target_path, - dest_path: checksum_path, + dest_path: Some(checksum_path), + for_artifact, }), checksum: None, is_global: true, @@ -1418,7 +1422,8 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { kind: ArtifactKind::Checksum(ChecksumImpl { checksum, src_path: artifact.file_path.clone(), - dest_path: checksum_path.clone(), + dest_path: Some(checksum_path.clone()), + for_artifact: Some(artifact.id.clone()), }), target_triples: artifact.target_triples.clone(), @@ -2634,6 +2639,13 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { with_root: archive.with_root.clone(), zip_style: archive.zip_style, })); + // and get its sha256 checksum into the metadata + build_steps.push(BuildStep::Checksum(ChecksumImpl { + checksum: ChecksumStyle::Sha256, + src_path: artifact.file_path.clone(), + dest_path: None, + for_artifact: Some(artifact.id.clone()), + })) } } } From bc6f439fe0d9e37185d0b36b076dcdcdea9b2a15 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 16:24:31 -0400 Subject: [PATCH 13/24] chore: migrate homebrew installer to use new linkage metadata --- cargo-dist-schema/src/lib.rs | 4 +- cargo-dist/src/backend/installer/homebrew.rs | 39 ++++++++++++++------ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/cargo-dist-schema/src/lib.rs b/cargo-dist-schema/src/lib.rs index 9b10362f2..f67c43f4e 100644 --- a/cargo-dist-schema/src/lib.rs +++ b/cargo-dist-schema/src/lib.rs @@ -517,9 +517,11 @@ impl DistManifest { /// /// This lets you know what system dependencies an entire archive of binaries requires pub fn linkage_for_artifact(&self, artifact_id: &ArtifactId) -> Linkage { - let artifact = &self.artifacts[artifact_id]; let mut output = Linkage::default(); + let Some(artifact) = self.artifacts.get(artifact_id) else { + return output; + }; for base_asset in &artifact.assets { let Some(asset_id) = &base_asset.id else { continue; diff --git a/cargo-dist/src/backend/installer/homebrew.rs b/cargo-dist/src/backend/installer/homebrew.rs index b04717587..e3ce5c069 100644 --- a/cargo-dist/src/backend/installer/homebrew.rs +++ b/cargo-dist/src/backend/installer/homebrew.rs @@ -59,19 +59,18 @@ pub(crate) fn write_homebrew_formula( let mut info = source_info.clone(); // Fetch any detected dependencies from the linkage data - let dependencies = manifest - .linkage - .iter() - .flat_map(|l| l.homebrew.iter().filter_map(|lib| lib.source.clone())); - - // Merge with the manually-specified deps - info.dependencies.extend(dependencies); + // FIXME: ideally this would be writing to per-target dependencies, + // but for now we just shove them all into one big list. + use_linkage(manifest, &info.arm64_macos, &mut info.dependencies); + use_linkage(manifest, &info.x86_64_macos, &mut info.dependencies); + use_linkage(manifest, &info.arm64_linux, &mut info.dependencies); + use_linkage(manifest, &info.x86_64_linux, &mut info.dependencies); // Grab checksums - sha256_checksum(manifest, &info.arm64_macos, &mut info.arm64_macos_sha256); - sha256_checksum(manifest, &info.x86_64_macos, &mut info.x86_64_macos_sha256); - sha256_checksum(manifest, &info.arm64_linux, &mut info.arm64_linux_sha256); - sha256_checksum(manifest, &info.x86_64_linux, &mut info.x86_64_linux_sha256); + use_sha256_checksum(manifest, &info.arm64_macos, &mut info.arm64_macos_sha256); + use_sha256_checksum(manifest, &info.x86_64_macos, &mut info.x86_64_macos_sha256); + use_sha256_checksum(manifest, &info.arm64_linux, &mut info.arm64_linux_sha256); + use_sha256_checksum(manifest, &info.x86_64_linux, &mut info.x86_64_linux_sha256); let script = templates.render_file_to_clean_string(TEMPLATE_INSTALLER_RB, &info)?; LocalAsset::write_new(&script, &info.inner.dest_path)?; @@ -79,7 +78,7 @@ pub(crate) fn write_homebrew_formula( } /// Grab the sha256 checksum for this artifact from the manifest -fn sha256_checksum( +fn use_sha256_checksum( manifest: &DistManifest, fragment: &Option, checksum: &mut Option, @@ -94,6 +93,22 @@ fn sha256_checksum( } } +// Grab the linkage for this artifact from the manifest +fn use_linkage( + manifest: &DistManifest, + fragment: &Option, + dependencies: &mut Vec, +) { + if let Some(frag) = fragment { + let archive_linkage = manifest.linkage_for_artifact(&frag.id); + let homebrew_deps = archive_linkage + .homebrew + .iter() + .filter_map(|lib| lib.source.clone()); + dependencies.extend(homebrew_deps); + } +} + /// Converts the provided app name into a Ruby class-compatible /// string suitable for use as the class in a Homebrew formula. // Homebrew implementation is Formulary.class_s: From f6f082d10965243b4dffdea3b08468b05900ee92 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 17:17:00 -0400 Subject: [PATCH 14/24] chore: make --artifacts=lies produce real fake metadata --- cargo-dist/src/build/fake.rs | 62 +++++++++++++++++ cargo-dist/src/build/mod.rs | 126 +++++++++++++++++++++-------------- cargo-dist/src/lib.rs | 33 ++------- cargo-dist/src/linkage.rs | 4 +- 4 files changed, 145 insertions(+), 80 deletions(-) create mode 100644 cargo-dist/src/build/fake.rs diff --git a/cargo-dist/src/build/fake.rs b/cargo-dist/src/build/fake.rs new file mode 100644 index 000000000..175c2c5bc --- /dev/null +++ b/cargo-dist/src/build/fake.rs @@ -0,0 +1,62 @@ +//! real fake binaries, no substance, all style +//! +//! used by --artifacts=lies to reproduce as much of our builds as possible +//! without needing to actually run platform-specific builds + +use axoasset::LocalAsset; +use cargo_dist_schema::DistManifest; + +use crate::{BinaryIdx, CargoBuildStep, DistGraph, DistResult, GenericBuildStep}; + +use super::BuildExpectations; + +/// pretend to build a cargo target +/// +/// This produces empty binaries but otherwise emulates the build process as much as possible. +pub fn build_fake_cargo_target( + dist: &DistGraph, + manifest: &mut DistManifest, + target: &CargoBuildStep, +) -> DistResult<()> { + build_fake_binaries(dist, manifest, &target.expected_binaries) +} + +/// build a fake generic target +/// +/// This produces empty binaries but otherwise emulates the build process as much as possible. +pub fn build_fake_generic_target( + dist: &DistGraph, + manifest: &mut DistManifest, + target: &GenericBuildStep, +) -> DistResult<()> { + build_fake_binaries(dist, manifest, &target.expected_binaries) +} + +/// build fake binaries, and emulate the build process as much as possible +fn build_fake_binaries( + dist: &DistGraph, + manifest: &mut DistManifest, + binaries: &[BinaryIdx], +) -> DistResult<()> { + // Shove these in a temp dir inside the dist dir, where it's safe for us to do whatever + let tempdir = dist.dist_dir.join("_fake_tmp"); + // Clear out old files (files we need get copied out by the time this function returns) + if tempdir.exists() { + LocalAsset::remove_dir_all(&tempdir)?; + } + LocalAsset::create_dir_all(&tempdir)?; + + let mut expectations = BuildExpectations::new_fake(dist, binaries); + + for idx in binaries { + let binary = dist.binary(*idx); + let real_fake_bin = tempdir.join(&binary.file_name); + let package_id = super::package_id_string(binary.pkg_id.as_ref()); + LocalAsset::write_new_all("", &real_fake_bin)?; + expectations.found_bin(package_id, real_fake_bin, vec![]); + } + + expectations.process_bins(dist, manifest)?; + + Ok(()) +} diff --git a/cargo-dist/src/build/mod.rs b/cargo-dist/src/build/mod.rs index 4c4fc05d3..cf62555dd 100644 --- a/cargo-dist/src/build/mod.rs +++ b/cargo-dist/src/build/mod.rs @@ -11,12 +11,15 @@ use crate::{ }; pub mod cargo; +pub mod fake; pub mod generic; /// Output expectations for builds, and computed facts (all packages) pub struct BuildExpectations { /// Expectations grouped by package pub packages: SortedMap, + /// Whether this is fake (--artifacts=lies) + fake: bool, } /// Output expectations for builds, and computed facts (one package) @@ -61,7 +64,19 @@ impl BuildExpectations { ); } - Self { packages } + Self { + packages, + fake: false, + } + } + + /// Create a new BuildExpectations, but don't sweat things being faked + /// + /// This is used for --artifacts=lies + pub fn new_fake(dist: &DistGraph, expected_binaries: &[BinaryIdx]) -> Self { + let mut out = Self::new(dist, expected_binaries); + out.fake = true; + out } /// Report that a binary was found, which might have been expected @@ -117,14 +132,10 @@ impl BuildExpectations { /// /// * code signing / hashing /// * stripping - pub fn process_bins( - &mut self, - dist: &DistGraph, - manifest: &mut DistManifest, - ) -> DistResult<()> { + pub fn process_bins(&self, dist: &DistGraph, manifest: &mut DistManifest) -> DistResult<()> { let mut missing = vec![]; - for (pkg_id, pkg) in self.packages.iter_mut() { - for (bin_name, result_bin) in pkg.binaries.iter_mut() { + for (pkg_id, pkg) in &self.packages { + for (bin_name, result_bin) in &pkg.binaries { // If the src_path is missing, everything is bad let Some(src_path) = result_bin.src_path.as_deref() else { missing.push((pkg_id.to_owned(), bin_name.to_owned())); @@ -137,10 +148,10 @@ impl BuildExpectations { let bin = dist.binary(result_bin.idx); // compute linkage for the binary - compute_linkage(dist, manifest, result_bin, &bin.target)?; + self.compute_linkage(dist, manifest, result_bin, &bin.target)?; // copy files to their final homes - copy_assets(result_bin, bin)?; + self.copy_assets(result_bin, bin)?; } } @@ -152,52 +163,65 @@ impl BuildExpectations { Ok(()) } -} - -// Compute the linkage info for this binary -fn compute_linkage( - dist: &DistGraph, - manifest: &mut DistManifest, - src: &mut ExpectedBinary, - target: &TargetTriple, -) -> DistResult<()> { - let src_path = src - .src_path - .as_ref() - .expect("bin src_path should have been checked by caller"); - let linkage = determine_linkage(src_path, target)?.to_schema(); - let bin = dist.binary(src.idx); - manifest.assets.insert( - bin.id.clone(), - AssetInfo { - id: bin.id.clone(), - name: bin.name.clone(), - system: dist.system_id.clone(), - linkage: Some(linkage), - }, - ); - Ok(()) -} -// Copy the assets for this binary -fn copy_assets(src: &ExpectedBinary, dests: &Binary) -> DistResult<()> { - // Copy the main binary - let src_path = src - .src_path - .as_deref() - .expect("bin src_path should have been checked by caller"); - for dest_path in &dests.copy_exe_to { - copy_file(src_path, dest_path)?; + // Compute the linkage info for this binary + fn compute_linkage( + &self, + dist: &DistGraph, + manifest: &mut DistManifest, + src: &ExpectedBinary, + target: &TargetTriple, + ) -> DistResult<()> { + let src_path = src + .src_path + .as_ref() + .expect("bin src_path should have been checked by caller"); + + // If we're faking it, don't run the linkage stuff + let linkage = if self.fake { + // FIXME: fake this more interestingly! + let mut linkage = cargo_dist_schema::Linkage::default(); + linkage.other.insert(cargo_dist_schema::Library { + path: "fakelib".to_owned(), + source: None, + }); + linkage + } else { + determine_linkage(src_path, target)?.to_schema() + }; + let bin = dist.binary(src.idx); + manifest.assets.insert( + bin.id.clone(), + AssetInfo { + id: bin.id.clone(), + name: bin.name.clone(), + system: dist.system_id.clone(), + linkage: Some(linkage), + }, + ); + Ok(()) } - // Copy the symbols - for sym_path in &src.sym_paths { - for dest_path in &dests.copy_symbols_to { - copy_file(sym_path, dest_path)?; + // Copy the assets for this binary + fn copy_assets(&self, src: &ExpectedBinary, dests: &Binary) -> DistResult<()> { + // Copy the main binary + let src_path = src + .src_path + .as_deref() + .expect("bin src_path should have been checked by caller"); + for dest_path in &dests.copy_exe_to { + copy_file(src_path, dest_path)?; } - } - Ok(()) + // Copy the symbols + for sym_path in &src.sym_paths { + for dest_path in &dests.copy_symbols_to { + copy_file(sym_path, dest_path)?; + } + } + + Ok(()) + } } fn package_id_string(id: Option<&PackageId>) -> String { diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index 9b8aa95b7..c07e80340 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -18,8 +18,11 @@ use backend::{ ci::CiInfo, installer::{self, msi::MsiInstallerInfo, InstallerImpl}, }; -use build::cargo::{build_cargo_target, rustup_toolchain}; use build::generic::{build_generic_target, run_extra_artifacts_build}; +use build::{ + cargo::{build_cargo_target, rustup_toolchain}, + fake::{build_fake_cargo_target, build_fake_generic_target}, +}; use camino::{Utf8Path, Utf8PathBuf}; use cargo_dist_schema::{ArtifactId, DistManifest}; use config::{ @@ -263,8 +266,8 @@ fn build_fake( match target { // These two are the meat: don't actually run these at all, just // fake them out - BuildStep::Generic(target) => build_fake_generic_artifacts(dist_graph, target)?, - BuildStep::Cargo(target) => build_fake_cargo_artifacts(dist_graph, target)?, + BuildStep::Generic(target) => build_fake_generic_target(dist_graph, manifest, target)?, + BuildStep::Cargo(target) => build_fake_cargo_target(dist_graph, manifest, target)?, // Never run rustup BuildStep::Rustup(_) => {} // Copying files is fairly safe @@ -323,14 +326,6 @@ fn build_fake( Ok(()) } -fn build_fake_cargo_artifacts(dist: &DistGraph, target: &CargoBuildStep) -> Result<()> { - generate_fake_artifacts(dist, &target.expected_binaries) -} - -fn build_fake_generic_artifacts(dist: &DistGraph, target: &GenericBuildStep) -> Result<()> { - generate_fake_artifacts(dist, &target.expected_binaries) -} - fn run_fake_extra_artifacts_build(dist: &DistGraph, target: &ExtraBuildStep) -> Result<()> { for artifact in &target.expected_artifacts { let path = dist.dist_dir.join(artifact); @@ -350,22 +345,6 @@ fn generate_fake_msi( Ok(()) } -fn generate_fake_artifacts(dist: &DistGraph, binaries: &[BinaryIdx]) -> Result<()> { - for idx in binaries { - let binary = dist.binary(*idx); - - for exe_dest in &binary.copy_exe_to { - LocalAsset::write_new_all("", exe_dest)?; - } - - for sym_dest in &binary.copy_symbols_to { - LocalAsset::write_new_all("", sym_dest)?; - } - } - - Ok(()) -} - /// Generate a checksum for the src_path to dest_path fn generate_and_write_checksum( manifest: &mut DistManifest, diff --git a/cargo-dist/src/linkage.rs b/cargo-dist/src/linkage.rs index 199f878fb..5fc05df9a 100644 --- a/cargo-dist/src/linkage.rs +++ b/cargo-dist/src/linkage.rs @@ -362,10 +362,10 @@ fn do_otool(path: &Utf8PathBuf) -> DistResult> { let mut buf = vec![]; let size = f.read_to_end(&mut buf).unwrap(); let mut cur = Cursor::new(&buf[..size]); - if let OFile::MachFile { + if let Ok(OFile::MachFile { header: _, commands, - } = OFile::parse(&mut cur).unwrap() + }) = OFile::parse(&mut cur) { let commands = commands .iter() From 8473b0afdc188dfa56a95ac439c05815f116e917 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 17:21:42 -0400 Subject: [PATCH 15/24] chore: add lies test for axolotlsay --- cargo-dist/tests/gallery/dist.rs | 26 + cargo-dist/tests/integration-tests.rs | 38 + .../snapshots/axolotlsay_basic_lies.snap | 2963 +++++++++++++++++ 3 files changed, 3027 insertions(+) create mode 100644 cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap diff --git a/cargo-dist/tests/gallery/dist.rs b/cargo-dist/tests/gallery/dist.rs index 34efee076..0d99c90c1 100644 --- a/cargo-dist/tests/gallery/dist.rs +++ b/cargo-dist/tests/gallery/dist.rs @@ -133,6 +133,14 @@ pub struct Snapshots { } impl<'a> TestContext<'a, Tools> { + /// Run `cargo_dist_plan` and `cargo_dist_build_lies` + pub fn cargo_dist_build_lies_and_plan(&self, test_name: &str) -> Result { + let build = self.cargo_dist_build_lies(test_name)?; + let plan = self.cargo_dist_plan(test_name)?; + + Ok(BuildAndPlanResult { build, plan }) + } + /// Run `cargo_dist_plan` and `cargo_dist_build_global` pub fn cargo_dist_build_and_plan(&self, test_name: &str) -> Result { let build = self.cargo_dist_build_global(test_name)?; @@ -170,6 +178,24 @@ impl<'a> TestContext<'a, Tools> { self.load_dist_results(test_name) } + + /// Run 'cargo dist build -alies' and return paths to various files that were generated + pub fn cargo_dist_build_lies(&self, test_name: &str) -> Result { + // If the cargo-dist target dir exists, delete it to avoid cross-contamination + let out_path = Utf8Path::new("target/distrib/"); + if out_path.exists() { + LocalAsset::remove_dir_all(out_path)?; + } + + // build installers + eprintln!("running cargo dist build -aglobal..."); + self.tools + .cargo_dist + .output_checked(|cmd| cmd.arg("dist").arg("build").arg("-alies"))?; + + self.load_dist_results(test_name) + } + /// Run 'cargo dist generate' and return paths to various files that were generated pub fn cargo_dist_generate(&self, test_name: &str) -> Result { self.cargo_dist_generate_prefixed(test_name, "") diff --git a/cargo-dist/tests/integration-tests.rs b/cargo-dist/tests/integration-tests.rs index b4a236a0b..ff01a5767 100644 --- a/cargo-dist/tests/integration-tests.rs +++ b/cargo-dist/tests/integration-tests.rs @@ -62,6 +62,44 @@ path-guid = "BFD25009-65A4-4D1E-97F1-0030465D90D6" }) } + +#[test] +fn axolotlsay_basic_lies() -> Result<(), miette::Report> { + let test_name = _function_name!(); + AXOLOTLSAY.run_test(|ctx| { + let dist_version = ctx.tools.cargo_dist.version().unwrap(); + ctx.patch_cargo_toml(format!(r#" +[workspace.metadata.dist] +cargo-dist-version = "{dist_version}" +installers = ["shell", "powershell", "homebrew", "npm", "msi"] +tap = "axodotdev/homebrew-packages" +publish-jobs = ["homebrew"] +targets = ["x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "aarch64-apple-darwin"] +ci = ["github"] +unix-archive = ".tar.gz" +windows-archive = ".tar.gz" +scope = "@axodotdev" + +[package.metadata.wix] +upgrade-guid = "B36177BE-EA4D-44FB-B05C-EDDABDAA95CA" +path-guid = "BFD25009-65A4-4D1E-97F1-0030465D90D6" + +"# + ))?; + + // Run generate to make sure stuff is up to date before running other commands + let ci_result = ctx.cargo_dist_generate(test_name)?; + let ci_snap = ci_result.check_all()?; + // Do usual build+plan checks + let main_result = ctx.cargo_dist_build_and_plan(test_name)?; + let main_snap = main_result.check_all(ctx, ".cargo/bin/")?; + // snapshot all + main_snap.join(ci_snap).snap(); + Ok(()) + }) +} + + #[test] fn axolotlsay_custom_formula() -> Result<(), miette::Report> { let test_name = _function_name!(); diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap new file mode 100644 index 000000000..bacb6691f --- /dev/null +++ b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap @@ -0,0 +1,2963 @@ +--- +source: cargo-dist/tests/gallery/dist.rs +expression: self.payload +--- +================ installer.sh ================ +#!/bin/sh +# shellcheck shell=dash +# +# Licensed under the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +if [ "$KSH_VERSION" = 'Version JM 93t+ 2010-03-05' ]; then + # The version of ksh93 that ships with many illumos systems does not + # support the "local" extension. Print a message rather than fail in + # subtle ways later on: + echo 'this installer does not work with this ksh93 version; please try bash!' >&2 + exit 1 +fi + +set -u + +APP_NAME="axolotlsay" +APP_VERSION="0.2.1" +ARTIFACT_DOWNLOAD_URL="${INSTALLER_DOWNLOAD_URL:-https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1}" +PRINT_VERBOSE=${INSTALLER_PRINT_VERBOSE:-0} +PRINT_QUIET=${INSTALLER_PRINT_QUIET:-0} +NO_MODIFY_PATH=${INSTALLER_NO_MODIFY_PATH:-0} +read -r RECEIPT <&2 + say_verbose " from $_url" 1>&2 + say_verbose " to $_file" 1>&2 + + ensure mkdir -p "$_dir" + + if ! downloader "$_url" "$_file"; then + say "failed to download $_url" + say "this may be a standard network error, but it may also indicate" + say "that $APP_NAME's release process is not working. When in doubt" + say "please feel free to open an issue!" + exit 1 + fi + + # ...and then the updater, if it exists + if [ -n "$_updater_name" ]; then + local _updater_url="$ARTIFACT_DOWNLOAD_URL/$_updater_name" + # This renames the artifact while doing the download, removing the + # target triple and leaving just the appname-update format + local _updater_file="$_dir/$APP_NAME-update" + + if ! downloader "$_updater_url" "$_updater_file"; then + say "failed to download $_updater_url" + say "this may be a standard network error, but it may also indicate" + say "that $APP_NAME's release process is not working. When in doubt" + say "please feel free to open an issue!" + exit 1 + fi + + # Add the updater to the list of binaries to install + _bins="$_bins $APP_NAME-update" + fi + + # unpack the archive + case "$_zip_ext" in + ".zip") + ensure unzip -q "$_file" -d "$_dir" + ;; + + ".tar."*) + ensure tar xf "$_file" --strip-components 1 -C "$_dir" + ;; + *) + err "unknown archive format: $_zip_ext" + ;; + esac + + install "$_dir" "$_bins" "$@" + local _retval=$? + if [ "$_retval" != 0 ]; then + return "$_retval" + fi + + ignore rm -rf "$_dir" + + # Install the install receipt + mkdir -p "$RECEIPT_HOME" || { + err "unable to create receipt directory at $RECEIPT_HOME" + } + echo "$RECEIPT" > "$RECEIPT_HOME/$APP_NAME-receipt.json" + # shellcheck disable=SC2320 + local _retval=$? + + return "$_retval" +} + +# See discussion of late-bound vs early-bound for why we use single-quotes with env vars +# shellcheck disable=SC2016 +install() { + # This code needs to both compute certain paths for itself to write to, and + # also write them to shell/rc files so that they can look them up to e.g. + # add them to PATH. This requires an active distinction between paths + # and expressions that can compute them. + # + # The distinction lies in when we want env-vars to be evaluated. For instance + # if we determine that we want to install to $HOME/.myapp, which do we add + # to e.g. $HOME/.profile: + # + # * early-bound: export PATH="/home/myuser/.myapp:$PATH" + # * late-bound: export PATH="$HOME/.myapp:$PATH" + # + # In this case most people would prefer the late-bound version, but in other + # cases the early-bound version might be a better idea. In particular when using + # other env-vars than $HOME, they are more likely to be only set temporarily + # for the duration of this install script, so it's more advisable to erase their + # existence with early-bounding. + # + # This distinction is handled by "double-quotes" (early) vs 'single-quotes' (late). + # + # This script has a few different variants, the most complex one being the + # CARGO_HOME version which attempts to install things to Cargo's bin dir, + # potentially setting up a minimal version if the user hasn't ever installed Cargo. + # + # In this case we need to: + # + # * Install to $HOME/.cargo/bin/ + # * Create a shell script at $HOME/.cargo/env that: + # * Checks if $HOME/.cargo/bin/ is on PATH + # * and if not prepends it to PATH + # * Edits $HOME/.profile to run $HOME/.cargo/env (if the line doesn't exist) + # + # To do this we need these 4 values: + + # The actual path we're going to install to + local _install_dir + # Path to the an shell script that adds install_dir to PATH + local _env_script_path + # Potentially-late-bound version of install_dir to write env_script + local _install_dir_expr + # Potentially-late-bound version of env_script_path to write to rcfiles like $HOME/.profile + local _env_script_path_expr + + + # first try CARGO_HOME, then fallback to HOME + if [ -n "${CARGO_HOME:-}" ]; then + _install_home="$CARGO_HOME" + _install_dir="$CARGO_HOME/bin" + _env_script_path="$CARGO_HOME/env" + # If CARGO_HOME was set but it ended up being the default $HOME-based path, + # then keep things late-bound. Otherwise bake the value for safety. + # This is what rustup does, and accurately reproducing it is useful. + if [ -n "${HOME:-}" ]; then + if [ "$HOME/.cargo/bin" = "$_install_dir" ]; then + _install_dir_expr='$HOME/.cargo/bin' + _env_script_path_expr='$HOME/.cargo/env' + else + _install_dir_expr="$_install_dir" + _env_script_path_expr="$_env_script_path" + fi + else + _install_dir_expr="$_install_dir" + _env_script_path_expr="$_env_script_path" + fi + elif [ -n "${HOME:-}" ]; then + _install_home="$HOME/.cargo" + _install_dir="$HOME/.cargo/bin" + _env_script_path="$HOME/.cargo/env" + _install_dir_expr='$HOME/.cargo/bin' + _env_script_path_expr='$HOME/.cargo/env' + else + err "could not find your CARGO_HOME or HOME dir to install binaries to" + fi + # Replace the temporary cargo home with the calculated one + RECEIPT=$(echo "$RECEIPT" | sed "s,AXO_CARGO_HOME,$_install_dir,") + + say "installing to $_install_dir" + ensure mkdir -p "$_install_dir" + + # copy all the binaries to the install dir + local _src_dir="$1" + local _bins="$2" + for _bin_name in $_bins; do + local _bin="$_src_dir/$_bin_name" + ensure cp "$_bin" "$_install_dir" + # unzip seems to need this chmod + ensure chmod +x "$_install_dir/$_bin_name" + say " $_bin_name" + done + + say "everything's installed!" + + if [ "0" = "$NO_MODIFY_PATH" ]; then + add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".profile" + exit1=$? + add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".bash_profile .bash_login .bashrc" + exit2=$? + add_install_dir_to_path "$_install_dir_expr" "$_env_script_path" "$_env_script_path_expr" ".zshrc .zshenv" + exit3=$? + + if [ "${exit1:-0}" = 1 ] || [ "${exit2:-0}" = 1 ] || [ "${exit3:-0}" = 1 ]; then + say "" + say "To add $_install_dir_expr to your PATH, either restart your shell or run:" + say "" + say " source $_env_script_path_expr" + fi + fi +} + +print_home_for_script() { + local script="$1" + + local _home + case "$script" in + # zsh has a special ZDOTDIR directory, which if set + # should be considered instead of $HOME + .zsh*) + if [ -n "${ZDOTDIR:-}" ]; then + _home="$ZDOTDIR" + else + _home="$HOME" + fi + ;; + *) + _home="$HOME" + ;; + esac + + echo "$_home" +} + +add_install_dir_to_path() { + # Edit rcfiles ($HOME/.profile) to add install_dir to $PATH + # + # We do this slightly indirectly by creating an "env" shell script which checks if install_dir + # is on $PATH already, and prepends it if not. The actual line we then add to rcfiles + # is to just source that script. This allows us to blast it into lots of different rcfiles and + # have it run multiple times without causing problems. It's also specifically compatible + # with the system rustup uses, so that we don't conflict with it. + local _install_dir_expr="$1" + local _env_script_path="$2" + local _env_script_path_expr="$3" + local _rcfiles="$4" + + if [ -n "${HOME:-}" ]; then + local _target + local _home + + # Find the first file in the array that exists and choose + # that as our target to write to + for _rcfile_relative in $_rcfiles; do + _home="$(print_home_for_script "$_rcfile_relative")" + local _rcfile="$_home/$_rcfile_relative" + + if [ -f "$_rcfile" ]; then + _target="$_rcfile" + break + fi + done + + # If we didn't find anything, pick the first entry in the + # list as the default to create and write to + if [ -z "${_target:-}" ]; then + local _rcfile_relative + _rcfile_relative="$(echo "$_rcfiles" | awk '{ print $1 }')" + _home="$(print_home_for_script "$_rcfile_relative")" + _target="$_home/$_rcfile_relative" + fi + + # `source x` is an alias for `. x`, and the latter is more portable/actually-posix. + # This apparently comes up a lot on freebsd. It's easy enough to always add + # the more robust line to rcfiles, but when telling the user to apply the change + # to their current shell ". x" is pretty easy to misread/miscopy, so we use the + # prettier "source x" line there. Hopefully people with Weird Shells are aware + # this is a thing and know to tweak it (or just restart their shell). + local _robust_line=". \"$_env_script_path_expr\"" + local _pretty_line="source \"$_env_script_path_expr\"" + + # Add the env script if it doesn't already exist + if [ ! -f "$_env_script_path" ]; then + say_verbose "creating $_env_script_path" + write_env_script "$_install_dir_expr" "$_env_script_path" + else + say_verbose "$_env_script_path already exists" + fi + + # Check if the line is already in the rcfile + # grep: 0 if matched, 1 if no match, and 2 if an error occurred + # + # Ideally we could use quiet grep (-q), but that makes "match" and "error" + # have the same behaviour, when we want "no match" and "error" to be the same + # (on error we want to create the file, which >> conveniently does) + # + # We search for both kinds of line here just to do the right thing in more cases. + if ! grep -F "$_robust_line" "$_target" > /dev/null 2>/dev/null && \ + ! grep -F "$_pretty_line" "$_target" > /dev/null 2>/dev/null + then + # If the script now exists, add the line to source it to the rcfile + # (This will also create the rcfile if it doesn't exist) + if [ -f "$_env_script_path" ]; then + say_verbose "adding $_robust_line to $_target" + ensure echo "$_robust_line" >> "$_target" + return 1 + fi + else + say_verbose "$_install_dir already on PATH" + fi + fi +} + +write_env_script() { + # write this env script to the given path (this cat/EOF stuff is a "heredoc" string) + local _install_dir_expr="$1" + local _env_script_path="$2" + ensure cat < "$_env_script_path" +#!/bin/sh +# add binaries to PATH if they aren't added yet +# affix colons on either side of \$PATH to simplify matching +case ":\${PATH}:" in + *:"$_install_dir_expr":*) + ;; + *) + # Prepending path in case a system-installed binary needs to be overridden + export PATH="$_install_dir_expr:\$PATH" + ;; +esac +EOF +} + +check_proc() { + # Check for /proc by looking for the /proc/self/exe link + # This is only run on Linux + if ! test -L /proc/self/exe ; then + err "fatal: Unable to find /proc/self/exe. Is /proc mounted? Installation cannot proceed without /proc." + fi +} + +get_bitness() { + need_cmd head + # Architecture detection without dependencies beyond coreutils. + # ELF files start out "\x7fELF", and the following byte is + # 0x01 for 32-bit and + # 0x02 for 64-bit. + # The printf builtin on some shells like dash only supports octal + # escape sequences, so we use those. + local _current_exe_head + _current_exe_head=$(head -c 5 /proc/self/exe ) + if [ "$_current_exe_head" = "$(printf '\177ELF\001')" ]; then + echo 32 + elif [ "$_current_exe_head" = "$(printf '\177ELF\002')" ]; then + echo 64 + else + err "unknown platform bitness" + fi +} + +is_host_amd64_elf() { + need_cmd head + need_cmd tail + # ELF e_machine detection without dependencies beyond coreutils. + # Two-byte field at offset 0x12 indicates the CPU, + # but we're interested in it being 0x3E to indicate amd64, or not that. + local _current_exe_machine + _current_exe_machine=$(head -c 19 /proc/self/exe | tail -c 1) + [ "$_current_exe_machine" = "$(printf '\076')" ] +} + +get_endianness() { + local cputype=$1 + local suffix_eb=$2 + local suffix_el=$3 + + # detect endianness without od/hexdump, like get_bitness() does. + need_cmd head + need_cmd tail + + local _current_exe_endianness + _current_exe_endianness="$(head -c 6 /proc/self/exe | tail -c 1)" + if [ "$_current_exe_endianness" = "$(printf '\001')" ]; then + echo "${cputype}${suffix_el}" + elif [ "$_current_exe_endianness" = "$(printf '\002')" ]; then + echo "${cputype}${suffix_eb}" + else + err "unknown platform endianness" + fi +} + +get_architecture() { + local _ostype + local _cputype + _ostype="$(uname -s)" + _cputype="$(uname -m)" + local _clibtype="gnu" + local _local_glibc + + if [ "$_ostype" = Linux ]; then + if [ "$(uname -o)" = Android ]; then + _ostype=Android + fi + if ldd --version 2>&1 | grep -q 'musl'; then + _clibtype="musl-dynamic" + # glibc, but is it a compatible glibc? + else + # Parsing version out from line 1 like: + # ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35 + _local_glibc="$(ldd --version | awk -F' ' '{ if (FNR<=1) print $NF }')" + + if [ "$(echo "${_local_glibc}" | awk -F. '{ print $1 }')" = $BUILDER_GLIBC_MAJOR ] && [ "$(echo "${_local_glibc}" | awk -F. '{ print $2 }')" -ge $BUILDER_GLIBC_SERIES ]; then + _clibtype="gnu" + else + say "System glibc version (\`${_local_glibc}') is too old; using musl" >&2 + _clibtype="musl-static" + fi + fi + fi + + if [ "$_ostype" = Darwin ] && [ "$_cputype" = i386 ]; then + # Darwin `uname -m` lies + if sysctl hw.optional.x86_64 | grep -q ': 1'; then + _cputype=x86_64 + fi + fi + + if [ "$_ostype" = SunOS ]; then + # Both Solaris and illumos presently announce as "SunOS" in "uname -s" + # so use "uname -o" to disambiguate. We use the full path to the + # system uname in case the user has coreutils uname first in PATH, + # which has historically sometimes printed the wrong value here. + if [ "$(/usr/bin/uname -o)" = illumos ]; then + _ostype=illumos + fi + + # illumos systems have multi-arch userlands, and "uname -m" reports the + # machine hardware name; e.g., "i86pc" on both 32- and 64-bit x86 + # systems. Check for the native (widest) instruction set on the + # running kernel: + if [ "$_cputype" = i86pc ]; then + _cputype="$(isainfo -n)" + fi + fi + + case "$_ostype" in + + Android) + _ostype=linux-android + ;; + + Linux) + check_proc + _ostype=unknown-linux-$_clibtype + _bitness=$(get_bitness) + ;; + + FreeBSD) + _ostype=unknown-freebsd + ;; + + NetBSD) + _ostype=unknown-netbsd + ;; + + DragonFly) + _ostype=unknown-dragonfly + ;; + + Darwin) + _ostype=apple-darwin + ;; + + illumos) + _ostype=unknown-illumos + ;; + + MINGW* | MSYS* | CYGWIN* | Windows_NT) + _ostype=pc-windows-gnu + ;; + + *) + err "unrecognized OS type: $_ostype" + ;; + + esac + + case "$_cputype" in + + i386 | i486 | i686 | i786 | x86) + _cputype=i686 + ;; + + xscale | arm) + _cputype=arm + if [ "$_ostype" = "linux-android" ]; then + _ostype=linux-androideabi + fi + ;; + + armv6l) + _cputype=arm + if [ "$_ostype" = "linux-android" ]; then + _ostype=linux-androideabi + else + _ostype="${_ostype}eabihf" + fi + ;; + + armv7l | armv8l) + _cputype=armv7 + if [ "$_ostype" = "linux-android" ]; then + _ostype=linux-androideabi + else + _ostype="${_ostype}eabihf" + fi + ;; + + aarch64 | arm64) + _cputype=aarch64 + ;; + + x86_64 | x86-64 | x64 | amd64) + _cputype=x86_64 + ;; + + mips) + _cputype=$(get_endianness mips '' el) + ;; + + mips64) + if [ "$_bitness" -eq 64 ]; then + # only n64 ABI is supported for now + _ostype="${_ostype}abi64" + _cputype=$(get_endianness mips64 '' el) + fi + ;; + + ppc) + _cputype=powerpc + ;; + + ppc64) + _cputype=powerpc64 + ;; + + ppc64le) + _cputype=powerpc64le + ;; + + s390x) + _cputype=s390x + ;; + riscv64) + _cputype=riscv64gc + ;; + loongarch64) + _cputype=loongarch64 + ;; + *) + err "unknown CPU type: $_cputype" + + esac + + # Detect 64-bit linux with 32-bit userland + if [ "${_ostype}" = unknown-linux-gnu ] && [ "${_bitness}" -eq 32 ]; then + case $_cputype in + x86_64) + # 32-bit executable for amd64 = x32 + if is_host_amd64_elf; then { + err "x32 linux unsupported" + }; else + _cputype=i686 + fi + ;; + mips64) + _cputype=$(get_endianness mips '' el) + ;; + powerpc64) + _cputype=powerpc + ;; + aarch64) + _cputype=armv7 + if [ "$_ostype" = "linux-android" ]; then + _ostype=linux-androideabi + else + _ostype="${_ostype}eabihf" + fi + ;; + riscv64gc) + err "riscv64 with 32-bit userland unsupported" + ;; + esac + fi + + # treat armv7 systems without neon as plain arm + if [ "$_ostype" = "unknown-linux-gnueabihf" ] && [ "$_cputype" = armv7 ]; then + if ensure grep '^Features' /proc/cpuinfo | grep -q -v neon; then + # At least one processor does not have NEON. + _cputype=arm + fi + fi + + _arch="${_cputype}-${_ostype}" + + RETVAL="$_arch" +} + +say() { + if [ "0" = "$PRINT_QUIET" ]; then + echo "$1" + fi +} + +say_verbose() { + if [ "1" = "$PRINT_VERBOSE" ]; then + echo "$1" + fi +} + +err() { + if [ "0" = "$PRINT_QUIET" ]; then + local red + local reset + red=$(tput setaf 1 2>/dev/null || echo '') + reset=$(tput sgr0 2>/dev/null || echo '') + say "${red}ERROR${reset}: $1" >&2 + fi + exit 1 +} + +need_cmd() { + if ! check_cmd "$1" + then err "need '$1' (command not found)" + fi +} + +check_cmd() { + command -v "$1" > /dev/null 2>&1 + return $? +} + +assert_nz() { + if [ -z "$1" ]; then err "assert_nz $2"; fi +} + +# Run a command that should never fail. If the command fails execution +# will immediately terminate with an error showing the failing +# command. +ensure() { + if ! "$@"; then err "command failed: $*"; fi +} + +# This is just for indicating that commands' results are being +# intentionally ignored. Usually, because it's being executed +# as part of error handling. +ignore() { + "$@" +} + +# This wraps curl or wget. Try curl first, if not installed, +# use wget instead. +downloader() { + if check_cmd curl + then _dld=curl + elif check_cmd wget + then _dld=wget + else _dld='curl or wget' # to be used in error message of need_cmd + fi + + if [ "$1" = --check ] + then need_cmd "$_dld" + elif [ "$_dld" = curl ] + then curl -sSfL "$1" -o "$2" + elif [ "$_dld" = wget ] + then wget "$1" -O "$2" + else err "Unknown downloader" # should not reach here + fi +} + +download_binary_and_run_installer "$@" || exit 1 + +================ formula.rb ================ +class Axolotlsay < Formula + desc "💬 a CLI for learning to distribute CLIs in rust" + version "0.2.1" + on_macos do + on_arm do + url "https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz" + end + on_intel do + url "https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz" + end + end + on_linux do + on_intel do + url "https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz" + end + end + license "MIT OR Apache-2.0" + + def install + on_macos do + on_arm do + bin.install "axolotlsay" + end + end + on_macos do + on_intel do + bin.install "axolotlsay" + end + end + on_linux do + on_intel do + bin.install "axolotlsay" + end + end + + # Homebrew will automatically install these, so we don't need to do that + doc_files = Dir["README.*", "readme.*", "LICENSE", "LICENSE.*", "CHANGELOG.*"] + leftover_contents = Dir["*"] - doc_files + + # Install any leftover files in pkgshare; these are probably config or + # sample files. + pkgshare.install *leftover_contents unless leftover_contents.empty? + end +end + +================ installer.ps1 ================ +# Licensed under the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +<# +.SYNOPSIS + +The installer for axolotlsay 0.2.1 + +.DESCRIPTION + +This script detects what platform you're on and fetches an appropriate archive from +https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1 +then unpacks the binaries and installs them to $env:CARGO_HOME\bin ($HOME\.cargo\bin) + +It will then add that dir to PATH by editing your Environment.Path registry key + +.PARAMETER ArtifactDownloadUrl +The URL of the directory where artifacts can be fetched from + +.PARAMETER NoModifyPath +Don't add the install directory to PATH + +.PARAMETER Help +Print help + +#> + +param ( + [Parameter(HelpMessage = "The URL of the directory where artifacts can be fetched from")] + [string]$ArtifactDownloadUrl = 'https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1', + [Parameter(HelpMessage = "Don't add the install directory to PATH")] + [switch]$NoModifyPath, + [Parameter(HelpMessage = "Print Help")] + [switch]$Help +) + +$app_name = 'axolotlsay' +$app_version = '0.2.1' + +$receipt = @" +{"binaries":["CARGO_DIST_BINS"],"install_prefix":"AXO_CARGO_HOME","provider":{"source":"cargo-dist","version":"CENSORED"},"source":{"app_name":"axolotlsay","name":"axolotlsay","owner":"axodotdev","release_type":"github"},"version":"CENSORED"} +"@ +$receipt_home = "${env:LOCALAPPDATA}\axolotlsay" + +function Install-Binary($install_args) { + if ($Help) { + Get-Help $PSCommandPath -Detailed + Exit + } + + Initialize-Environment + + # Platform info injected by cargo-dist + $platforms = @{ + "x86_64-pc-windows-msvc" = @{ + "artifact_name" = "axolotlsay-x86_64-pc-windows-msvc.tar.gz" + "bins" = "axolotlsay.exe" + "zip_ext" = ".tar.gz" + } + } + + $fetched = Download "$ArtifactDownloadUrl" $platforms + # FIXME: add a flag that lets the user not do this step + Invoke-Installer $fetched "$install_args" +} + +function Get-TargetTriple() { + try { + # NOTE: this might return X64 on ARM64 Windows, which is OK since emulation is available. + # It works correctly starting in PowerShell Core 7.3 and Windows PowerShell in Win 11 22H2. + # Ideally this would just be + # [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture + # but that gets a type from the wrong assembly on Windows PowerShell (i.e. not Core) + $a = [System.Reflection.Assembly]::LoadWithPartialName("System.Runtime.InteropServices.RuntimeInformation") + $t = $a.GetType("System.Runtime.InteropServices.RuntimeInformation") + $p = $t.GetProperty("OSArchitecture") + # Possible OSArchitecture Values: https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.architecture + # Rust supported platforms: https://doc.rust-lang.org/stable/rustc/platform-support.html + switch ($p.GetValue($null).ToString()) + { + "X86" { return "i686-pc-windows-msvc" } + "X64" { return "x86_64-pc-windows-msvc" } + "Arm" { return "thumbv7a-pc-windows-msvc" } + "Arm64" { return "aarch64-pc-windows-msvc" } + } + } catch { + # The above was added in .NET 4.7.1, so Windows PowerShell in versions of Windows + # prior to Windows 10 v1709 may not have this API. + Write-Verbose "Get-TargetTriple: Exception when trying to determine OS architecture." + Write-Verbose $_ + } + + # This is available in .NET 4.0. We already checked for PS 5, which requires .NET 4.5. + Write-Verbose("Get-TargetTriple: falling back to Is64BitOperatingSystem.") + if ([System.Environment]::Is64BitOperatingSystem) { + return "x86_64-pc-windows-msvc" + } else { + return "i686-pc-windows-msvc" + } +} + +function Download($download_url, $platforms) { + $arch = Get-TargetTriple + + if (-not $platforms.ContainsKey($arch)) { + # X64 is well-supported, including in emulation on ARM64 + Write-Verbose "$arch is not available, falling back to X64" + $arch = "x86_64-pc-windows-msvc" + } + + if (-not $platforms.ContainsKey($arch)) { + # should not be possible, as currently we always produce X64 binaries. + $platforms_json = ConvertTo-Json $platforms + throw "ERROR: could not find binaries for this platform. Last platform tried: $arch platform info: $platforms_json" + } + + # Lookup what we expect this platform to look like + $info = $platforms[$arch] + $zip_ext = $info["zip_ext"] + $bin_names = $info["bins"] + $artifact_name = $info["artifact_name"] + + # Make a new temp dir to unpack things to + $tmp = New-Temp-Dir + $dir_path = "$tmp\$app_name$zip_ext" + + # Download and unpack! + $url = "$download_url/$artifact_name" + Write-Information "Downloading $app_name $app_version ($arch)" + Write-Verbose " from $url" + Write-Verbose " to $dir_path" + $wc = New-Object Net.Webclient + $wc.downloadFile($url, $dir_path) + + Write-Verbose "Unpacking to $tmp" + + # Select the tool to unpack the files with. + # + # As of windows 10(?), powershell comes with tar preinstalled, but in practice + # it only seems to support .tar.gz, and not xz/zstd. Still, we should try to + # forward all tars to it in case the user has a machine that can handle it! + switch -Wildcard ($zip_ext) { + ".zip" { + Expand-Archive -Path $dir_path -DestinationPath "$tmp"; + Break + } + ".tar.*" { + tar xf $dir_path --strip-components 1 -C "$tmp"; + Break + } + Default { + throw "ERROR: unknown archive format $zip_ext" + } + } + + # Let the next step know what to copy + $bin_paths = @() + foreach ($bin_name in $bin_names) { + Write-Verbose " Unpacked $bin_name" + $bin_paths += "$tmp\$bin_name" + } + + if ($null -ne $info["updater"]) { + $updater_id = $info["updater"]["artifact_name"] + $updater_url = "$download_url/$updater_id" + $out_name = "$tmp\axolotlsay-update.exe" + + $wc.downloadFile($updater_url, $out_name) + $bin_paths += $out_name + } + + return $bin_paths +} + +function Invoke-Installer($bin_paths) { + + # first try CARGO_HOME, then fallback to HOME + # (for whatever reason $HOME is not a normal env var and doesn't need the $env: prefix) + $root = if (($base_dir = $env:CARGO_HOME)) { + $base_dir + } elseif (($base_dir = $HOME)) { + Join-Path $base_dir ".cargo" + } else { + throw "ERROR: could not find your HOME dir or CARGO_HOME to install binaries to" + } + + $dest_dir = Join-Path $root "bin" + + # The replace call here ensures proper escaping is inlined into the receipt + $receipt = $receipt.Replace('AXO_CARGO_HOME', $dest_dir.replace("\", "\\")) + + $dest_dir = New-Item -Force -ItemType Directory -Path $dest_dir + Write-Information "Installing to $dest_dir" + # Just copy the binaries from the temp location to the install dir + foreach ($bin_path in $bin_paths) { + $installed_file = Split-Path -Path "$bin_path" -Leaf + Copy-Item "$bin_path" -Destination "$dest_dir" + Remove-Item "$bin_path" -Recurse -Force + Write-Information " $installed_file" + } + + # Replaces the placeholder binary entry with the actual list of binaries + $arch = Get-TargetTriple + $info = $platforms[$arch] + $formatted_bins = ($info["bins"] | ForEach-Object { '"' + $_ + '"' }) -join "," + $receipt = $receipt.Replace('"CARGO_DIST_BINS"', $formatted_bins) + + # Write the install receipt + $null = New-Item -Path $receipt_home -ItemType "directory" -ErrorAction SilentlyContinue + Out-File -FilePath $receipt_home/axolotlsay-receipt.json -InputObject $receipt -Encoding utf8 + + Write-Information "Everything's installed!" + if (-not $NoModifyPath) { + if (Add-Path $dest_dir) { + Write-Information "" + Write-Information "$dest_dir was added to your PATH, you may need to restart your shell for that to take effect." + } + } +} + +# Try to add the given path to PATH via the registry +# +# Returns true if the registry was modified, otherwise returns false +# (indicating it was already on PATH) +function Add-Path($OrigPathToAdd) { + $RegistryPath = "HKCU:\Environment" + $PropertyName = "Path" + $PathToAdd = $OrigPathToAdd + + $Item = if (Test-Path $RegistryPath) { + # If the registry key exists, get it + Get-Item -Path $RegistryPath + } else { + # If the registry key doesn't exist, create it + Write-Verbose "Creating $RegistryPath" + New-Item -Path $RegistryPath -Force + } + + $OldPath = "" + try { + # Try to get the old PATH value. If that fails, assume we're making it from scratch. + # Otherwise assume there's already paths in here and use a ; separator + $OldPath = $Item | Get-ItemPropertyValue -Name $PropertyName + $PathToAdd = "$PathToAdd;" + } catch { + # We'll be creating the PATH from scratch + Write-Verbose "Adding $PropertyName Property to $RegistryPath" + } + + # Check if the path is already there + # + # We don't want to incorrectly match "C:\blah\" to "C:\blah\blah\", so we include the semicolon + # delimiters when searching, ensuring exact matches. To avoid corner cases we add semicolons to + # both sides of the input, allowing us to pretend we're always in the middle of a list. + if (";$OldPath;" -like "*;$OrigPathToAdd;*") { + # Already on path, nothing to do + Write-Verbose "install dir already on PATH, all done!" + return $false + } else { + # Actually update PATH + Write-Verbose "Adding $OrigPathToAdd to your PATH" + $NewPath = $PathToAdd + $OldPath + # We use -Force here to make the value already existing not be an error + $Item | New-ItemProperty -Name $PropertyName -Value $NewPath -PropertyType String -Force | Out-Null + return $true + } +} + +function Initialize-Environment() { + If (($PSVersionTable.PSVersion.Major) -lt 5) { + throw @" +Error: PowerShell 5 or later is required to install $app_name. +Upgrade PowerShell: + + https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell + +"@ + } + + # show notification to change execution policy: + $allowedExecutionPolicy = @('Unrestricted', 'RemoteSigned', 'ByPass') + If ((Get-ExecutionPolicy).ToString() -notin $allowedExecutionPolicy) { + throw @" +Error: PowerShell requires an execution policy in [$($allowedExecutionPolicy -join ", ")] to run $app_name. For example, to set the execution policy to 'RemoteSigned' please run: + + Set-ExecutionPolicy RemoteSigned -scope CurrentUser + +"@ + } + + # GitHub requires TLS 1.2 + If ([System.Enum]::GetNames([System.Net.SecurityProtocolType]) -notcontains 'Tls12') { + throw @" +Error: Installing $app_name requires at least .NET Framework 4.5 +Please download and install it first: + + https://www.microsoft.com/net/download + +"@ + } +} + +function New-Temp-Dir() { + [CmdletBinding(SupportsShouldProcess)] + param() + $parent = [System.IO.Path]::GetTempPath() + [string] $name = [System.Guid]::NewGuid() + New-Item -ItemType Directory -Path (Join-Path $parent $name) +} + +# PSScriptAnalyzer doesn't like how we use our params as globals, this calms it +$Null = $ArtifactDownloadUrl, $NoModifyPath, $Help +# Make Write-Information statements be visible +$InformationPreference = "Continue" + +# The default interactive handler +try { + Install-Binary "$Args" +} catch { + Write-Information $_ + exit 1 +} + +================ npm-package.tar.gz/package/.gitignore ================ +/node_modules + +================ npm-package.tar.gz/package/CHANGELOG.md ================ +# Version 0.2.1 + +```text + +--------------------------------------+ + | now with linux static musl binary!!! | + +--------------------------------------+ + / +≽(◕ ᴗ ◕)≼ +``` + +# Version 0.2.0 + +```text + +-----------------------------------------+ + | now with homebrew and msi installers!!! | + +-----------------------------------------+ + / +≽(◕ ᴗ ◕)≼ +``` + +# Version 0.1.0 + +```text + +------------------------+ + | the initial release!!! | + +------------------------+ + / +≽(◕ ᴗ ◕)≼ +``` + +================ npm-package.tar.gz/package/LICENSE-APACHE ================ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2023 Axo Developer Co. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +================ npm-package.tar.gz/package/LICENSE-MIT ================ +Copyright (c) 2023 Axo Developer Co. + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +================ npm-package.tar.gz/package/README.md ================ +# axolotlsay +> 💬 a CLI for learning to distribute CLIs in rust + + +## Usage + +```sh +> axolotlsay "hello world" + + +-------------+ + | hello world | + +-------------+ + / +≽(◕ ᴗ ◕)≼ +``` + +## License + +Licensed under either of + +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or [apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or [opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)) + +at your option. + +================ npm-package.tar.gz/package/binary.js ================ +const { Binary } = require("binary-install"); +const os = require("os"); +const cTable = require("console.table"); +const libc = require("detect-libc"); +const { configureProxy } = require("axios-proxy-builder"); + +const error = (msg) => { + console.error(msg); + process.exit(1); +}; + +const { version } = require("./package.json"); +const name = "axolotlsay"; +const artifact_download_url = "https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1"; + +const builder_glibc_major_version = 2; +const builder_glibc_minor_version = 31; + +const supportedPlatforms = { + "aarch64-apple-darwin": { + "artifact_name": "axolotlsay-aarch64-apple-darwin.tar.gz", + "bins": ["axolotlsay"], + "zip_ext": ".tar.gz" + }, + "x86_64-apple-darwin": { + "artifact_name": "axolotlsay-x86_64-apple-darwin.tar.gz", + "bins": ["axolotlsay"], + "zip_ext": ".tar.gz" + }, + "x86_64-pc-windows-msvc": { + "artifact_name": "axolotlsay-x86_64-pc-windows-msvc.tar.gz", + "bins": ["axolotlsay.exe"], + "zip_ext": ".tar.gz" + }, + "x86_64-unknown-linux-gnu": { + "artifact_name": "axolotlsay-x86_64-unknown-linux-gnu.tar.gz", + "bins": ["axolotlsay"], + "zip_ext": ".tar.gz" + } +}; + +const getPlatform = () => { + const raw_os_type = os.type(); + const raw_architecture = os.arch(); + + // We want to use rust-style target triples as the canonical key + // for a platform, so translate the "os" library's concepts into rust ones + let os_type = ""; + switch (raw_os_type) { + case "Windows_NT": + os_type = "pc-windows-msvc"; + break; + case "Darwin": + os_type = "apple-darwin"; + break; + case "Linux": + os_type = "unknown-linux-gnu" + break; + } + + let arch = ""; + switch (raw_architecture) { + case "x64": + arch = "x86_64"; + break; + case "arm64": + arch = "aarch64"; + break; + } + + if (raw_os_type === "Linux") { + if (libc.familySync() == 'musl') { + os_type = "unknown-linux-musl-dynamic"; + } else if (libc.isNonGlibcLinuxSync()) { + console.warn("Your libc is neither glibc nor musl; trying static musl binary instead"); + os_type = "unknown-linux-musl-static"; + } else { + let libc_version = libc.versionSync(); + let split_libc_version = libc_version.split("."); + let libc_major_version = split_libc_version[0]; + let libc_minor_version = split_libc_version[1]; + if ( + libc_major_version != builder_glibc_major_version || + libc_minor_version < builder_glibc_minor_version + ) { + // We can't run the glibc binaries, but we can run the static musl ones + // if they exist + console.warn("Your glibc isn't compatible; trying static musl binary instead"); + os_type = "unknown-linux-musl-static"; + } + } + } + + // Assume the above succeeded and build a target triple to look things up with. + // If any of it failed, this lookup will fail and we'll handle it like normal. + let target_triple = `${arch}-${os_type}`; + let platform = supportedPlatforms[target_triple]; + + if (!platform) { + error( + `Platform with type "${raw_os_type}" and architecture "${raw_architecture}" is not supported by ${name}.\nYour system must be one of the following:\n\n${Object.keys(supportedPlatforms).join(",")}` + ); + } + + return platform; +}; + +const getBinary = () => { + const platform = getPlatform(); + const url = `${artifact_download_url}/${platform.artifact_name}`; + + if (platform.bins.length > 1) { + // Not yet supported + error("this app has multiple binaries, which isn't yet implemented"); + } + let binary = new Binary(platform.bins[0], url); + + return binary; +}; + +const install = (suppressLogs) => { + const binary = getBinary(); + const proxy = configureProxy(binary.url); + + return binary.install(proxy, suppressLogs); +}; + +const run = () => { + const binary = getBinary(); + binary.run(); +}; + +module.exports = { + install, + run, + getBinary, +}; + +================ npm-package.tar.gz/package/install.js ================ +#!/usr/bin/env node + +const { install } = require("./binary"); +install(false); + +================ npm-package.tar.gz/package/npm-shrinkwrap.json ================ +{ + "name": "axolotlsay", + "version": "0.2.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "axolotlsay", + "version": "0.2.1", + "license": "MIT OR Apache-2.0", + "hasInstallScript": true, + "dependencies": { + "axios-proxy-builder": "^0.1.1", + "binary-install": "^1.0.6", + "console.table": "^0.10.0", + "detect-libc": "^2.0.0" + }, + "bin": { + "rover": "run.js" + }, + "devDependencies": { + "prettier": "2.8.4" + }, + "engines": { + "node": ">=14", + "npm": ">=6" + } + }, + "node_modules/axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, + "node_modules/axios-proxy-builder": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/axios-proxy-builder/-/axios-proxy-builder-0.1.2.tgz", + "integrity": "sha512-6uBVsBZzkB3tCC8iyx59mCjQckhB8+GQrI9Cop8eC7ybIsvs/KtnNgEBfRMSEa7GqK2VBGUzgjNYMdPIfotyPA==", + "dependencies": { + "tunnel": "^0.0.6" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-install": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/binary-install/-/binary-install-1.0.6.tgz", + "integrity": "sha512-h3K4jaC4jEauK3csXI9GxGBJldkpuJlHCIBv8i+XBNhPuxnlERnD1PWVczQYDqvhJfv0IHUbB3lhDrZUMHvSgw==", + "dependencies": { + "axios": "^0.26.1", + "rimraf": "^3.0.2", + "tar": "^6.1.11" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "optional": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/console.table": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz", + "integrity": "sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==", + "dependencies": { + "easy-table": "1.1.0" + }, + "engines": { + "node": "> 0.10" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "optional": true, + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/easy-table": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz", + "integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==", + "optionalDependencies": { + "wcwidth": ">=1.0.1" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minipass": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", + "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/prettier": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tar": { + "version": "6.1.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.13.tgz", + "integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^4.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "optional": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} + +================ npm-package.tar.gz/package/package.json ================ +{ + "name": "axolotlsay", + "version": "0.2.1", + "description": "💬 a CLI for learning to distribute CLIs in rust", + "repository": "https://github.com/axodotdev/axolotlsay", + "license": "MIT OR Apache-2.0", + "author": "axodotdev ", + "bin": { + "axolotlsay": "run.js" + }, + "scripts": { + "postinstall": "node ./install.js", + "fmt": "prettier --write **/*.js", + "fmt:check": "prettier --check **/*.js" + }, + "engines": { + "node": ">=14", + "npm": ">=6" + }, + "volta": { + "node": "18.14.1", + "npm": "9.5.0" + }, + "dependencies": { + "axios-proxy-builder": "^0.1.1", + "binary-install": "^1.0.6", + "console.table": "^0.10.0", + "detect-libc": "^2.0.0" + }, + "devDependencies": { + "prettier": "2.8.4" + } +} + +================ npm-package.tar.gz/package/run.js ================ +#!/usr/bin/env node + +const { run, install: maybeInstall } = require("./binary"); +maybeInstall(true).then(run); + +================ dist-manifest.json ================ +{ + "dist_version": "CENSORED", + "announcement_tag": "v0.2.1", + "announcement_tag_is_implicit": true, + "announcement_is_prerelease": false, + "announcement_title": "Version 0.2.1", + "announcement_changelog": "```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```", + "announcement_github_body": "## Release Notes\n\n```text\n +--------------------------------------+\n | now with linux static musl binary!!! |\n +--------------------------------------+\n /\n≽(◕ ᴗ ◕)≼\n```\n\n## Install axolotlsay 0.2.1\n\n### Install prebuilt binaries via shell script\n\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh\n```\n\n### Install prebuilt binaries via powershell script\n\n```sh\npowershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"\n```\n\n### Install prebuilt binaries via Homebrew\n\n```sh\nbrew install axodotdev/homebrew-packages/axolotlsay\n```\n\n### Install prebuilt binaries into your npm project\n\n```sh\nnpm install axolotlsay@0.2.1\n```\n\n## Download axolotlsay 0.2.1\n\n| File | Platform | Checksum |\n|--------|----------|----------|\n| [axolotlsay-aarch64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-apple-darwin.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz) | Intel macOS | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256) |\n| [axolotlsay-x86_64-pc-windows-msvc.msi](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi) | x64 Windows | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-pc-windows-msvc.msi.sha256) |\n| [axolotlsay-x86_64-unknown-linux-gnu.tar.gz](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz) | x64 Linux | [checksum](https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256) |\n\n", + "releases": [ + { + "app_name": "axolotlsay", + "app_version": "0.2.1", + "artifacts": [ + "source.tar.gz", + "source.tar.gz.sha256", + "axolotlsay-installer.sh", + "axolotlsay-installer.ps1", + "axolotlsay.rb", + "axolotlsay-npm-package.tar.gz", + "axolotlsay-aarch64-apple-darwin.tar.gz", + "axolotlsay-aarch64-apple-darwin.tar.gz.sha256", + "axolotlsay-x86_64-apple-darwin.tar.gz", + "axolotlsay-x86_64-apple-darwin.tar.gz.sha256", + "axolotlsay-x86_64-pc-windows-msvc.tar.gz", + "axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256", + "axolotlsay-x86_64-pc-windows-msvc.msi", + "axolotlsay-x86_64-pc-windows-msvc.msi.sha256", + "axolotlsay-x86_64-unknown-linux-gnu.tar.gz", + "axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256" + ], + "hosting": { + "github": { + "artifact_download_url": "https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1" + } + } + } + ], + "artifacts": { + "axolotlsay-aarch64-apple-darwin.tar.gz": { + "name": "axolotlsay-aarch64-apple-darwin.tar.gz", + "kind": "executable-zip", + "target_triples": [ + "aarch64-apple-darwin" + ], + "assets": [ + { + "name": "CHANGELOG.md", + "path": "CHANGELOG.md", + "kind": "changelog" + }, + { + "name": "LICENSE-APACHE", + "path": "LICENSE-APACHE", + "kind": "license" + }, + { + "name": "LICENSE-MIT", + "path": "LICENSE-MIT", + "kind": "license" + }, + { + "name": "README.md", + "path": "README.md", + "kind": "readme" + }, + { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", + "name": "axolotlsay", + "path": "axolotlsay", + "kind": "executable" + } + ], + "checksum": "axolotlsay-aarch64-apple-darwin.tar.gz.sha256" + }, + "axolotlsay-aarch64-apple-darwin.tar.gz.sha256": { + "name": "axolotlsay-aarch64-apple-darwin.tar.gz.sha256", + "kind": "checksum", + "target_triples": [ + "aarch64-apple-darwin" + ] + }, + "axolotlsay-installer.ps1": { + "name": "axolotlsay-installer.ps1", + "kind": "installer", + "target_triples": [ + "x86_64-pc-windows-msvc" + ], + "install_hint": "powershell -c \"irm https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.ps1 | iex\"", + "description": "Install prebuilt binaries via powershell script" + }, + "axolotlsay-installer.sh": { + "name": "axolotlsay-installer.sh", + "kind": "installer", + "target_triples": [ + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "x86_64-unknown-linux-gnu" + ], + "install_hint": "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-installer.sh | sh", + "description": "Install prebuilt binaries via shell script" + }, + "axolotlsay-npm-package.tar.gz": { + "name": "axolotlsay-npm-package.tar.gz", + "kind": "installer", + "target_triples": [ + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu" + ], + "assets": [ + { + "name": ".gitignore", + "path": ".gitignore", + "kind": "unknown" + }, + { + "name": "CHANGELOG.md", + "path": "CHANGELOG.md", + "kind": "changelog" + }, + { + "name": "LICENSE-APACHE", + "path": "LICENSE-APACHE", + "kind": "license" + }, + { + "name": "LICENSE-MIT", + "path": "LICENSE-MIT", + "kind": "license" + }, + { + "name": "README.md", + "path": "README.md", + "kind": "readme" + }, + { + "name": "binary.js", + "path": "binary.js", + "kind": "unknown" + }, + { + "name": "install.js", + "path": "install.js", + "kind": "unknown" + }, + { + "name": "npm-shrinkwrap.json", + "path": "npm-shrinkwrap.json", + "kind": "unknown" + }, + { + "name": "package.json", + "path": "package.json", + "kind": "unknown" + }, + { + "name": "run.js", + "path": "run.js", + "kind": "unknown" + } + ], + "install_hint": "npm install axolotlsay@0.2.1", + "description": "Install prebuilt binaries into your npm project" + }, + "axolotlsay-x86_64-apple-darwin.tar.gz": { + "name": "axolotlsay-x86_64-apple-darwin.tar.gz", + "kind": "executable-zip", + "target_triples": [ + "x86_64-apple-darwin" + ], + "assets": [ + { + "name": "CHANGELOG.md", + "path": "CHANGELOG.md", + "kind": "changelog" + }, + { + "name": "LICENSE-APACHE", + "path": "LICENSE-APACHE", + "kind": "license" + }, + { + "name": "LICENSE-MIT", + "path": "LICENSE-MIT", + "kind": "license" + }, + { + "name": "README.md", + "path": "README.md", + "kind": "readme" + }, + { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", + "name": "axolotlsay", + "path": "axolotlsay", + "kind": "executable" + } + ], + "checksum": "axolotlsay-x86_64-apple-darwin.tar.gz.sha256" + }, + "axolotlsay-x86_64-apple-darwin.tar.gz.sha256": { + "name": "axolotlsay-x86_64-apple-darwin.tar.gz.sha256", + "kind": "checksum", + "target_triples": [ + "x86_64-apple-darwin" + ] + }, + "axolotlsay-x86_64-pc-windows-msvc.msi": { + "name": "axolotlsay-x86_64-pc-windows-msvc.msi", + "kind": "installer", + "target_triples": [ + "x86_64-pc-windows-msvc" + ], + "assets": [ + { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", + "name": "axolotlsay", + "path": "axolotlsay.exe", + "kind": "executable" + } + ], + "description": "install via msi", + "checksum": "axolotlsay-x86_64-pc-windows-msvc.msi.sha256" + }, + "axolotlsay-x86_64-pc-windows-msvc.msi.sha256": { + "name": "axolotlsay-x86_64-pc-windows-msvc.msi.sha256", + "kind": "checksum", + "target_triples": [ + "x86_64-pc-windows-msvc" + ] + }, + "axolotlsay-x86_64-pc-windows-msvc.tar.gz": { + "name": "axolotlsay-x86_64-pc-windows-msvc.tar.gz", + "kind": "executable-zip", + "target_triples": [ + "x86_64-pc-windows-msvc" + ], + "assets": [ + { + "name": "CHANGELOG.md", + "path": "CHANGELOG.md", + "kind": "changelog" + }, + { + "name": "LICENSE-APACHE", + "path": "LICENSE-APACHE", + "kind": "license" + }, + { + "name": "LICENSE-MIT", + "path": "LICENSE-MIT", + "kind": "license" + }, + { + "name": "README.md", + "path": "README.md", + "kind": "readme" + }, + { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", + "name": "axolotlsay", + "path": "axolotlsay.exe", + "kind": "executable" + } + ], + "checksum": "axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256" + }, + "axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256": { + "name": "axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256", + "kind": "checksum", + "target_triples": [ + "x86_64-pc-windows-msvc" + ] + }, + "axolotlsay-x86_64-unknown-linux-gnu.tar.gz": { + "name": "axolotlsay-x86_64-unknown-linux-gnu.tar.gz", + "kind": "executable-zip", + "target_triples": [ + "x86_64-unknown-linux-gnu" + ], + "assets": [ + { + "name": "CHANGELOG.md", + "path": "CHANGELOG.md", + "kind": "changelog" + }, + { + "name": "LICENSE-APACHE", + "path": "LICENSE-APACHE", + "kind": "license" + }, + { + "name": "LICENSE-MIT", + "path": "LICENSE-MIT", + "kind": "license" + }, + { + "name": "README.md", + "path": "README.md", + "kind": "readme" + }, + { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", + "name": "axolotlsay", + "path": "axolotlsay", + "kind": "executable" + } + ], + "checksum": "axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256" + }, + "axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256": { + "name": "axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256", + "kind": "checksum", + "target_triples": [ + "x86_64-unknown-linux-gnu" + ] + }, + "axolotlsay.rb": { + "name": "axolotlsay.rb", + "kind": "installer", + "target_triples": [ + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "x86_64-unknown-linux-gnu" + ], + "install_hint": "brew install axodotdev/homebrew-packages/axolotlsay", + "description": "Install prebuilt binaries via Homebrew" + }, + "source.tar.gz": { + "name": "source.tar.gz", + "kind": "source-tarball", + "checksum": "source.tar.gz.sha256" + }, + "source.tar.gz.sha256": { + "name": "source.tar.gz.sha256", + "kind": "checksum" + } + }, + "systems": { + "all:": { + "id": "all:", + "cargo_version_line": "CENSORED" + } + }, + "publish_prereleases": false, + "ci": { + "github": { + "artifacts_matrix": { + "include": [ + { + "targets": [ + "aarch64-apple-darwin" + ], + "runner": "macos-12", + "install_dist": "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/vSOME_VERSION/cargo-dist-installer.sh | sh", + "dist_args": "--artifacts=local --target=aarch64-apple-darwin" + }, + { + "targets": [ + "x86_64-apple-darwin" + ], + "runner": "macos-12", + "install_dist": "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/vSOME_VERSION/cargo-dist-installer.sh | sh", + "dist_args": "--artifacts=local --target=x86_64-apple-darwin" + }, + { + "targets": [ + "x86_64-pc-windows-msvc" + ], + "runner": "windows-2019", + "install_dist": "powershell -c \"irm https://github.com/axodotdev/cargo-dist/releases/download/vSOME_VERSION/cargo-dist-installer.ps1 | iex\"", + "dist_args": "--artifacts=local --target=x86_64-pc-windows-msvc" + }, + { + "targets": [ + "x86_64-unknown-linux-gnu" + ], + "runner": "ubuntu-20.04", + "install_dist": "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/vSOME_VERSION/cargo-dist-installer.sh | sh", + "dist_args": "--artifacts=local --target=x86_64-unknown-linux-gnu" + } + ] + }, + "pr_run_mode": "plan" + } + }, + "linkage": [] +} + +================ release.yml ================ +# Copyright 2022-2023, axodotdev +# SPDX-License-Identifier: MIT or Apache-2.0 +# +# CI that: +# +# * checks for a Git Tag that looks like a release +# * builds artifacts with cargo-dist (archives, installers, hashes) +# * uploads those artifacts to temporary workflow zip +# * on success, uploads the artifacts to a Github Release +# +# Note that the Github Release will be created with a generated +# title/body based on your changelogs. + +name: Release + +permissions: + contents: write + +# This task will run whenever you push a git tag that looks like a version +# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc. +# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where +# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION +# must be a Cargo-style SemVer Version (must have at least major.minor.patch). +# +# If PACKAGE_NAME is specified, then the announcement will be for that +# package (erroring out if it doesn't have the given version or isn't cargo-dist-able). +# +# If PACKAGE_NAME isn't specified, then the announcement will be for all +# (cargo-dist-able) packages in the workspace with that version (this mode is +# intended for workspaces with only one dist-able package, or with all dist-able +# packages versioned/released in lockstep). +# +# If you push multiple tags at once, separate instances of this workflow will +# spin up, creating an independent announcement for each one. However Github +# will hard limit this to 3 tags per commit, as it will assume more tags is a +# mistake. +# +# If there's a prerelease-style suffix to the version, then the release(s) +# will be marked as a prerelease. +on: + push: + tags: + - '**[0-9]+.[0-9]+.[0-9]+*' + pull_request: + +jobs: + # Run 'cargo dist plan' (or host) to determine what tasks we need to do + plan: + runs-on: ubuntu-latest + outputs: + val: ${{ steps.plan.outputs.manifest }} + tag: ${{ !github.event.pull_request && github.ref_name || '' }} + tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} + publishing: ${{ !github.event.pull_request }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + # we specify bash to get pipefail; it guards against the `curl` command + # failing. otherwise `sh` won't catch that `curl` returned non-0 + shell: bash + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/vSOME_VERSION/cargo-dist-installer.sh | sh" + # sure would be cool if github gave us proper conditionals... + # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible + # functionality based on whether this is a pull_request, and whether it's from a fork. + # (PRs run on the *source* but secrets are usually on the *target* -- that's *good* + # but also really annoying to build CI around when it needs secrets to work right.) + - id: plan + run: | + cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json + echo "cargo dist ran successfully" + cat plan-dist-manifest.json + echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT" + - name: "Upload dist-manifest.json" + uses: actions/upload-artifact@v4 + with: + name: artifacts-plan-dist-manifest + path: plan-dist-manifest.json + + # Build and packages all the platform-specific things + build-local-artifacts: + name: build-local-artifacts (${{ join(matrix.targets, ', ') }}) + # Let the initial task tell us to not run (currently very blunt) + needs: + - plan + if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }} + strategy: + fail-fast: false + # Target platforms/runners are computed by cargo-dist in create-release. + # Each member of the matrix has the following arguments: + # + # - runner: the github runner + # - dist-args: cli flags to pass to cargo dist + # - install-dist: expression to run to install cargo-dist on the runner + # + # Typically there will be: + # - 1 "global" task that builds universal installers + # - N "local" tasks that build each platform's binaries and platform-specific installers + matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }} + runs-on: ${{ matrix.runner }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: swatinem/rust-cache@v2 + - name: Install cargo-dist + run: ${{ matrix.install_dist }} + # Get the dist-manifest + - name: Fetch local artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: target/distrib/ + merge-multiple: true + - name: Install dependencies + run: | + ${{ matrix.packages_install }} + - name: Build artifacts + run: | + # Actually do builds and make zips and whatnot + cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json + echo "cargo dist ran successfully" + - id: cargo-dist + name: Post-build + # We force bash here just because github makes it really hard to get values up + # to "real" actions without writing to env-vars, and writing to env-vars has + # inconsistent syntax between shell and powershell. + shell: bash + run: | + # Parse out what we just built and upload it to scratch storage + echo "paths<> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + + cp dist-manifest.json "$BUILD_MANIFEST_NAME" + - name: "Upload artifacts" + uses: actions/upload-artifact@v4 + with: + name: artifacts-build-local-${{ join(matrix.targets, '_') }} + path: | + ${{ steps.cargo-dist.outputs.paths }} + ${{ env.BUILD_MANIFEST_NAME }} + + # Build and package all the platform-agnostic(ish) things + build-global-artifacts: + needs: + - plan + - build-local-artifacts + runs-on: "ubuntu-20.04" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + shell: bash + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/vSOME_VERSION/cargo-dist-installer.sh | sh" + # Get all the local artifacts for the global tasks to use (for e.g. checksums) + - name: Fetch local artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: target/distrib/ + merge-multiple: true + - id: cargo-dist + shell: bash + run: | + cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json + echo "cargo dist ran successfully" + + # Parse out what we just built and upload it to scratch storage + echo "paths<> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + + cp dist-manifest.json "$BUILD_MANIFEST_NAME" + - name: "Upload artifacts" + uses: actions/upload-artifact@v4 + with: + name: artifacts-build-global + path: | + ${{ steps.cargo-dist.outputs.paths }} + ${{ env.BUILD_MANIFEST_NAME }} + # Determines if we should publish/announce + host: + needs: + - plan + - build-local-artifacts + - build-global-artifacts + # Only run if we're "publishing", and only if local and global didn't fail (skipped is fine) + if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + runs-on: "ubuntu-20.04" + outputs: + val: ${{ steps.host.outputs.manifest }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install cargo-dist + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/vSOME_VERSION/cargo-dist-installer.sh | sh" + # Fetch artifacts from scratch-storage + - name: Fetch artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: target/distrib/ + merge-multiple: true + # This is a harmless no-op for Github Releases, hosting for that happens in "announce" + - id: host + shell: bash + run: | + cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json + echo "artifacts uploaded and released successfully" + cat dist-manifest.json + echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT" + - name: "Upload dist-manifest.json" + uses: actions/upload-artifact@v4 + with: + # Overwrite the previous copy + name: artifacts-dist-manifest + path: dist-manifest.json + + publish-homebrew-formula: + needs: + - plan + - host + runs-on: "ubuntu-20.04" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PLAN: ${{ needs.plan.outputs.val }} + GITHUB_USER: "axo bot" + GITHUB_EMAIL: "admin+bot@axo.dev" + if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }} + steps: + - uses: actions/checkout@v4 + with: + repository: "axodotdev/homebrew-packages" + token: ${{ secrets.HOMEBREW_TAP_TOKEN }} + # So we have access to the formula + - name: Fetch local artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: Formula/ + merge-multiple: true + # This is extra complex because you can make your Formula name not match your app name + # so we need to find releases with a *.rb file, and publish with that filename. + - name: Commit formula files + run: | + git config --global user.name "${GITHUB_USER}" + git config --global user.email "${GITHUB_EMAIL}" + + for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do + filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output) + name=$(echo "$filename" | sed "s/\.rb$//") + version=$(echo "$release" | jq .app_version --raw-output) + + git add "Formula/${filename}" + git commit -m "${name} ${version}" + done + git push + + # Create a Github Release while uploading all files to it + announce: + needs: + - plan + - host + - publish-homebrew-formula + # use "always() && ..." to allow us to wait for all publish jobs while + # still allowing individual publish jobs to skip themselves (for prereleases). + # "host" however must run to completion, no skipping allowed! + if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }} + runs-on: "ubuntu-20.04" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: "Download Github Artifacts" + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + path: artifacts + merge-multiple: true + - name: Cleanup + run: | + # Remove the granular manifests + rm -f artifacts/*-dist-manifest.json + - name: Create Github Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ needs.plan.outputs.tag }} + name: ${{ fromJson(needs.host.outputs.val).announcement_title }} + body: ${{ fromJson(needs.host.outputs.val).announcement_github_body }} + prerelease: ${{ fromJson(needs.host.outputs.val).announcement_is_prerelease }} + artifacts: "artifacts/*" + +================ main.wxs ================ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + + + + + + + + + + + + + + + + + + From fe2933f92bc50992127fa68b81c609a2c7fa20f0 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 17:24:17 -0400 Subject: [PATCH 16/24] chore: add lies test for axolotlsay (but use non-lies to start) --- cargo-dist/tests/integration-tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cargo-dist/tests/integration-tests.rs b/cargo-dist/tests/integration-tests.rs index ff01a5767..1742ba7ba 100644 --- a/cargo-dist/tests/integration-tests.rs +++ b/cargo-dist/tests/integration-tests.rs @@ -91,7 +91,7 @@ path-guid = "BFD25009-65A4-4D1E-97F1-0030465D90D6" let ci_result = ctx.cargo_dist_generate(test_name)?; let ci_snap = ci_result.check_all()?; // Do usual build+plan checks - let main_result = ctx.cargo_dist_build_and_plan(test_name)?; + let main_result = ctx.cargo_dist_build_lies_and_plan(test_name)?; let main_snap = main_result.check_all(ctx, ".cargo/bin/")?; // snapshot all main_snap.join(ci_snap).snap(); From 3fd8690af80c75a775b55bb4b827c2dad409765d Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 17:38:54 -0400 Subject: [PATCH 17/24] chore: enable lies in test --- cargo-dist/tests/gallery/dist.rs | 51 +++++----- cargo-dist/tests/integration-tests.rs | 4 +- .../snapshots/axolotlsay_basic_lies.snap | 92 +++++++++++++++++-- 3 files changed, 114 insertions(+), 33 deletions(-) diff --git a/cargo-dist/tests/gallery/dist.rs b/cargo-dist/tests/gallery/dist.rs index 0d99c90c1..751b728ae 100644 --- a/cargo-dist/tests/gallery/dist.rs +++ b/cargo-dist/tests/gallery/dist.rs @@ -133,10 +133,31 @@ pub struct Snapshots { } impl<'a> TestContext<'a, Tools> { - /// Run `cargo_dist_plan` and `cargo_dist_build_lies` - pub fn cargo_dist_build_lies_and_plan(&self, test_name: &str) -> Result { - let build = self.cargo_dist_build_lies(test_name)?; - let plan = self.cargo_dist_plan(test_name)?; + /// Run 'cargo dist build -alies --no-local-paths --output-format=json' and return paths to various files that were generated + pub fn cargo_dist_build_lies(&self, test_name: &str) -> Result { + // If the cargo-dist target dir exists, delete it to avoid cross-contamination + let out_path = Utf8Path::new("target/distrib/"); + if out_path.exists() { + LocalAsset::remove_dir_all(out_path)?; + } + + // build installers + eprintln!("running cargo dist build -aglobal..."); + let output = self.tools.cargo_dist.output_checked(|cmd| { + cmd.arg("dist") + .arg("build") + .arg("-alies") + .arg("--no-local-paths") + .arg("--output-format=json") + })?; + + let build = self.load_dist_results(test_name)?; + + let raw_json = String::from_utf8(output.stdout).expect("plan wasn't utf8!?"); + let plan = PlanResult { + test_name: test_name.to_owned(), + raw_json, + }; Ok(BuildAndPlanResult { build, plan }) } @@ -179,23 +200,6 @@ impl<'a> TestContext<'a, Tools> { self.load_dist_results(test_name) } - /// Run 'cargo dist build -alies' and return paths to various files that were generated - pub fn cargo_dist_build_lies(&self, test_name: &str) -> Result { - // If the cargo-dist target dir exists, delete it to avoid cross-contamination - let out_path = Utf8Path::new("target/distrib/"); - if out_path.exists() { - LocalAsset::remove_dir_all(out_path)?; - } - - // build installers - eprintln!("running cargo dist build -aglobal..."); - self.tools - .cargo_dist - .output_checked(|cmd| cmd.arg("dist").arg("build").arg("-alies"))?; - - self.load_dist_results(test_name) - } - /// Run 'cargo dist generate' and return paths to various files that were generated pub fn cargo_dist_generate(&self, test_name: &str) -> Result { self.cargo_dist_generate_prefixed(test_name, "") @@ -960,6 +964,9 @@ pub fn snapshot_settings_with_gallery_filter() -> insta::Settings { r"cargo-dist/releases/download/v\d+\.\d+\.\d+(\-prerelease\d*)?(\.\d+)?/", "cargo-dist/releases/download/vSOME_VERSION/", ); + settings.add_filter(r#"sha256 ".*""#, r#"sha256 "CENSORED""#); + settings.add_filter(r#""sha256": .*"#, r#""sha256": "CENSORED""#); + settings.add_filter(r#""sha512": .*"#, r#""sha512": "CENSORED""#); settings.add_filter(r#""version":"[a-zA-Z\.0-9\-]*""#, r#""version":"CENSORED""#); settings } @@ -994,6 +1001,8 @@ pub fn snapshot_settings_with_dist_manifest_filter() -> insta::Settings { r#""cargo_version_line": .*"#, r#""cargo_version_line": "CENSORED""#, ); + settings.add_filter(r#""sha256": .*"#, r#""sha256": "CENSORED""#); + settings.add_filter(r#""sha512": .*"#, r#""sha512": "CENSORED""#); settings } diff --git a/cargo-dist/tests/integration-tests.rs b/cargo-dist/tests/integration-tests.rs index 1742ba7ba..f3ee6d9c2 100644 --- a/cargo-dist/tests/integration-tests.rs +++ b/cargo-dist/tests/integration-tests.rs @@ -62,7 +62,6 @@ path-guid = "BFD25009-65A4-4D1E-97F1-0030465D90D6" }) } - #[test] fn axolotlsay_basic_lies() -> Result<(), miette::Report> { let test_name = _function_name!(); @@ -91,7 +90,7 @@ path-guid = "BFD25009-65A4-4D1E-97F1-0030465D90D6" let ci_result = ctx.cargo_dist_generate(test_name)?; let ci_snap = ci_result.check_all()?; // Do usual build+plan checks - let main_result = ctx.cargo_dist_build_lies_and_plan(test_name)?; + let main_result = ctx.cargo_dist_build_lies(test_name)?; let main_snap = main_result.check_all(ctx, ".cargo/bin/")?; // snapshot all main_snap.join(ci_snap).snap(); @@ -99,7 +98,6 @@ path-guid = "BFD25009-65A4-4D1E-97F1-0030465D90D6" }) } - #[test] fn axolotlsay_custom_formula() -> Result<(), miette::Report> { let test_name = _function_name!(); diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap index bacb6691f..f2b30dba1 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap @@ -835,14 +835,17 @@ class Axolotlsay < Formula on_macos do on_arm do url "https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-aarch64-apple-darwin.tar.gz" + sha256 "CENSORED" end on_intel do url "https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-apple-darwin.tar.gz" + sha256 "CENSORED" end end on_linux do on_intel do url "https://github.com/axodotdev/axolotlsay/releases/download/v0.2.1/axolotlsay-x86_64-unknown-linux-gnu.tar.gz" + sha256 "CENSORED" end end license "MIT OR Apache-2.0" @@ -2105,7 +2108,10 @@ maybeInstall(true).then(run); "kind": "executable" } ], - "checksum": "axolotlsay-aarch64-apple-darwin.tar.gz.sha256" + "checksum": "axolotlsay-aarch64-apple-darwin.tar.gz.sha256", + "checksums": { + "sha256": "CENSORED" + } }, "axolotlsay-aarch64-apple-darwin.tar.gz.sha256": { "name": "axolotlsay-aarch64-apple-darwin.tar.gz.sha256", @@ -2196,7 +2202,10 @@ maybeInstall(true).then(run); } ], "install_hint": "npm install axolotlsay@0.2.1", - "description": "Install prebuilt binaries into your npm project" + "description": "Install prebuilt binaries into your npm project", + "checksums": { + "sha256": "CENSORED" + } }, "axolotlsay-x86_64-apple-darwin.tar.gz": { "name": "axolotlsay-x86_64-apple-darwin.tar.gz", @@ -2232,7 +2241,10 @@ maybeInstall(true).then(run); "kind": "executable" } ], - "checksum": "axolotlsay-x86_64-apple-darwin.tar.gz.sha256" + "checksum": "axolotlsay-x86_64-apple-darwin.tar.gz.sha256", + "checksums": { + "sha256": "CENSORED" + } }, "axolotlsay-x86_64-apple-darwin.tar.gz.sha256": { "name": "axolotlsay-x86_64-apple-darwin.tar.gz.sha256", @@ -2256,7 +2268,10 @@ maybeInstall(true).then(run); } ], "description": "install via msi", - "checksum": "axolotlsay-x86_64-pc-windows-msvc.msi.sha256" + "checksum": "axolotlsay-x86_64-pc-windows-msvc.msi.sha256", + "checksums": { + "sha256": "CENSORED" + } }, "axolotlsay-x86_64-pc-windows-msvc.msi.sha256": { "name": "axolotlsay-x86_64-pc-windows-msvc.msi.sha256", @@ -2299,7 +2314,10 @@ maybeInstall(true).then(run); "kind": "executable" } ], - "checksum": "axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256" + "checksum": "axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256", + "checksums": { + "sha256": "CENSORED" + } }, "axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256": { "name": "axolotlsay-x86_64-pc-windows-msvc.tar.gz.sha256", @@ -2342,7 +2360,10 @@ maybeInstall(true).then(run); "kind": "executable" } ], - "checksum": "axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256" + "checksum": "axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256", + "checksums": { + "sha256": "CENSORED" + } }, "axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256": { "name": "axolotlsay-x86_64-unknown-linux-gnu.tar.gz.sha256", @@ -2365,7 +2386,10 @@ maybeInstall(true).then(run); "source.tar.gz": { "name": "source.tar.gz", "kind": "source-tarball", - "checksum": "source.tar.gz.sha256" + "checksum": "source.tar.gz.sha256", + "checksums": { + "sha256": "CENSORED" + } }, "source.tar.gz.sha256": { "name": "source.tar.gz.sha256", @@ -2373,11 +2397,61 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "lies:": { + "id": "lies:", "cargo_version_line": "CENSORED" } }, + "assets": { + "axolotlsay-aarch64-apple-darwin-axolotlsay": { + "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", + "name": "axolotlsay", + "system": "lies:", + "linkage": { + "other": [ + { + "path": "fakelib" + } + ] + } + }, + "axolotlsay-x86_64-apple-darwin-axolotlsay": { + "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", + "name": "axolotlsay", + "system": "lies:", + "linkage": { + "other": [ + { + "path": "fakelib" + } + ] + } + }, + "axolotlsay-x86_64-pc-windows-msvc-axolotlsay": { + "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", + "name": "axolotlsay", + "system": "lies:", + "linkage": { + "other": [ + { + "path": "fakelib" + } + ] + } + }, + "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay": { + "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", + "name": "axolotlsay", + "system": "lies:", + "linkage": { + "other": [ + { + "path": "fakelib" + } + ] + } + } + }, "publish_prereleases": false, "ci": { "github": { From f999c88c9e3cde0355bf32da009f095efd403ec3 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 13 Mar 2024 17:41:01 -0400 Subject: [PATCH 18/24] release: 0.12.0-prerelease.4 --- Cargo.lock | 4 ++-- cargo-dist-schema/Cargo.toml | 2 +- cargo-dist/Cargo.toml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dff2ebf12..81e144549 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -409,7 +409,7 @@ dependencies = [ [[package]] name = "cargo-dist" -version = "0.12.0-prerelease.3" +version = "0.12.0-prerelease.4" dependencies = [ "axoasset 0.8.0", "axocli", @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "cargo-dist-schema" -version = "0.12.0-prerelease.3" +version = "0.12.0-prerelease.4" dependencies = [ "camino", "gazenot", diff --git a/cargo-dist-schema/Cargo.toml b/cargo-dist-schema/Cargo.toml index e28937c47..f9b4be444 100644 --- a/cargo-dist-schema/Cargo.toml +++ b/cargo-dist-schema/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist-schema" description = "Schema information for cargo-dist's dist-manifest.json" -version = "0.12.0-prerelease.3" +version = "0.12.0-prerelease.4" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" diff --git a/cargo-dist/Cargo.toml b/cargo-dist/Cargo.toml index 909cca9bd..1bd28514c 100644 --- a/cargo-dist/Cargo.toml +++ b/cargo-dist/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist" description = "Shippable application packaging for Rust" -version = "0.12.0-prerelease.3" +version = "0.12.0-prerelease.4" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" @@ -34,7 +34,7 @@ axocli = { version = "0.2.0", optional = true } # Features used by the cli and library axotag = "0.1.0" -cargo-dist-schema = { version = "=0.12.0-prerelease.3", path = "../cargo-dist-schema" } +cargo-dist-schema = { version = "=0.12.0-prerelease.4", path = "../cargo-dist-schema" } axoasset = { version = "0.8.0", features = ["json-serde", "toml-serde", "toml-edit", "compression"] } axoprocess = { version = "0.2.0" } From 97107d85d4c8eeec3f1caea13113f75fc17fcf42 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 14 Mar 2024 10:28:06 -0400 Subject: [PATCH 19/24] fix: disable runtest_homebrew for lies hashes don't match github --- cargo-dist/tests/gallery/dist.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cargo-dist/tests/gallery/dist.rs b/cargo-dist/tests/gallery/dist.rs index 751b728ae..64bdf7300 100644 --- a/cargo-dist/tests/gallery/dist.rs +++ b/cargo-dist/tests/gallery/dist.rs @@ -104,6 +104,8 @@ impl Default for Tools { pub struct DistResult { test_name: String, + // Only used in some cfgs + trust_hashes: bool, shell_installer_path: Option, homebrew_installer_path: Option, powershell_installer_path: Option, @@ -151,7 +153,7 @@ impl<'a> TestContext<'a, Tools> { .arg("--output-format=json") })?; - let build = self.load_dist_results(test_name)?; + let build = self.load_dist_results(test_name, false)?; let raw_json = String::from_utf8(output.stdout).expect("plan wasn't utf8!?"); let plan = PlanResult { @@ -197,7 +199,7 @@ impl<'a> TestContext<'a, Tools> { .cargo_dist .output_checked(|cmd| cmd.arg("dist").arg("build").arg("-aglobal"))?; - self.load_dist_results(test_name) + self.load_dist_results(test_name, true) } /// Run 'cargo dist generate' and return paths to various files that were generated @@ -235,7 +237,7 @@ impl<'a> TestContext<'a, Tools> { }) } - fn load_dist_results(&self, test_name: &str) -> Result { + fn load_dist_results(&self, test_name: &str, trust_hashes: bool) -> Result { // read/analyze installers eprintln!("loading results..."); let app_name = &self.repo.app_name; @@ -248,6 +250,7 @@ impl<'a> TestContext<'a, Tools> { Ok(DistResult { test_name: test_name.to_owned(), + trust_hashes, shell_installer_path: sh_installer.exists().then_some(sh_installer), powershell_installer_path: ps_installer.exists().then_some(ps_installer), homebrew_installer_path: homebrew_installer, @@ -764,6 +767,11 @@ impl DistResult { // Runs the installer script in the system's Homebrew installation #[allow(unused_variables)] pub fn runtest_homebrew_installer(&self, ctx: &TestContext) -> Result<()> { + // Only do this if we trust hashes (outside cfg so the compiler knows we use this) + if !self.trust_hashes { + return Ok(()); + } + // Only do this on macOS, and only do it if RUIN_MY_COMPUTER_WITH_INSTALLERS is set #[cfg(target_os = "macos")] if std::env::var(ENV_RUIN_ME) From 3404b718a88322d2a5d2eb4d7a29c237fa37efc0 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 18 Mar 2024 16:00:11 -0400 Subject: [PATCH 20/24] chore: remove duplicate linkage type --- cargo-dist-schema/src/lib.rs | 17 ++ cargo-dist/src/build/mod.rs | 2 +- cargo-dist/src/linkage.rs | 409 ++++++++++++++--------------------- cargo-dist/src/main.rs | 4 +- 4 files changed, 179 insertions(+), 253 deletions(-) diff --git a/cargo-dist-schema/src/lib.rs b/cargo-dist-schema/src/lib.rs index f67c43f4e..c1df5c1e7 100644 --- a/cargo-dist-schema/src/lib.rs +++ b/cargo-dist-schema/src/lib.rs @@ -651,6 +651,23 @@ impl Linkage { } } +impl Library { + /// Make a new Library with the given path and no source + pub fn new(path: String) -> Self { + Self { path, source: None } + } +} + +impl std::fmt::Display for Library { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + if let Some(package) = &self.source { + write!(f, "{} ({package})", self.path) + } else { + write!(f, "{}", self.path) + } + } +} + /// Helper to read the raw version from serialized json fn dist_version(input: &str) -> Option { #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] diff --git a/cargo-dist/src/build/mod.rs b/cargo-dist/src/build/mod.rs index cf62555dd..08b6d22f0 100644 --- a/cargo-dist/src/build/mod.rs +++ b/cargo-dist/src/build/mod.rs @@ -187,7 +187,7 @@ impl BuildExpectations { }); linkage } else { - determine_linkage(src_path, target)?.to_schema() + determine_linkage(src_path, target)? }; let bin = dist.binary(src.idx); manifest.assets.insert( diff --git a/cargo-dist/src/linkage.rs b/cargo-dist/src/linkage.rs index 5fc05df9a..a6ddcc668 100644 --- a/cargo-dist/src/linkage.rs +++ b/cargo-dist/src/linkage.rs @@ -8,11 +8,10 @@ use std::{ use axoasset::SourceFile; use axoprocess::Cmd; use camino::Utf8PathBuf; -use cargo_dist_schema::DistManifest; +use cargo_dist_schema::{DistManifest, Library, Linkage}; use comfy_table::{presets::UTF8_FULL, Table}; use goblin::Object; use mach_object::{LoadCommand, OFile}; -use serde::{Deserialize, Serialize}; use crate::{config::Config, errors::*, gather_work, Artifact, DistGraph}; @@ -40,7 +39,7 @@ pub fn do_linkage(cfg: &Config, args: &LinkageArgs) -> Result<()> { if args.print_output { for report in &reports { - eprintln!("{}", report.report()); + eprintln!("{}", report_linkage(report)); } } if args.print_json { @@ -63,9 +62,7 @@ pub fn add_linkage_to_manifest( dist.dist_dir.clone(), )?; - manifest - .linkage - .extend(linkage.iter().map(|l| l.to_schema())); + manifest.linkage.extend(linkage); Ok(()) } @@ -105,253 +102,163 @@ fn fetch_linkage( Ok(reports) } -/// Information about dynamic libraries used by a binary -#[derive(Debug, Deserialize, Serialize)] -pub struct Linkage { - /// The filename of the binary - pub binary: String, - /// The target triple for which the binary was built - pub target: String, - /// Libraries included with the operating system - pub system: Vec, - /// Libraries provided by the Homebrew package manager - pub homebrew: Vec, - /// Public libraries not provided by the system and not managed by any package manager - pub public_unmanaged: Vec, - /// Libraries which don't fall into any other categories - pub other: Vec, - /// Frameworks, only used on macOS - pub frameworks: Vec, -} - -impl Linkage { - /// Formatted human-readable output - pub fn report(&self) -> String { - let mut table = Table::new(); - table - .load_preset(UTF8_FULL) - .set_header(vec!["Category", "Libraries"]) - .add_row(vec![ - "System", - self.system - .clone() - .into_iter() - .map(|l| l.to_string_pretty()) - .collect::>() - .join("\n") - .as_str(), - ]) - .add_row(vec![ - "Homebrew", - self.homebrew - .clone() - .into_iter() - .map(|l| l.to_string_pretty()) - .collect::>() - .join("\n") - .as_str(), - ]) - .add_row(vec![ - "Public (unmanaged)", - self.public_unmanaged - .clone() - .into_iter() - .map(|l| l.path) - .collect::>() - .join("\n") - .as_str(), - ]) - .add_row(vec![ - "Frameworks", - self.frameworks - .clone() - .into_iter() - .map(|l| l.path) - .collect::>() - .join("\n") - .as_str(), - ]) - .add_row(vec![ - "Other", - self.other - .clone() - .into_iter() - .map(|l| l.to_string_pretty()) - .collect::>() - .join("\n") - .as_str(), - ]); - - let s = format!( - r#"{} ({}): - -{table}"#, - self.binary, self.target, - ); - - s.to_owned() - } - - /// Construct a cargo_dist_schema::Linkage from a Linkage - pub fn to_schema(&self) -> cargo_dist_schema::Linkage { - cargo_dist_schema::Linkage { - binary: None, - target: None, - system: self.system.iter().map(|s| s.to_schema()).collect(), - homebrew: self.homebrew.iter().map(|s| s.to_schema()).collect(), - public_unmanaged: self - .public_unmanaged - .iter() - .map(|s| s.to_schema()) - .collect(), - other: self.other.iter().map(|s| s.to_schema()).collect(), - frameworks: self.frameworks.iter().map(|s| s.to_schema()).collect(), - } - } - - /// Constructs a Linkage from a cargo_dist_schema::Linkage - pub fn from_schema(other: &cargo_dist_schema::Linkage) -> Self { - Self { - binary: other.binary.clone().unwrap_or_default(), - target: other.target.clone().unwrap_or_default(), - system: other.system.iter().map(Library::from_schema).collect(), - homebrew: other.homebrew.iter().map(Library::from_schema).collect(), - public_unmanaged: other +/// Formatted human-readable output +pub fn report_linkage(linkage: &Linkage) -> String { + let mut table = Table::new(); + table + .load_preset(UTF8_FULL) + .set_header(vec!["Category", "Libraries"]) + .add_row(vec![ + "System", + linkage + .system + .clone() + .into_iter() + .map(|l| l.to_string()) + .collect::>() + .join("\n") + .as_str(), + ]) + .add_row(vec![ + "Homebrew", + linkage + .homebrew + .clone() + .into_iter() + .map(|l| l.to_string()) + .collect::>() + .join("\n") + .as_str(), + ]) + .add_row(vec![ + "Public (unmanaged)", + linkage .public_unmanaged - .iter() - .map(Library::from_schema) - .collect(), - other: other.other.iter().map(Library::from_schema).collect(), - frameworks: other.frameworks.iter().map(Library::from_schema).collect(), - } + .clone() + .into_iter() + .map(|l| l.path) + .collect::>() + .join("\n") + .as_str(), + ]) + .add_row(vec![ + "Frameworks", + linkage + .frameworks + .clone() + .into_iter() + .map(|l| l.path) + .collect::>() + .join("\n") + .as_str(), + ]) + .add_row(vec![ + "Other", + linkage + .other + .clone() + .into_iter() + .map(|l| l.to_string()) + .collect::>() + .join("\n") + .as_str(), + ]); + + use std::fmt::Write; + let mut output = String::new(); + if let (Some(bin), Some(target)) = (&linkage.binary, &linkage.target) { + writeln!(&mut output, "{} ({}):\n", bin, target).unwrap(); } + write!(&mut output, "{table}").unwrap(); + output } -/// Represents a dynamic library located somewhere on the system -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Library { - /// The path to the library; on platforms without that information, it will be a basename instead - pub path: String, - /// The package from which a library comes, if relevant - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, -} +/// Create a homebrew library for the given path +pub fn library_from_homebrew(library: String) -> Library { + // Doesn't currently support Homebrew installations in + // non-default locations + let brew_prefix = if library.starts_with("/opt/homebrew/opt/") { + Some("/opt/homebrew/opt/") + } else if library.starts_with("/usr/local/opt/") { + Some("/usr/local/opt/") + } else { + None + }; -impl Library { - fn new(library: String) -> Self { - Self { - path: library, - source: None, + if let Some(prefix) = brew_prefix { + let cloned = library.clone(); + let stripped = cloned.strip_prefix(prefix).unwrap(); + let mut package = stripped.split('/').next().unwrap().to_owned(); + + // The path alone isn't enough to determine the tap the formula + // came from. If the install receipt exists, we can use it to + // get the name of the source tap. + let receipt = Utf8PathBuf::from(&prefix) + .join(&package) + .join("INSTALL_RECEIPT.json"); + + // If the receipt doesn't exist or can't be loaded, that's not an + // error; we can fall back to the package basename we parsed out + // of the path. + if receipt.exists() { + let _ = SourceFile::load_local(&receipt) + .and_then(|file| file.deserialize_json()) + .map(|parsed: serde_json::Value| { + if let Some(tap) = parsed["source"]["tap"].as_str() { + if tap != "homebrew/core" { + package = format!("{tap}/{package}"); + } + } + }); } - } - fn to_schema(&self) -> cargo_dist_schema::Library { - cargo_dist_schema::Library { - path: self.path.clone(), - source: self.source.clone(), + Library { + path: library, + source: Some(package.to_owned()), } - } - - fn from_schema(other: &cargo_dist_schema::Library) -> Self { - Self { - path: other.path.clone(), - source: other.source.clone(), + } else { + Library { + path: library, + source: None, } } +} - fn from_homebrew(library: String) -> Self { - // Doesn't currently support Homebrew installations in - // non-default locations - let brew_prefix = if library.starts_with("/opt/homebrew/opt/") { - Some("/opt/homebrew/opt/") - } else if library.starts_with("/usr/local/opt/") { - Some("/usr/local/opt/") - } else { - None - }; - - if let Some(prefix) = brew_prefix { - let cloned = library.clone(); - let stripped = cloned.strip_prefix(prefix).unwrap(); - let mut package = stripped.split('/').nth(0).unwrap().to_owned(); - - // The path alone isn't enough to determine the tap the formula - // came from. If the install receipt exists, we can use it to - // get the name of the source tap. - let receipt = Utf8PathBuf::from(&prefix) - .join(&package) - .join("INSTALL_RECEIPT.json"); - - // If the receipt doesn't exist or can't be loaded, that's not an - // error; we can fall back to the package basename we parsed out - // of the path. - if receipt.exists() { - let _ = SourceFile::load_local(&receipt) - .and_then(|file| file.deserialize_json()) - .map(|parsed: serde_json::Value| { - if let Some(tap) = parsed["source"]["tap"].as_str() { - if tap != "homebrew/core" { - package = format!("{tap}/{package}"); - } - } - }); - } - - Self { - path: library, - source: Some(package.to_owned()), - } - } else { - Self { - path: library, - source: None, - } - } +/// Create an apt library for the given path +pub fn library_from_apt(library: String) -> DistResult { + // We can't get this information on other OSs + if std::env::consts::OS != "linux" { + return Ok(Library { + path: library, + source: None, + }); } - fn maybe_apt(library: String) -> DistResult { - // We can't get this information on other OSs - if std::env::consts::OS != "linux" { - return Ok(Self { - path: library, - source: None, - }); - } - - let process = Cmd::new("dpkg", "get linkage info from dpkg") - .arg("--search") - .arg(&library) - .output(); - match process { - Ok(output) => { - let output = String::from_utf8(output.stdout)?; - - let package = output.split(':').nth(0).unwrap(); - let source = if package.is_empty() { - None - } else { - Some(package.to_owned()) - }; + let process = Cmd::new("dpkg", "get linkage info from dpkg") + .arg("--search") + .arg(&library) + .output(); + match process { + Ok(output) => { + let output = String::from_utf8(output.stdout)?; + + let package = output.split(':').next().unwrap(); + let source = if package.is_empty() { + None + } else { + Some(package.to_owned()) + }; - Ok(Self { - path: library, - source, - }) - } - // Couldn't find a package for this file - Err(_) => Ok(Self { + Ok(Library { path: library, - source: None, - }), - } - } - - fn to_string_pretty(&self) -> String { - if let Some(package) = &self.source { - format!("{} ({package})", self.path).to_owned() - } else { - self.path.clone() + source, + }) } + // Couldn't find a package for this file + Err(_) => Ok(Library { + path: library, + source: None, + }), } } @@ -472,35 +379,37 @@ pub fn determine_linkage(path: &Utf8PathBuf, target: &str) -> DistResult Result<(), std::io::Erro fn print_human_linkage(out: &mut Term, report: &DistManifest) -> Result<(), std::io::Error> { for linkage in &report.linkage { - writeln!(out, "{}", Linkage::from_schema(linkage).report())?; + writeln!(out, "{}", linkage::report_linkage(linkage))?; } Ok(()) From a30d6742ebebebf739880e52f15c350f63537b36 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 18 Mar 2024 17:50:02 -0400 Subject: [PATCH 21/24] chore: remove last vestiges of old linkage note that the linkage field remains on dist-manifest to avoid breaking old users of cargo-dist-schema who do not think the linkage field is ever optional. this can be migrated away over time. --- cargo-dist-schema/src/lib.rs | 16 +-- cargo-dist/src/build/mod.rs | 1 + cargo-dist/src/lib.rs | 4 - cargo-dist/src/linkage.rs | 103 ++++++++++-------- cargo-dist/src/main.rs | 8 +- .../snapshots/axolotlsay_basic_lies.snap | 12 ++ 6 files changed, 77 insertions(+), 67 deletions(-) diff --git a/cargo-dist-schema/src/lib.rs b/cargo-dist-schema/src/lib.rs index c1df5c1e7..c4354c212 100644 --- a/cargo-dist-schema/src/lib.rs +++ b/cargo-dist-schema/src/lib.rs @@ -116,6 +116,12 @@ pub struct AssetInfo { pub name: String, /// the system it was built on pub system: SystemId, + /// rust-style target triples the Asset natively supports + /// + /// * length 0: not a meaningful question, maybe some static file + /// * length 1: typical of binaries + /// * length 2+: some kind of universal binary + pub target_triples: Vec, /// the linkage of this Asset pub linkage: Option, } @@ -590,14 +596,6 @@ impl Hosting { /// Information about dynamic libraries used by a binary #[derive(Clone, Default, Debug, Deserialize, Serialize, JsonSchema)] pub struct Linkage { - /// The filename of the binary - #[serde(default)] - #[serde(skip_serializing_if = "Option::is_none")] - pub binary: Option, - /// The target triple for which the binary was built - #[serde(default)] - #[serde(skip_serializing_if = "Option::is_none")] - pub target: Option, /// Libraries included with the operating system #[serde(default)] #[serde(skip_serializing_if = "SortedSet::is_empty")] @@ -634,8 +632,6 @@ impl Linkage { /// merge another linkage into this one pub fn extend(&mut self, val: &Linkage) { let Linkage { - binary: _, - target: _, system, homebrew, public_unmanaged, diff --git a/cargo-dist/src/build/mod.rs b/cargo-dist/src/build/mod.rs index 08b6d22f0..ccd0fb1f9 100644 --- a/cargo-dist/src/build/mod.rs +++ b/cargo-dist/src/build/mod.rs @@ -197,6 +197,7 @@ impl BuildExpectations { name: bin.name.clone(), system: dist.system_id.clone(), linkage: Some(linkage), + target_triples: vec![target.clone()], }, ); Ok(()) diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index c07e80340..ad5a60ce5 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -85,10 +85,6 @@ pub fn do_build(cfg: &Config) -> Result { } } - // Compute linkage data now that we've done all builds - // TODO(#848): delete this line to remove the old linkage system - linkage::add_linkage_to_manifest(cfg, &dist, &mut manifest)?; - // Next the global steps for step in &dist.global_build_steps { if dist.local_builds_are_lies { diff --git a/cargo-dist/src/linkage.rs b/cargo-dist/src/linkage.rs index a6ddcc668..989a6b91d 100644 --- a/cargo-dist/src/linkage.rs +++ b/cargo-dist/src/linkage.rs @@ -8,7 +8,7 @@ use std::{ use axoasset::SourceFile; use axoprocess::Cmd; use camino::Utf8PathBuf; -use cargo_dist_schema::{DistManifest, Library, Linkage}; +use cargo_dist_schema::{AssetInfo, DistManifest, Library, Linkage}; use comfy_table::{presets::UTF8_FULL, Table}; use goblin::Object; use mach_object::{LoadCommand, OFile}; @@ -28,56 +28,41 @@ pub struct LinkageArgs { /// Determinage dynamic linkage of built artifacts (impl of `cargo dist linkage`) pub fn do_linkage(cfg: &Config, args: &LinkageArgs) -> Result<()> { - let (dist, _manifest) = gather_work(cfg)?; - - let reports: Vec = if let Some(target) = args.from_json.clone() { + let manifest = if let Some(target) = args.from_json.clone() { let file = SourceFile::load_local(target)?; file.deserialize_json()? } else { - fetch_linkage(cfg.targets.clone(), dist.artifacts, dist.dist_dir)? + let (dist, mut manifest) = gather_work(cfg)?; + compute_linkage_assuming_local_build(&dist, &mut manifest, cfg)?; + manifest }; if args.print_output { - for report in &reports { - eprintln!("{}", report_linkage(report)); - } + eprintln!("{}", LinkageDisplay(&manifest)); } if args.print_json { - let j = serde_json::to_string(&reports).unwrap(); - println!("{}", j); + let string = serde_json::to_string_pretty(&manifest).unwrap(); + println!("{string}"); } - Ok(()) } -/// Compute the linkage of local builds and add them to the DistManifest -pub fn add_linkage_to_manifest( - cfg: &Config, +/// Assuming someone just ran `cargo dist build` on the current machine, +/// compute the linkage by checking binaries in the temp to-be-zipped dirs. +fn compute_linkage_assuming_local_build( dist: &DistGraph, manifest: &mut DistManifest, -) -> Result<()> { - let linkage = fetch_linkage( - cfg.targets.clone(), - dist.artifacts.clone(), - dist.dist_dir.clone(), - )?; - - manifest.linkage.extend(linkage); - Ok(()) -} - -fn fetch_linkage( - targets: Vec, - artifacts: Vec, - dist_dir: Utf8PathBuf, -) -> DistResult> { - let mut reports = vec![]; + cfg: &Config, +) -> DistResult<()> { + let targets = &cfg.targets; + let artifacts = &dist.artifacts; + let dist_dir = &dist.dist_dir; for target in targets { let artifacts: Vec = artifacts .clone() .into_iter() - .filter(|r| r.target_triples.contains(&target)) + .filter(|r| r.target_triples.contains(target)) .collect(); if artifacts.is_empty() { @@ -88,22 +73,55 @@ fn fetch_linkage( for artifact in artifacts { let path = Utf8PathBuf::from(&dist_dir).join(format!("{}-{target}", artifact.id)); - for (_, binary) in artifact.required_binaries { - let bin_path = path.join(binary); + for (bin_idx, binary_relpath) in artifact.required_binaries { + let bin = dist.binary(bin_idx); + let bin_path = path.join(binary_relpath); if !bin_path.exists() { eprintln!("Binary {bin_path} missing; skipping check"); } else { - reports.push(determine_linkage(&bin_path, &target)?); + let linkage = determine_linkage(&bin_path, target)?; + manifest.assets.insert( + bin.id.clone(), + AssetInfo { + id: bin.id.clone(), + name: bin.name.clone(), + system: dist.system_id.clone(), + linkage: Some(linkage), + target_triples: vec![target.clone()], + }, + ); } } } } - Ok(reports) + Ok(()) +} + +/// Formatter for a DistManifest that prints the linkage human-readably +pub struct LinkageDisplay<'a>(pub &'a DistManifest); + +impl std::fmt::Display for LinkageDisplay<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + for asset in self.0.assets.values() { + let Some(linkage) = &asset.linkage else { + continue; + }; + let name = &asset.name; + let targets = asset.target_triples.join(", "); + write!(f, "{name}")?; + if !targets.is_empty() { + write!(f, " ({targets})")?; + } + writeln!(f, "\n")?; + format_linkage_table(f, linkage)?; + } + Ok(()) + } } /// Formatted human-readable output -pub fn report_linkage(linkage: &Linkage) -> String { +fn format_linkage_table(f: &mut std::fmt::Formatter<'_>, linkage: &Linkage) -> std::fmt::Result { let mut table = Table::new(); table .load_preset(UTF8_FULL) @@ -163,14 +181,7 @@ pub fn report_linkage(linkage: &Linkage) -> String { .join("\n") .as_str(), ]); - - use std::fmt::Write; - let mut output = String::new(); - if let (Some(bin), Some(target)) = (&linkage.binary, &linkage.target) { - writeln!(&mut output, "{} ({}):\n", bin, target).unwrap(); - } - write!(&mut output, "{table}").unwrap(); - output + write!(f, "{table}") } /// Create a homebrew library for the given path @@ -379,8 +390,6 @@ pub fn determine_linkage(path: &Utf8PathBuf, target: &str) -> DistResult Result<(), std::io::Erro } fn print_human_linkage(out: &mut Term, report: &DistManifest) -> Result<(), std::io::Error> { - for linkage in &report.linkage { - writeln!(out, "{}", linkage::report_linkage(linkage))?; - } - - Ok(()) + writeln!(out, "{}", LinkageDisplay(report)) } fn cmd_build(cli: &Cli, args: &BuildArgs) -> Result<(), miette::Report> { diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap index f2b30dba1..4d45f628f 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap @@ -2407,6 +2407,9 @@ maybeInstall(true).then(run); "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", "system": "lies:", + "target_triples": [ + "aarch64-apple-darwin" + ], "linkage": { "other": [ { @@ -2419,6 +2422,9 @@ maybeInstall(true).then(run); "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", "system": "lies:", + "target_triples": [ + "x86_64-apple-darwin" + ], "linkage": { "other": [ { @@ -2431,6 +2437,9 @@ maybeInstall(true).then(run); "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", "system": "lies:", + "target_triples": [ + "x86_64-pc-windows-msvc" + ], "linkage": { "other": [ { @@ -2443,6 +2452,9 @@ maybeInstall(true).then(run); "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", "system": "lies:", + "target_triples": [ + "x86_64-unknown-linux-gnu" + ], "linkage": { "other": [ { From f3dd1aa6ff0e379657b4241c977ee077e30b9e53 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Mon, 18 Mar 2024 18:13:40 -0400 Subject: [PATCH 22/24] chore: regenerate snapshot --- .../snapshots/cargo_dist_schema__emit.snap | 24 +++++++----------- .../snapshots/axolotlsay_basic_lies.snap | 25 +++++++++++++++++-- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap b/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap index 4c3f41c71..8926a8d74 100644 --- a/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap +++ b/cargo-dist-schema/src/snapshots/cargo_dist_schema__emit.snap @@ -466,7 +466,8 @@ expression: json_schema "required": [ "id", "name", - "system" + "system", + "target_triples" ], "properties": { "id": { @@ -491,6 +492,13 @@ expression: json_schema "system": { "description": "the system it was built on", "type": "string" + }, + "target_triples": { + "description": "rust-style target triples the Asset natively supports\n\n* length 0: not a meaningful question, maybe some static file * length 1: typical of binaries * length 2+: some kind of universal binary", + "type": "array", + "items": { + "type": "string" + } } } }, @@ -661,13 +669,6 @@ expression: json_schema "description": "Information about dynamic libraries used by a binary", "type": "object", "properties": { - "binary": { - "description": "The filename of the binary", - "type": [ - "string", - "null" - ] - }, "frameworks": { "description": "Frameworks, only used on macOS", "type": "array", @@ -707,13 +708,6 @@ expression: json_schema "$ref": "#/definitions/Library" }, "uniqueItems": true - }, - "target": { - "description": "The target triple for which the binary was built", - "type": [ - "string", - "null" - ] } } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap index 4d45f628f..f6f688ade 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap @@ -78,7 +78,6 @@ download_binary_and_run_installer() { need_cmd mkdir need_cmd rm need_cmd tar - need_cmd which need_cmd grep need_cmd cat @@ -323,6 +322,17 @@ install() { else err "could not find your CARGO_HOME or HOME dir to install binaries to" fi + + # ...ignoring all of the above, if the user asked us to completely override + # those choices and use a specified directory, then pick that now + if [ -n "${CARGO_DIST_FORCE_INSTALL_DIR:-}" ]; then + _install_home="$CARGO_DIST_FORCE_INSTALL_DIR" + _install_dir="$CARGO_DIST_FORCE_INSTALL_DIR/bin" + _env_script_path="$CARGO_DIST_FORCE_INSTALL_DIR/env" + _install_dir_expr="$_install_dir" + _env_script_path_expr="$_env_script_path" + fi + # Replace the temporary cargo home with the calculated one RECEIPT=$(echo "$RECEIPT" | sed "s,AXO_CARGO_HOME,$_install_dir,") @@ -1068,6 +1078,12 @@ function Invoke-Installer($bin_paths) { $dest_dir = Join-Path $root "bin" + # ...ignoring all of the above, if the user asked us to completely override + # those choices and use a specified directory, then pick that now + if (($env:CARGO_DIST_FORCE_INSTALL_DIR)) { + $dest_dir = Join-Path $env:CARGO_DIST_FORCE_INSTALL_DIR "bin" + } + # The replace call here ensures proper escaping is inlined into the receipt $receipt = $receipt.Replace('AXO_CARGO_HOME', $dest_dir.replace("\", "\\")) @@ -1089,7 +1105,12 @@ function Invoke-Installer($bin_paths) { # Write the install receipt $null = New-Item -Path $receipt_home -ItemType "directory" -ErrorAction SilentlyContinue - Out-File -FilePath $receipt_home/axolotlsay-receipt.json -InputObject $receipt -Encoding utf8 + # Trying to get Powershell 5.1 (not 6+, which is fake and lies) to write utf8 is a crime + # because "Out-File -Encoding utf8" actually still means utf8BOM, so we need to pull out + # .NET's APIs which actually do what you tell them (also apparently utf8NoBOM is the + # default in newer .NETs but I'd rather not rely on that at this point). + $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False + [IO.File]::WriteAllLines("$receipt_home/axolotlsay-receipt.json", "$receipt", $Utf8NoBomEncoding) Write-Information "Everything's installed!" if (-not $NoModifyPath) { From 2f138cfb8f2fc957541338621c673121de0567ae Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Tue, 19 Mar 2024 10:40:05 -0400 Subject: [PATCH 23/24] chore: address review feedback --- cargo-dist/src/build/mod.rs | 10 ++++++++++ cargo-dist/src/config.rs | 15 +++++++++++++++ cargo-dist/src/lib.rs | 1 + cargo-dist/src/main.rs | 19 ++++++++++++++++--- cargo-dist/src/manifest.rs | 6 ++++++ cargo-dist/src/tasks.rs | 7 ++++++- .../tests/snapshots/akaikatana_basic.snap | 4 ++-- .../tests/snapshots/akaikatana_musl.snap | 4 ++-- .../akaikatana_repo_with_dot_git.snap | 4 ++-- .../tests/snapshots/akaikatana_updaters.snap | 4 ++-- .../tests/snapshots/axolotlsay_abyss.snap | 4 ++-- .../snapshots/axolotlsay_abyss_only.snap | 4 ++-- .../tests/snapshots/axolotlsay_basic.snap | 4 ++-- .../snapshots/axolotlsay_basic_lies.snap | 12 ++++++------ .../snapshots/axolotlsay_custom_formula.snap | 4 ++-- .../axolotlsay_custom_github_runners.snap | 4 ++-- .../tests/snapshots/axolotlsay_dispatch.snap | 4 ++-- .../snapshots/axolotlsay_dispatch_abyss.snap | 4 ++-- .../axolotlsay_dispatch_abyss_only.snap | 4 ++-- .../snapshots/axolotlsay_edit_existing.snap | 4 ++-- .../tests/snapshots/axolotlsay_musl.snap | 4 ++-- .../snapshots/axolotlsay_musl_no_gnu.snap | 4 ++-- .../axolotlsay_no_homebrew_publish.snap | 4 ++-- .../tests/snapshots/axolotlsay_no_locals.snap | 4 ++-- .../axolotlsay_no_locals_but_custom.snap | 4 ++-- .../axolotlsay_ssldotcom_windows_sign.snap | 4 ++-- ...xolotlsay_ssldotcom_windows_sign_prod.snap | 4 ++-- .../snapshots/axolotlsay_tag_namespace.snap | 4 ++-- .../tests/snapshots/axolotlsay_updaters.snap | 4 ++-- .../axolotlsay_user_global_build_job.snap | 4 ++-- .../snapshots/axolotlsay_user_host_job.snap | 4 ++-- .../axolotlsay_user_local_build_job.snap | 4 ++-- .../snapshots/axolotlsay_user_plan_job.snap | 4 ++-- .../axolotlsay_user_publish_job.snap | 4 ++-- .../snapshots/install_path_cargo_home.snap | 4 ++-- .../snapshots/install_path_env_no_subdir.snap | 4 ++-- .../snapshots/install_path_env_subdir.snap | 4 ++-- .../install_path_env_subdir_space.snap | 4 ++-- .../install_path_env_subdir_space_deeper.snap | 4 ++-- .../install_path_home_subdir_deeper.snap | 4 ++-- .../install_path_home_subdir_min.snap | 4 ++-- .../install_path_home_subdir_space.snap | 4 ++-- ...install_path_home_subdir_space_deeper.snap | 4 ++-- cargo-dist/tests/snapshots/lib_manifest.snap | 4 ++-- .../tests/snapshots/lib_manifest_slash.snap | 4 ++-- cargo-dist/tests/snapshots/manifest.snap | 4 ++-- 46 files changed, 138 insertions(+), 88 deletions(-) diff --git a/cargo-dist/src/build/mod.rs b/cargo-dist/src/build/mod.rs index ccd0fb1f9..999344965 100644 --- a/cargo-dist/src/build/mod.rs +++ b/cargo-dist/src/build/mod.rs @@ -83,12 +83,22 @@ impl BuildExpectations { /// /// This subroutine is responsible for sorting out whether we care about the binary, /// and if the maybe_symbols are in fact symbols we care about. + /// + /// NOTE: it is correct/expected to hand this a bunch of random paths to things + /// that vaguely might be what we want, assuming it knows how to pick the right ones out. pub fn found_bin( &mut self, pkg_id: String, src_path: Utf8PathBuf, maybe_symbols: Vec, ) { + // NOTE: its expected for these early returns to trigger. It's this functions + // jobs to sort through build outputs and grab the ones we actually care about. + // + // For instance if you build a cargo workspace (something we prefer for stability + // of feature resolution), this can produce a bunch of binaries for examples or + // packages you don't care about, which cargo/rustc will happily report back to us, + // and we need to be aware enough to throw those irrelevant results out. info!("got a new binary: {}", src_path); // lookup the package diff --git a/cargo-dist/src/config.rs b/cargo-dist/src/config.rs index 191211c70..1eabfa6e8 100644 --- a/cargo-dist/src/config.rs +++ b/cargo-dist/src/config.rs @@ -607,6 +607,8 @@ pub struct Config { pub installers: Vec, /// The (git) tag to use for this Announcement. pub announcement_tag: Option, + /// What command was being invoked here, used for SystemIds + pub root_cmd: String, } /// How we should select the artifacts to build @@ -1065,6 +1067,19 @@ pub enum HostStyle { Announce, } +impl std::fmt::Display for HostStyle { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let string = match self { + HostStyle::Check => "check", + HostStyle::Create => "create", + HostStyle::Upload => "upload", + HostStyle::Release => "release", + HostStyle::Announce => "announce", + }; + string.fmt(f) + } +} + /// Packages to install before build from the system package manager #[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] pub struct SystemDependencies { diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index ad5a60ce5..552ff9946 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -633,6 +633,7 @@ pub fn check_integrity(cfg: &Config) -> Result<()> { ci: vec![], installers: vec![], announcement_tag: None, + root_cmd: "check".to_owned(), }; let (dist, _manifest) = tasks::gather_work(&check_config)?; diff --git a/cargo-dist/src/main.rs b/cargo-dist/src/main.rs index 6d6ccc7cb..f6ddd4360 100644 --- a/cargo-dist/src/main.rs +++ b/cargo-dist/src/main.rs @@ -197,6 +197,7 @@ fn cmd_build(cli: &Cli, args: &BuildArgs) -> Result<(), miette::Report> { ci: cli.ci.iter().map(|ci| ci.to_lib()).collect(), installers: cli.installer.iter().map(|ins| ins.to_lib()).collect(), announcement_tag: cli.tag.clone(), + root_cmd: "build".to_owned(), }; let report = do_build(&config)?; print( @@ -208,6 +209,16 @@ fn cmd_build(cli: &Cli, args: &BuildArgs) -> Result<(), miette::Report> { } fn cmd_host(cli: &Cli, args: &HostArgs) -> Result<(), miette::Report> { + let args = cargo_dist::config::HostArgs { + steps: args.steps.iter().map(|m| m.to_lib()).collect(), + }; + // host can be invoked on multiple machines, so use arg keys to disambiguate + let arg_key = args + .steps + .iter() + .map(|s| s.to_string()) + .collect::>() + .join(","); let config = cargo_dist::config::Config { needs_coherent_announcement_tag: true, create_hosting: false, @@ -218,11 +229,9 @@ fn cmd_host(cli: &Cli, args: &HostArgs) -> Result<(), miette::Report> { ci: cli.ci.iter().map(|ci| ci.to_lib()).collect(), installers: cli.installer.iter().map(|ins| ins.to_lib()).collect(), announcement_tag: cli.tag.clone(), + root_cmd: format!("host:{arg_key}"), }; - let args = cargo_dist::config::HostArgs { - steps: args.steps.iter().map(|m| m.to_lib()).collect(), - }; let report = cargo_dist::host::do_host(&config, args)?; print(cli, &report, false, Some("host")) } @@ -238,6 +247,7 @@ fn cmd_manifest(cli: &Cli, args: &ManifestArgs) -> Result<(), miette::Report> { ci: cli.ci.iter().map(|ci| ci.to_lib()).collect(), installers: cli.installer.iter().map(|ins| ins.to_lib()).collect(), announcement_tag: cli.tag.clone(), + root_cmd: "plan".to_owned(), }; let report = do_manifest(&config)?; print(cli, &report, false, Some("manifest")) @@ -269,6 +279,7 @@ fn cmd_init(cli: &Cli, args: &InitArgs) -> Result<(), miette::Report> { ci: cli.ci.iter().map(|ci| ci.to_lib()).collect(), installers: cli.installer.iter().map(|ins| ins.to_lib()).collect(), announcement_tag: cli.tag.clone(), + root_cmd: "init".to_owned(), }; let args = cargo_dist::InitArgs { yes: args.yes, @@ -290,6 +301,7 @@ fn cmd_generate(cli: &Cli, args: &GenerateArgs) -> Result<(), miette::Report> { ci: cli.ci.iter().map(|ci| ci.to_lib()).collect(), installers: cli.installer.iter().map(|ins| ins.to_lib()).collect(), announcement_tag: cli.tag.clone(), + root_cmd: "generate".to_owned(), }; let args = cargo_dist::GenerateArgs { check: args.check, @@ -309,6 +321,7 @@ fn cmd_linkage(cli: &Cli, args: &LinkageArgs) -> Result<(), miette::Report> { ci: cli.ci.iter().map(|ci| ci.to_lib()).collect(), installers: cli.installer.iter().map(|ins| ins.to_lib()).collect(), announcement_tag: cli.tag.clone(), + root_cmd: "linkage".to_owned(), }; let mut options = cargo_dist::linkage::LinkageArgs { print_output: args.print_output, diff --git a/cargo-dist/src/manifest.rs b/cargo-dist/src/manifest.rs index bb8cfe57f..74623dfb0 100644 --- a/cargo-dist/src/manifest.rs +++ b/cargo-dist/src/manifest.rs @@ -124,6 +124,12 @@ pub(crate) fn load_and_merge_manifests( }; // Just merge all the system-specific info + if systems.keys().any(|k| output.systems.contains_key(k)) { + // for now i'm making this only a warning, since the data loss would + // be relatively minor, and crashing someone's release process because + // we might grab the wrong toolchain info is a bit too rude. + warn!("!!! duplicate system keys, platforms may get conflated !!!"); + } output.systems.extend(systems); output.assets.extend(assets); output.linkage.extend(linkage); diff --git a/cargo-dist/src/tasks.rs b/cargo-dist/src/tasks.rs index defd73610..69c6915b0 100644 --- a/cargo-dist/src/tasks.rs +++ b/cargo-dist/src/tasks.rs @@ -2831,7 +2831,12 @@ pub fn gather_work(cfg: &Config) -> Result<(DistGraph, DistManifest)> { info!("analyzing workspace:"); let tools = tool_info()?; let workspace = crate::config::get_project()?; - let system_id = format!("{}:{}", cfg.artifact_mode, cfg.targets.join(",")); + let system_id = format!( + "{}:{}:{}", + cfg.root_cmd, + cfg.artifact_mode, + cfg.targets.join(",") + ); let mut graph = DistGraphBuilder::new( system_id, tools, diff --git a/cargo-dist/tests/snapshots/akaikatana_basic.snap b/cargo-dist/tests/snapshots/akaikatana_basic.snap index 8af056919..6ae9bbead 100644 --- a/cargo-dist/tests/snapshots/akaikatana_basic.snap +++ b/cargo-dist/tests/snapshots/akaikatana_basic.snap @@ -1492,8 +1492,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/akaikatana_musl.snap b/cargo-dist/tests/snapshots/akaikatana_musl.snap index 786e96b34..41bc7fd6d 100644 --- a/cargo-dist/tests/snapshots/akaikatana_musl.snap +++ b/cargo-dist/tests/snapshots/akaikatana_musl.snap @@ -1086,8 +1086,8 @@ download_binary_and_run_installer "$@" || exit 1 } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/akaikatana_repo_with_dot_git.snap b/cargo-dist/tests/snapshots/akaikatana_repo_with_dot_git.snap index 8af056919..6ae9bbead 100644 --- a/cargo-dist/tests/snapshots/akaikatana_repo_with_dot_git.snap +++ b/cargo-dist/tests/snapshots/akaikatana_repo_with_dot_git.snap @@ -1492,8 +1492,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/akaikatana_updaters.snap b/cargo-dist/tests/snapshots/akaikatana_updaters.snap index 65fe0f765..7d2293c61 100644 --- a/cargo-dist/tests/snapshots/akaikatana_updaters.snap +++ b/cargo-dist/tests/snapshots/akaikatana_updaters.snap @@ -1540,8 +1540,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_abyss.snap b/cargo-dist/tests/snapshots/axolotlsay_abyss.snap index f94ad3f17..bc4b01027 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_abyss.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_abyss.snap @@ -2417,8 +2417,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap b/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap index b43a5559e..b7c1e4631 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_abyss_only.snap @@ -2413,8 +2413,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic.snap b/cargo-dist/tests/snapshots/axolotlsay_basic.snap index 5204b29d8..56ab39ccd 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic.snap @@ -2409,8 +2409,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap index f6f688ade..89b4eb082 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap @@ -2418,8 +2418,8 @@ maybeInstall(true).then(run); } }, "systems": { - "lies:": { - "id": "lies:", + "build:lies:": { + "id": "build:lies:", "cargo_version_line": "CENSORED" } }, @@ -2427,7 +2427,7 @@ maybeInstall(true).then(run); "axolotlsay-aarch64-apple-darwin-axolotlsay": { "id": "axolotlsay-aarch64-apple-darwin-axolotlsay", "name": "axolotlsay", - "system": "lies:", + "system": "build:lies:", "target_triples": [ "aarch64-apple-darwin" ], @@ -2442,7 +2442,7 @@ maybeInstall(true).then(run); "axolotlsay-x86_64-apple-darwin-axolotlsay": { "id": "axolotlsay-x86_64-apple-darwin-axolotlsay", "name": "axolotlsay", - "system": "lies:", + "system": "build:lies:", "target_triples": [ "x86_64-apple-darwin" ], @@ -2457,7 +2457,7 @@ maybeInstall(true).then(run); "axolotlsay-x86_64-pc-windows-msvc-axolotlsay": { "id": "axolotlsay-x86_64-pc-windows-msvc-axolotlsay", "name": "axolotlsay", - "system": "lies:", + "system": "build:lies:", "target_triples": [ "x86_64-pc-windows-msvc" ], @@ -2472,7 +2472,7 @@ maybeInstall(true).then(run); "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay": { "id": "axolotlsay-x86_64-unknown-linux-gnu-axolotlsay", "name": "axolotlsay", - "system": "lies:", + "system": "build:lies:", "target_triples": [ "x86_64-unknown-linux-gnu" ], diff --git a/cargo-dist/tests/snapshots/axolotlsay_custom_formula.snap b/cargo-dist/tests/snapshots/axolotlsay_custom_formula.snap index 708673893..8cb8035cd 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_custom_formula.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_custom_formula.snap @@ -276,8 +276,8 @@ end } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_custom_github_runners.snap b/cargo-dist/tests/snapshots/axolotlsay_custom_github_runners.snap index 058deaab5..c302f1238 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_custom_github_runners.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_custom_github_runners.snap @@ -218,8 +218,8 @@ expression: self.payload } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_dispatch.snap b/cargo-dist/tests/snapshots/axolotlsay_dispatch.snap index ad6df6d26..4f290a9ee 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_dispatch.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_dispatch.snap @@ -218,8 +218,8 @@ expression: self.payload } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss.snap b/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss.snap index 8de155039..c56efc39b 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss.snap @@ -226,8 +226,8 @@ expression: self.payload } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss_only.snap b/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss_only.snap index 9631b61c3..95000179b 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss_only.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_dispatch_abyss_only.snap @@ -222,8 +222,8 @@ expression: self.payload } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap b/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap index 14e562369..fea46c899 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_edit_existing.snap @@ -2383,8 +2383,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_musl.snap b/cargo-dist/tests/snapshots/axolotlsay_musl.snap index 7410cd512..9dda59de3 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_musl.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_musl.snap @@ -1981,8 +1981,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap b/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap index 5dadda95c..438a373e7 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_musl_no_gnu.snap @@ -1934,8 +1934,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap b/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap index 4fee80da9..4ed2c5e1d 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_no_homebrew_publish.snap @@ -2383,8 +2383,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_no_locals.snap b/cargo-dist/tests/snapshots/axolotlsay_no_locals.snap index 1f528c27a..6e6975a67 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_no_locals.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_no_locals.snap @@ -218,8 +218,8 @@ expression: self.payload } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_no_locals_but_custom.snap b/cargo-dist/tests/snapshots/axolotlsay_no_locals_but_custom.snap index 3546ed5a8..2f50c938e 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_no_locals_but_custom.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_no_locals_but_custom.snap @@ -218,8 +218,8 @@ expression: self.payload } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap index 956d32356..fadd67b3d 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign.snap @@ -1454,8 +1454,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap index 3b44d8052..79a4c239e 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_ssldotcom_windows_sign_prod.snap @@ -1454,8 +1454,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_tag_namespace.snap b/cargo-dist/tests/snapshots/axolotlsay_tag_namespace.snap index c5df9e1ed..1b62f9264 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_tag_namespace.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_tag_namespace.snap @@ -218,8 +218,8 @@ expression: self.payload } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_updaters.snap b/cargo-dist/tests/snapshots/axolotlsay_updaters.snap index 0db5d2643..6ec319175 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_updaters.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_updaters.snap @@ -2457,8 +2457,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap index 60a76956a..23b9d47c4 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_global_build_job.snap @@ -2383,8 +2383,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap index ef3248be4..9301ee0fe 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_host_job.snap @@ -2383,8 +2383,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap index 88967616f..af71438c6 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_local_build_job.snap @@ -2383,8 +2383,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap index dc2617596..7c3ea8771 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_plan_job.snap @@ -2383,8 +2383,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap b/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap index 5d3301a32..d639ae37c 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_user_publish_job.snap @@ -2383,8 +2383,8 @@ maybeInstall(true).then(run); } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/install_path_cargo_home.snap b/cargo-dist/tests/snapshots/install_path_cargo_home.snap index 15c6bfd7a..2f4abab09 100644 --- a/cargo-dist/tests/snapshots/install_path_cargo_home.snap +++ b/cargo-dist/tests/snapshots/install_path_cargo_home.snap @@ -1486,8 +1486,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap b/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap index d894f96e9..d7bc827d1 100644 --- a/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap +++ b/cargo-dist/tests/snapshots/install_path_env_no_subdir.snap @@ -1462,8 +1462,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir.snap b/cargo-dist/tests/snapshots/install_path_env_subdir.snap index 2cb5211f5..1d02a972d 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir.snap @@ -1462,8 +1462,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap b/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap index 7c8dcc18b..a7c4312bc 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir_space.snap @@ -1462,8 +1462,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap b/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap index c2081d8fe..a791f8bc2 100644 --- a/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_env_subdir_space_deeper.snap @@ -1462,8 +1462,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap index 55972c9db..e0c6b414f 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_deeper.snap @@ -1462,8 +1462,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap index 358810aca..b489b6379 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_min.snap @@ -1462,8 +1462,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap index d74a314cf..76148746b 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_space.snap @@ -1462,8 +1462,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap b/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap index 06e3403d9..1a7660486 100644 --- a/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap +++ b/cargo-dist/tests/snapshots/install_path_home_subdir_space_deeper.snap @@ -1462,8 +1462,8 @@ try { } }, "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/lib_manifest.snap b/cargo-dist/tests/snapshots/lib_manifest.snap index 93c5ad256..a11fb3092 100644 --- a/cargo-dist/tests/snapshots/lib_manifest.snap +++ b/cargo-dist/tests/snapshots/lib_manifest.snap @@ -31,8 +31,8 @@ stdout: } ], "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/lib_manifest_slash.snap b/cargo-dist/tests/snapshots/lib_manifest_slash.snap index 417d0aaee..513a1951a 100644 --- a/cargo-dist/tests/snapshots/lib_manifest_slash.snap +++ b/cargo-dist/tests/snapshots/lib_manifest_slash.snap @@ -31,8 +31,8 @@ stdout: } ], "systems": { - "all:": { - "id": "all:", + "plan:all:": { + "id": "plan:all:", "cargo_version_line": "CENSORED" } }, diff --git a/cargo-dist/tests/snapshots/manifest.snap b/cargo-dist/tests/snapshots/manifest.snap index 3dc111206..b467415c1 100644 --- a/cargo-dist/tests/snapshots/manifest.snap +++ b/cargo-dist/tests/snapshots/manifest.snap @@ -406,8 +406,8 @@ stdout: } }, "systems": { - "lies:": { - "id": "lies:", + "plan:lies:": { + "id": "plan:lies:", "cargo_version_line": "CENSORED" } }, From aace90461dfa1cf5f91c109d06e5d2e420fb3ce7 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Thu, 21 Mar 2024 13:54:15 -0400 Subject: [PATCH 24/24] chore: address review and regen snapshots --- cargo-dist/src/build/fake.rs | 11 +++---- .../snapshots/axolotlsay_basic_lies.snap | 31 ++++++++++++++----- .../axolotlsay_homebrew_packages.snap | 18 ++++++++--- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/cargo-dist/src/build/fake.rs b/cargo-dist/src/build/fake.rs index 175c2c5bc..8c604e289 100644 --- a/cargo-dist/src/build/fake.rs +++ b/cargo-dist/src/build/fake.rs @@ -4,6 +4,7 @@ //! without needing to actually run platform-specific builds use axoasset::LocalAsset; +use camino::Utf8PathBuf; use cargo_dist_schema::DistManifest; use crate::{BinaryIdx, CargoBuildStep, DistGraph, DistResult, GenericBuildStep}; @@ -39,13 +40,9 @@ fn build_fake_binaries( binaries: &[BinaryIdx], ) -> DistResult<()> { // Shove these in a temp dir inside the dist dir, where it's safe for us to do whatever - let tempdir = dist.dist_dir.join("_fake_tmp"); - // Clear out old files (files we need get copied out by the time this function returns) - if tempdir.exists() { - LocalAsset::remove_dir_all(&tempdir)?; - } - LocalAsset::create_dir_all(&tempdir)?; - + let tmp = temp_dir::TempDir::new()?; + let tempdir = + Utf8PathBuf::from_path_buf(tmp.path().to_owned()).expect("temp_dir made non-utf8 path!?"); let mut expectations = BuildExpectations::new_fake(dist, binaries); for idx in binaries { diff --git a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap index 89b4eb082..f8280f9e9 100644 --- a/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap +++ b/cargo-dist/tests/snapshots/axolotlsay_basic_lies.snap @@ -28,7 +28,7 @@ PRINT_VERBOSE=${INSTALLER_PRINT_VERBOSE:-0} PRINT_QUIET=${INSTALLER_PRINT_QUIET:-0} NO_MODIFY_PATH=${INSTALLER_NO_MODIFY_PATH:-0} read -r RECEIPT <> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME" @@ -2634,7 +2642,7 @@ jobs: # Parse out what we just built and upload it to scratch storage echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" + jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" cp dist-manifest.json "$BUILD_MANIFEST_NAME"