diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml index 849d1e06b..6db4f0094 100644 --- a/.github/workflows/publish-crates.yml +++ b/.github/workflows/publish-crates.yml @@ -31,7 +31,7 @@ jobs: - run: cargo publish -p axoproject --token ${CRATES_TOKEN} env: CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} - - run: cargo publish -p cargo-dist-schema --token ${CRATES_TOKEN} + - run: cargo publish -p dist-schema --token ${CRATES_TOKEN} env: CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} - run: cargo publish -p dist --token ${CRATES_TOKEN} diff --git a/Cargo.lock b/Cargo.lock index adc2880af..057204201 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -378,20 +378,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cargo-dist-schema" -version = "0.26.1" -dependencies = [ - "camino", - "gazenot", - "insta", - "schemars", - "semver", - "serde", - "serde_json", - "target-lexicon", -] - [[package]] name = "cargo-platform" version = "0.1.8" @@ -803,7 +789,6 @@ dependencies = [ "base64", "blake2", "camino", - "cargo-dist-schema", "cargo-wix", "cargo_metadata", "clap", @@ -813,6 +798,7 @@ dependencies = [ "console", "current_platform", "dialoguer", + "dist-schema", "flate2", "gazenot", "goblin", @@ -840,6 +826,20 @@ dependencies = [ "uuid", ] +[[package]] +name = "dist-schema" +version = "0.26.1" +dependencies = [ + "camino", + "gazenot", + "insta", + "schemars", + "semver", + "serde", + "serde_json", + "target-lexicon", +] + [[package]] name = "dyn-clone" version = "1.0.17" diff --git a/Cargo.toml b/Cargo.toml index a54576235..df327c22a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ rust-version = "1.74" [workspace.dependencies] # intra-workspace deps (you need to bump these versions when you cut releases too! -cargo-dist-schema = { version = "=0.26.1", path = "cargo-dist-schema" } +dist-schema = { version = "=0.26.1", path = "cargo-dist-schema" } axoproject = { version = "=0.26.1", path = "axoproject", default-features = false, features = ["cargo-projects", "generic-projects", "npm-projects"] } # first-party deps diff --git a/cargo-dist-schema/Cargo.toml b/cargo-dist-schema/Cargo.toml index 37bea8b2d..f13cc2a87 100644 --- a/cargo-dist-schema/Cargo.toml +++ b/cargo-dist-schema/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "cargo-dist-schema" +name = "dist-schema" description = "Schema information for cargo-dist's dist-manifest.json" version.workspace = true edition.workspace = true diff --git a/cargo-dist/Cargo.toml b/cargo-dist/Cargo.toml index 34d30a72c..e671e1362 100644 --- a/cargo-dist/Cargo.toml +++ b/cargo-dist/Cargo.toml @@ -35,7 +35,7 @@ axocli.workspace = true axoupdater.workspace = true # Features used by the cli and library -cargo-dist-schema.workspace = true +dist-schema.workspace = true axoproject.workspace = true axotag.workspace = true diff --git a/cargo-dist/src/announce.rs b/cargo-dist/src/announce.rs index b08c6fc53..dbe56d9f6 100644 --- a/cargo-dist/src/announce.rs +++ b/cargo-dist/src/announce.rs @@ -90,7 +90,7 @@ use std::fmt::Display; use axoproject::PackageIdx; use axotag::{parse_tag, Package, PartialAnnouncementTag, ReleaseType}; -use cargo_dist_schema::{DistManifest, GithubHosting, TripleName, TripleNameRef}; +use dist_schema::{DistManifest, GithubHosting, TripleName, TripleNameRef}; use itertools::Itertools; use semver::Version; use tracing::info; @@ -884,9 +884,9 @@ pub fn announcement_github(manifest: &mut DistManifest) { for (_name, artifact) in manifest.artifacts_for_release(release) { match artifact.kind { - cargo_dist_schema::ArtifactKind::ExecutableZip => bundles.push(artifact), - cargo_dist_schema::ArtifactKind::Symbols => symbols.push(artifact), - cargo_dist_schema::ArtifactKind::Installer => { + dist_schema::ArtifactKind::ExecutableZip => bundles.push(artifact), + dist_schema::ArtifactKind::Symbols => symbols.push(artifact), + dist_schema::ArtifactKind::Installer => { if let (Some(desc), Some(hint)) = (&artifact.description, &artifact.install_hint) { @@ -895,10 +895,10 @@ pub fn announcement_github(manifest: &mut DistManifest) { local_installers.push(artifact); } } - cargo_dist_schema::ArtifactKind::Checksum => { + dist_schema::ArtifactKind::Checksum => { // Do Nothing (will be included with the artifact it checksums) } - cargo_dist_schema::ArtifactKind::Unknown => { + dist_schema::ArtifactKind::Unknown => { // Do nothing } _ => { @@ -1022,7 +1022,7 @@ fn sortable_triple(triple: &TripleNameRef) -> Vec { #[cfg(test)] mod tests { - use cargo_dist_schema::TripleNameRef; + use dist_schema::TripleNameRef; use super::sortable_triple; #[test] diff --git a/cargo-dist/src/backend/ci/github.rs b/cargo-dist/src/backend/ci/github.rs index 9661ecf28..220796cc2 100644 --- a/cargo-dist/src/backend/ci/github.rs +++ b/cargo-dist/src/backend/ci/github.rs @@ -7,7 +7,7 @@ use std::collections::BTreeMap; use axoasset::{LocalAsset, SourceFile}; use axoprocess::Cmd; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ +use dist_schema::{ target_lexicon::{self, Architecture, OperatingSystem, Triple}, AptPackageName, ChocolateyPackageName, ContainerImageRef, GhaRunStep, GithubGlobalJobConfig, GithubLocalJobConfig, GithubMatrix, GithubRunnerConfig, GithubRunnerRef, GithubRunners, @@ -66,9 +66,9 @@ pub struct GithubCiInfo { /// Trigger releases on pushes to this branch instead of ci pub release_branch: Option, /// Matrix for upload-local-artifacts - pub artifacts_matrix: cargo_dist_schema::GithubMatrix, + pub artifacts_matrix: dist_schema::GithubMatrix, /// What kind of job to run on pull request - pub pr_run_mode: cargo_dist_schema::PrRunMode, + pub pr_run_mode: dist_schema::PrRunMode, /// global task pub global_task: GithubGlobalJobConfig, /// homebrew tap @@ -222,7 +222,7 @@ impl GithubCiInfo { let mut dependencies = SystemDependencies::default(); let caching_could_be_profitable = - release_branch.is_some() || pr_run_mode == cargo_dist_schema::PrRunMode::Upload; + release_branch.is_some() || pr_run_mode == dist_schema::PrRunMode::Upload; let cache_builds = cache_builds.unwrap_or(caching_could_be_profitable); let need_cargo_auditable = dist.config.builds.cargo.cargo_auditable; @@ -679,7 +679,7 @@ fn cargo_xwin() -> GithubRunnerConfig { GithubRunnerConfig { runner: GithubRunnerRef::from_str("ubuntu-20.04").to_owned(), host: targets::TARGET_X64_LINUX_GNU.to_owned(), - container: Some(cargo_dist_schema::ContainerConfig { + container: Some(dist_schema::ContainerConfig { image: ContainerImageRef::from_str("messense/cargo-xwin").to_owned(), host: targets::TARGET_X64_LINUX_MUSL.to_owned(), package_manager: None, @@ -743,7 +743,7 @@ fn system_deps_install_script( // apt-using runners. if rc.container.is_none() || rc.container.as_ref().and_then(|c| c.package_manager) - == Some(cargo_dist_schema::PackageManager::Apt) + == Some(dist_schema::PackageManager::Apt) { for (name, pkg) in &packages.apt { if !pkg.0.stage_wanted(&DependencyKind::Build) { diff --git a/cargo-dist/src/backend/ci/mod.rs b/cargo-dist/src/backend/ci/mod.rs index be0cef280..bd1d06d76 100644 --- a/cargo-dist/src/backend/ci/mod.rs +++ b/cargo-dist/src/backend/ci/mod.rs @@ -1,6 +1,6 @@ //! Support for generating CI scripts for running dist -use cargo_dist_schema::{ +use dist_schema::{ target_lexicon::{OperatingSystem, Triple}, DashScript, GhaRunStep, PowershellScript, }; @@ -101,7 +101,7 @@ impl DistInstallSettings<'_> { } let version = self.version; - let format = cargo_dist_schema::format_of_version(version); + let format = dist_schema::format_of_version(version); let installer_name = if format.unsupported() { // FIXME: we should probably do this check way higher up and produce a proper err... panic!("requested dist v{version}, which is not supported by the this copy of dist ({SELF_DIST_VERSION})"); diff --git a/cargo-dist/src/backend/installer/homebrew.rs b/cargo-dist/src/backend/installer/homebrew.rs index 9e7172d36..288edf47c 100644 --- a/cargo-dist/src/backend/installer/homebrew.rs +++ b/cargo-dist/src/backend/installer/homebrew.rs @@ -1,7 +1,7 @@ //! Code for generating formula.rb use axoasset::LocalAsset; -use cargo_dist_schema::{ChecksumValue, DistManifest, HomebrewPackageName}; +use dist_schema::{ChecksumValue, DistManifest, HomebrewPackageName}; use serde::Serialize; use spdx::{ expression::{ExprNode, Operator}, diff --git a/cargo-dist/src/backend/installer/mod.rs b/cargo-dist/src/backend/installer/mod.rs index e3a9299c7..090c42a8d 100644 --- a/cargo-dist/src/backend/installer/mod.rs +++ b/cargo-dist/src/backend/installer/mod.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use camino::Utf8PathBuf; -use cargo_dist_schema::{ArtifactId, EnvironmentVariables, Hosting, TripleName}; +use dist_schema::{ArtifactId, EnvironmentVariables, Hosting, TripleName}; use homebrew::HomebrewFragments; use macpkg::PkgInstallerInfo; use serde::Serialize; diff --git a/cargo-dist/src/backend/installer/msi.rs b/cargo-dist/src/backend/installer/msi.rs index 706e6969e..c26df2f2b 100644 --- a/cargo-dist/src/backend/installer/msi.rs +++ b/cargo-dist/src/backend/installer/msi.rs @@ -2,7 +2,7 @@ use axoasset::{toml_edit, LocalAsset}; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::TripleName; +use dist_schema::TripleName; use tracing::info; use wix::print::{wxs::WxsRenders, RenderOutput}; diff --git a/cargo-dist/src/backend/installer/npm.rs b/cargo-dist/src/backend/installer/npm.rs index 2f019acf3..0520309b4 100644 --- a/cargo-dist/src/backend/installer/npm.rs +++ b/cargo-dist/src/backend/installer/npm.rs @@ -2,7 +2,7 @@ use axoasset::{LocalAsset, SourceFile}; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ArtifactId, GlibcVersion, TripleName}; +use dist_schema::{ArtifactId, GlibcVersion, TripleName}; use serde::Serialize; use super::InstallerInfo; diff --git a/cargo-dist/src/backend/installer/shell.rs b/cargo-dist/src/backend/installer/shell.rs index d005d1ce4..d24a28e9d 100644 --- a/cargo-dist/src/backend/installer/shell.rs +++ b/cargo-dist/src/backend/installer/shell.rs @@ -1,7 +1,7 @@ //! Code for generating installer.sh use axoasset::LocalAsset; -use cargo_dist_schema::DistManifest; +use dist_schema::DistManifest; use crate::{backend::templates::TEMPLATE_INSTALLER_SH, errors::DistResult, DistGraph}; diff --git a/cargo-dist/src/build/cargo.rs b/cargo-dist/src/build/cargo.rs index c3d0be405..06f1dfde8 100644 --- a/cargo-dist/src/build/cargo.rs +++ b/cargo-dist/src/build/cargo.rs @@ -4,8 +4,8 @@ use std::env; use axoprocess::Cmd; use axoproject::WorkspaceIdx; -use cargo_dist_schema::target_lexicon::{Architecture, Environment, Triple}; -use cargo_dist_schema::{DistManifest, TripleName}; +use dist_schema::target_lexicon::{Architecture, Environment, Triple}; +use dist_schema::{DistManifest, TripleName}; use miette::{Context, IntoDiagnostic}; use tracing::warn; @@ -272,7 +272,7 @@ pub fn build_cargo_target( } let auditable = dist_graph.config.builds.cargo.cargo_auditable; - let host = cargo_dist_schema::target_lexicon::HOST; + let host = dist_schema::target_lexicon::HOST; let mut command = make_build_cargo_target_command(&host, &cargo.cmd, &rustflags, step, auditable)?; diff --git a/cargo-dist/src/build/fake.rs b/cargo-dist/src/build/fake.rs index bb9c5e96b..ccf778856 100644 --- a/cargo-dist/src/build/fake.rs +++ b/cargo-dist/src/build/fake.rs @@ -5,7 +5,7 @@ use axoasset::LocalAsset; use camino::Utf8PathBuf; -use cargo_dist_schema::DistManifest; +use dist_schema::DistManifest; use crate::{BinaryIdx, CargoBuildStep, DistGraph, DistResult, GenericBuildStep}; diff --git a/cargo-dist/src/build/generic.rs b/cargo-dist/src/build/generic.rs index 169bccd72..c69bd66b7 100644 --- a/cargo-dist/src/build/generic.rs +++ b/cargo-dist/src/build/generic.rs @@ -5,7 +5,7 @@ use std::{env, process::ExitStatus}; use axoprocess::Cmd; use axoproject::WorkspaceIdx; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{DistManifest, TripleName, TripleNameRef}; +use dist_schema::{DistManifest, TripleName, TripleNameRef}; use crate::{ build::{package_id_string, BuildExpectations}, diff --git a/cargo-dist/src/build/mod.rs b/cargo-dist/src/build/mod.rs index 388e49e56..71c36baed 100644 --- a/cargo-dist/src/build/mod.rs +++ b/cargo-dist/src/build/mod.rs @@ -2,7 +2,7 @@ use axoproject::PackageId; use camino::Utf8PathBuf; -use cargo_dist_schema::{AssetInfo, DistManifest, TripleNameRef}; +use dist_schema::{AssetInfo, DistManifest, TripleNameRef}; use tracing::info; use crate::{ @@ -207,8 +207,8 @@ impl BuildExpectations { // 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 { + let mut linkage = dist_schema::Linkage::default(); + linkage.other.insert(dist_schema::Library { path: "fakelib".to_owned(), source: None, package_manager: None, diff --git a/cargo-dist/src/cli.rs b/cargo-dist/src/cli.rs index 7d857e6ac..d2e4d3cba 100644 --- a/cargo-dist/src/cli.rs +++ b/cargo-dist/src/cli.rs @@ -1,12 +1,12 @@ //! All the clap stuff for parsing/documenting the cli use camino::Utf8PathBuf; -use cargo_dist_schema::TripleName; use clap::{ builder::{PossibleValuesParser, TypedValueParser}, Args, Parser, Subcommand, ValueEnum, }; use dist::announce::{TagMode, TagSettings}; +use dist_schema::TripleName; use tracing::level_filters::LevelFilter; #[derive(Parser, Clone, Debug)] diff --git a/cargo-dist/src/config/mod.rs b/cargo-dist/src/config/mod.rs index 4d27e03db..2123aefef 100644 --- a/cargo-dist/src/config/mod.rs +++ b/cargo-dist/src/config/mod.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use axoasset::{toml_edit, SourceFile}; use axoproject::local_repo::LocalRepo; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ +use dist_schema::{ AptPackageName, ChecksumExtensionRef, ChocolateyPackageName, HomebrewPackageName, PackageVersion, TripleName, TripleNameRef, }; @@ -175,13 +175,13 @@ impl std::str::FromStr for LibraryStyle { #[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "kebab-case")] pub enum InstallerStyle { - /// Generate a shell script that fetches from [`cargo_dist_schema::Release::artifact_download_url`][] + /// Generate a shell script that fetches from [`dist_schema::Release::artifact_download_url`][] Shell, - /// Generate a powershell script that fetches from [`cargo_dist_schema::Release::artifact_download_url`][] + /// Generate a powershell script that fetches from [`dist_schema::Release::artifact_download_url`][] Powershell, - /// Generate an npm project that fetches from [`cargo_dist_schema::Release::artifact_download_url`][] + /// Generate an npm project that fetches from [`dist_schema::Release::artifact_download_url`][] Npm, - /// Generate a Homebrew formula that fetches from [`cargo_dist_schema::Release::artifact_download_url`][] + /// Generate a Homebrew formula that fetches from [`dist_schema::Release::artifact_download_url`][] Homebrew, /// Generate an msi installer that embeds the binary Msi, diff --git a/cargo-dist/src/config/v0.rs b/cargo-dist/src/config/v0.rs index 176f031fb..4a508cacc 100644 --- a/cargo-dist/src/config/v0.rs +++ b/cargo-dist/src/config/v0.rs @@ -1,7 +1,7 @@ //! v0 config use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ +use dist_schema::{ declare_strongly_typed_string, GithubRunner, GithubRunnerConfigInput, StringLikeOr, }; use semver::Version; @@ -78,7 +78,7 @@ pub struct DistMetadata { /// only plan out the release without running builds and "skip" will disable /// pull request runs entirely. #[serde(skip_serializing_if = "Option::is_none")] - pub pr_run_mode: Option, + pub pr_run_mode: Option, /// Generate targets whose dist should avoid checking for up-to-dateness. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/cargo-dist/src/config/v1/ci/github.rs b/cargo-dist/src/config/v1/ci/github.rs index 0ed00db8e..2fe6a6fbf 100644 --- a/cargo-dist/src/config/v1/ci/github.rs +++ b/cargo-dist/src/config/v1/ci/github.rs @@ -1,6 +1,6 @@ //! github ci config -use cargo_dist_schema::{ +use dist_schema::{ ContainerConfig, GithubRunner, GithubRunnerConfig, GithubRunnerConfigInput, StringLikeOr, TripleName, }; diff --git a/cargo-dist/src/config/v1/ci/mod.rs b/cargo-dist/src/config/v1/ci/mod.rs index 3c1712b4b..6ae9d8836 100644 --- a/cargo-dist/src/config/v1/ci/mod.rs +++ b/cargo-dist/src/config/v1/ci/mod.rs @@ -130,7 +130,7 @@ pub struct CommonCiLayer { /// only plan out the release without running builds and "skip" will disable /// pull request runs entirely. #[serde(skip_serializing_if = "Option::is_none")] - pub pr_run_mode: Option, + pub pr_run_mode: Option, /// a prefix to add to the release.yml and tag pattern so that /// dist can co-exist with other release workflows in complex workspaces @@ -203,7 +203,7 @@ pub struct CommonCiConfig { pub release_branch: Option, /// Which actions to run on pull requests. - pub pr_run_mode: cargo_dist_schema::PrRunMode, + pub pr_run_mode: dist_schema::PrRunMode, /// a prefix to add to the release.yml and tag pattern so that /// dist can co-exist with other release workflows in complex workspaces @@ -237,7 +237,7 @@ impl CommonCiConfig { build_local_artifacts: true, dispatch_releases: false, release_branch: None, - pr_run_mode: cargo_dist_schema::PrRunMode::default(), + pr_run_mode: dist_schema::PrRunMode::default(), tag_namespace: None, plan_jobs: vec![], build_local_jobs: vec![], diff --git a/cargo-dist/src/errors.rs b/cargo-dist/src/errors.rs index 2d8349030..a47a3dfc8 100644 --- a/cargo-dist/src/errors.rs +++ b/cargo-dist/src/errors.rs @@ -9,9 +9,9 @@ use axoproject::errors::AxoprojectError; use backtrace::Backtrace; use camino::Utf8PathBuf; -use cargo_dist_schema::{target_lexicon::Triple, ArtifactId, TripleName}; use color_backtrace::BacktracePrinter; use console::style; +use dist_schema::{target_lexicon::Triple, ArtifactId, TripleName}; use miette::{Diagnostic, SourceOffset, SourceSpan}; use thiserror::Error; @@ -72,7 +72,7 @@ pub enum DistError { /// random triple parse error #[error(transparent)] - TripleError(#[from] cargo_dist_schema::target_lexicon::ParseError), + TripleError(#[from] dist_schema::target_lexicon::ParseError), /// A problem with a jinja template, which is always a dist bug #[error("Failed to render template")] diff --git a/cargo-dist/src/host.rs b/cargo-dist/src/host.rs index d4c4c3f1c..47ac57ffe 100644 --- a/cargo-dist/src/host.rs +++ b/cargo-dist/src/host.rs @@ -14,7 +14,7 @@ use crate::{ DistError, DistGraph, DistGraphBuilder, HostingInfo, }; use axoproject::WorkspaceGraph; -use cargo_dist_schema::{ArtifactIdRef, DistManifest, Hosting}; +use dist_schema::{ArtifactIdRef, DistManifest, Hosting}; use gazenot::{AnnouncementKey, Gazenot}; /// Do hosting @@ -190,7 +190,7 @@ impl<'a> DistGraphBuilder<'a> { self.manifest .ensure_release(name.clone(), version.clone()) .hosting - .github = Some(cargo_dist_schema::GithubHosting { + .github = Some(dist_schema::GithubHosting { artifact_base_url: hosting.domain.clone(), artifact_download_path: format!("{repo_path}/releases/download/{tag}"), owner: hosting.owner.clone(), diff --git a/cargo-dist/src/init.rs b/cargo-dist/src/init.rs index 75c1f7162..77edd2f97 100644 --- a/cargo-dist/src/init.rs +++ b/cargo-dist/src/init.rs @@ -1,7 +1,7 @@ use axoasset::toml_edit; use axoproject::{WorkspaceGraph, WorkspaceInfo, WorkspaceKind}; use camino::Utf8PathBuf; -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; use semver::Version; use serde::Deserialize; diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index 4c2a52023..29edf3565 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -27,11 +27,11 @@ use build::{ fake::{build_fake_cargo_target, build_fake_generic_target}, }; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ArtifactId, ChecksumValue, ChecksumValueRef, DistManifest, TripleName}; use config::{ ArtifactMode, ChecksumStyle, CompressionImpl, Config, DirtyMode, GenerateMode, ZipStyle, }; use console::Term; +use dist_schema::{ArtifactId, ChecksumValue, ChecksumValueRef, DistManifest, TripleName}; use semver::Version; use temp_dir::TempDir; use tracing::info; diff --git a/cargo-dist/src/linkage.rs b/cargo-dist/src/linkage.rs index 23d8214b5..6da162a25 100644 --- a/cargo-dist/src/linkage.rs +++ b/cargo-dist/src/linkage.rs @@ -8,11 +8,11 @@ use std::{ use axoasset::SourceFile; use axoprocess::Cmd; use camino::Utf8PathBuf; -use cargo_dist_schema::{ +use comfy_table::{presets::UTF8_FULL, Table}; +use dist_schema::{ AssetInfo, BuildEnvironment, DistManifest, GlibcVersion, Library, Linkage, PackageManager, TripleNameRef, }; -use comfy_table::{presets::UTF8_FULL, Table}; use goblin::Object; use mach_object::{LoadCommand, OFile}; use tracing::warn; diff --git a/cargo-dist/src/main.rs b/cargo-dist/src/main.rs index 4456a45a7..8bacdcf5f 100644 --- a/cargo-dist/src/main.rs +++ b/cargo-dist/src/main.rs @@ -9,7 +9,6 @@ use axoprocess::Cmd; use axoupdater::AxoUpdater; use camino::Utf8PathBuf; // Import everything from the lib version of ourselves -use cargo_dist_schema::{AssetKind, DistManifest}; use clap::Parser; use cli::{ Cli, Commands, GenerateMode, HelpMarkdownArgs, HostArgs, ManifestArgs, OutputFormat, PlanArgs, @@ -17,6 +16,7 @@ use cli::{ }; use console::Term; use dist::{linkage::LinkageDisplay, *}; +use dist_schema::{AssetKind, DistManifest}; use miette::{miette, IntoDiagnostic}; use net::ClientSettings; @@ -116,7 +116,7 @@ fn print_human(out: &mut Term, manifest: &DistManifest) -> Result<(), std::io::E )?; for artifact_id in &release.artifacts { let artifact = &manifest.artifacts[artifact_id]; - if let cargo_dist_schema::ArtifactKind::Checksum = &artifact.kind { + if let dist_schema::ArtifactKind::Checksum = &artifact.kind { // Don't print shasums at top-level continue; } @@ -186,7 +186,7 @@ fn print_human(out: &mut Term, manifest: &DistManifest) -> Result<(), std::io::E fn print_human_artifact_path( out: &mut Term, - artifact: &cargo_dist_schema::Artifact, + artifact: &dist_schema::Artifact, ) -> Result<(), std::io::Error> { // Print out the name or path of the artifact (path is more useful by noisier) if let Some(path) = &artifact.path { @@ -242,7 +242,7 @@ fn cmd_print_upload_files_from_manifest( args: &PrintUploadFilesFromManifestArgs, ) -> Result<(), miette::Report> { let manifest_str = axoasset::LocalAsset::load_string(&args.manifest)?; - let manifest = serde_json::from_str::(&manifest_str) + let manifest = serde_json::from_str::(&manifest_str) .into_diagnostic() .map_err(|err| miette!("Failed to parse manifest as JSON: {}", err))?; @@ -404,7 +404,7 @@ fn generate_manifest( .as_ref() .and_then(|ci| ci.github.as_ref()) .and_then(|gh| gh.pr_run_mode) - == Some(cargo_dist_schema::PrRunMode::Upload)) + == Some(dist_schema::PrRunMode::Upload)) { let message = concat!( " note: Forcing needs_coherence=true, because pr-run-mode=\"upload\" is set.\n", @@ -661,7 +661,7 @@ fn cmd_manifest_schema( _config: &Cli, args: &cli::ManifestSchemaArgs, ) -> Result<(), miette::ErrReport> { - let schema = cargo_dist_schema::DistManifest::json_schema(); + let schema = dist_schema::DistManifest::json_schema(); let json_schema = serde_json::to_string_pretty(&schema).expect("failed to stringify schema!?"); if let Some(destination) = args.output.to_owned() { diff --git a/cargo-dist/src/manifest.rs b/cargo-dist/src/manifest.rs index 2e0d99fbf..3fd09b804 100644 --- a/cargo-dist/src/manifest.rs +++ b/cargo-dist/src/manifest.rs @@ -37,7 +37,7 @@ use std::collections::btree_map::Entry; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::{ +use dist_schema::{ Artifact, ArtifactId, Asset, AssetKind, DistManifest, DynamicLibraryAsset, ExecutableAsset, Hosting, StaticLibraryAsset, }; @@ -336,12 +336,12 @@ fn add_manifest_artifact( ArtifactKind::ExecutableZip(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::ExecutableZip; + kind = dist_schema::ArtifactKind::ExecutableZip; } ArtifactKind::Symbols(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::Symbols; + kind = dist_schema::ArtifactKind::Symbols; } ArtifactKind::Installer( InstallerImpl::Powershell(info) @@ -354,58 +354,58 @@ fn add_manifest_artifact( ) => { install_hint = Some(info.hint.clone()); description = Some(info.desc.clone()); - kind = cargo_dist_schema::ArtifactKind::Installer; + kind = dist_schema::ArtifactKind::Installer; } ArtifactKind::Installer(InstallerImpl::Msi(..)) => { install_hint = None; description = Some("install via msi".to_owned()); - kind = cargo_dist_schema::ArtifactKind::Installer; + kind = dist_schema::ArtifactKind::Installer; } ArtifactKind::Installer(InstallerImpl::Pkg(..)) => { install_hint = None; description = Some("install via pkg".to_owned()); - kind = cargo_dist_schema::ArtifactKind::Installer; + kind = dist_schema::ArtifactKind::Installer; } ArtifactKind::Checksum(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::Checksum; + kind = dist_schema::ArtifactKind::Checksum; } ArtifactKind::UnifiedChecksum(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::UnifiedChecksum; + kind = dist_schema::ArtifactKind::UnifiedChecksum; } ArtifactKind::SourceTarball(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::SourceTarball; + kind = dist_schema::ArtifactKind::SourceTarball; } ArtifactKind::ExtraArtifact(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::ExtraArtifact; + kind = dist_schema::ArtifactKind::ExtraArtifact; } ArtifactKind::Updater(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::Updater; + kind = dist_schema::ArtifactKind::Updater; } ArtifactKind::SBOM(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::SBOM; + kind = dist_schema::ArtifactKind::SBOM; } ArtifactKind::OmniborArtifactId(_) => { install_hint = None; description = None; - kind = cargo_dist_schema::ArtifactKind::OmniborArtifactId; + kind = dist_schema::ArtifactKind::OmniborArtifactId; } }; let checksum = artifact.checksum.map(|idx| dist.artifact(idx).id.clone()); - let out_artifact = cargo_dist_schema::Artifact { + let out_artifact = dist_schema::Artifact { name: Some(artifact.id.clone()), path: if cfg.no_local_paths { None diff --git a/cargo-dist/src/platform.rs b/cargo-dist/src/platform.rs index a95e53e69..d6ff39614 100644 --- a/cargo-dist/src/platform.rs +++ b/cargo-dist/src/platform.rs @@ -232,7 +232,7 @@ pub mod targets; use std::collections::HashMap; -use cargo_dist_schema::{ +use dist_schema::{ ArtifactId, AssetId, BuildEnvironment, ChecksumExtension, ChecksumValue, DistManifest, GlibcVersion, Linkage, SystemInfo, TripleName, TripleNameRef, }; diff --git a/cargo-dist/src/platform/github_runners.rs b/cargo-dist/src/platform/github_runners.rs index 061c9bfd3..6db867856 100644 --- a/cargo-dist/src/platform/github_runners.rs +++ b/cargo-dist/src/platform/github_runners.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use crate::platform::targets as t; -use cargo_dist_schema::{target_lexicon::Triple, GithubRunnerRef, TripleNameRef}; +use dist_schema::{target_lexicon::Triple, GithubRunnerRef, TripleNameRef}; use tracing::warn; lazy_static::lazy_static! { diff --git a/cargo-dist/src/platform/targets.rs b/cargo-dist/src/platform/targets.rs index 1b9008a55..b03d42cd7 100644 --- a/cargo-dist/src/platform/targets.rs +++ b/cargo-dist/src/platform/targets.rs @@ -2,7 +2,7 @@ // Various target triples -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; macro_rules! define_target_triples { ($($(#[$meta:meta])* const $name:ident = $triple:expr;)*) => { diff --git a/cargo-dist/src/sign/macos.rs b/cargo-dist/src/sign/macos.rs index ee267d3b9..bcbf83265 100644 --- a/cargo-dist/src/sign/macos.rs +++ b/cargo-dist/src/sign/macos.rs @@ -22,7 +22,7 @@ use axoasset::LocalAsset; use axoprocess::Cmd; use base64::Engine; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; use temp_dir::TempDir; use tracing::warn; diff --git a/cargo-dist/src/sign/mod.rs b/cargo-dist/src/sign/mod.rs index 19bfc5d2a..52c5b6147 100644 --- a/cargo-dist/src/sign/mod.rs +++ b/cargo-dist/src/sign/mod.rs @@ -5,7 +5,7 @@ use std::os::unix::fs::PermissionsExt; use axoasset::AxoClient; use camino::Utf8Path; -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; use crate::{config::ProductionMode, DistResult}; diff --git a/cargo-dist/src/sign/ssldotcom.rs b/cargo-dist/src/sign/ssldotcom.rs index 73a878fd4..83845702f 100644 --- a/cargo-dist/src/sign/ssldotcom.rs +++ b/cargo-dist/src/sign/ssldotcom.rs @@ -4,7 +4,7 @@ use axoasset::LocalAsset; use axoprocess::Cmd; use camino::Utf8Path; use camino::Utf8PathBuf; -use cargo_dist_schema::TripleNameRef; +use dist_schema::TripleNameRef; use tracing::info; use tracing::warn; diff --git a/cargo-dist/src/tasks.rs b/cargo-dist/src/tasks.rs index 5975ba4fb..2ebe0bdce 100644 --- a/cargo-dist/src/tasks.rs +++ b/cargo-dist/src/tasks.rs @@ -58,8 +58,8 @@ use axoasset::AxoClient; use axoprocess::Cmd; use axoproject::{PackageId, PackageIdx, WorkspaceGraph}; use camino::{Utf8Path, Utf8PathBuf}; -use cargo_dist_schema::target_lexicon::{OperatingSystem, Triple}; -use cargo_dist_schema::{ +use dist_schema::target_lexicon::{OperatingSystem, Triple}; +use dist_schema::{ ArtifactId, BuildEnvironment, DistManifest, HomebrewPackageName, SystemId, SystemInfo, TripleName, TripleNameRef, }; @@ -2980,14 +2980,14 @@ impl<'pkg_graph> DistGraphBuilder<'pkg_graph> { .github_release .as_ref() .and_then(|r| r.external_repo_commit.clone()); - cargo_dist_schema::GithubCiInfo { + dist_schema::GithubCiInfo { artifacts_matrix: Some(info.artifacts_matrix.clone()), pr_run_mode: Some(info.pr_run_mode), external_repo_commit, } }); - self.manifest.ci = Some(cargo_dist_schema::CiInfo { github }); + self.manifest.ci = Some(dist_schema::CiInfo { github }); } Ok(()) diff --git a/cargo-dist/tests/gallery/dist.rs b/cargo-dist/tests/gallery/dist.rs index c026d51aa..3d976414b 100644 --- a/cargo-dist/tests/gallery/dist.rs +++ b/cargo-dist/tests/gallery/dist.rs @@ -512,7 +512,7 @@ impl PlanResult { self.snapshot() } - pub fn parse(&self) -> Result { + pub fn parse(&self) -> Result { let src = SourceFile::new("dist-manifest.json", self.raw_json.clone()); let val = src.deserialize_json()?; Ok(val)