Skip to content

Commit

Permalink
Swap to artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Sep 19, 2023
1 parent cd37107 commit 246c2f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions cargo-dist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,22 +730,22 @@ pub fn do_linkage(cfg: &Config, args: &LinkageArgs) -> Result<()> {
let mut reports = vec![];

for target in cfg.targets.clone() {
let releases: Vec<Release> = dist
.releases
let artifacts: Vec<Artifact> = dist
.artifacts
.clone()
.into_iter()
.filter(|r| r.targets.contains(&target))
.filter(|r| r.target_triples.contains(&target))
.collect();

if releases.is_empty() {
eprintln!("No matching release for target {target}");
if artifacts.is_empty() {
eprintln!("No matching artifact for target {target}");
continue;
}

for release in releases {
let path = Utf8PathBuf::from(&dist.dist_dir).join(format!("{}-{target}", release.id));
for artifact in artifacts {
let path = Utf8PathBuf::from(&dist.dist_dir).join(format!("{}-{target}", artifact.id));

for (_, binary) in release.bins {
for (_, binary) in artifact.required_binaries {
let bin_path = path.join(binary);
if !bin_path.exists() {
eprintln!("Binary {bin_path} missing; skipping check");
Expand Down Expand Up @@ -901,7 +901,7 @@ fn determine_linkage(path: &Utf8PathBuf, target: &str) -> DistResult<Linkage> {
}
// Can be run on any OS
"i686-pc-windows-msvc" | "x86_64-pc-windows-msvc" | "aarch64-pc-windows-msvc" => {
do_pe(path)?
do_pe(&path)?

Check failure on line 904 in cargo-dist/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

error: this expression creates a reference which is immediately dereferenced by the compiler --> cargo-dist/src/lib.rs:904:19 | 904 | do_pe(&path)? | ^^^^^ help: change this to: `path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check failure on line 904 in cargo-dist/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

error: this expression creates a reference which is immediately dereferenced by the compiler --> cargo-dist/src/lib.rs:904:19 | 904 | do_pe(&path)? | ^^^^^ help: change this to: `path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
}
_ => return Err(DistError::LinkageCheckUnsupportedBinary {}),
};
Expand Down
10 changes: 5 additions & 5 deletions cargo-dist/src/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ impl SymbolKind {
}

/// A distributable artifact we want to build
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Artifact {
/// Unique id for the Artifact (its file name)
///
Expand Down Expand Up @@ -415,7 +415,7 @@ pub struct Artifact {

/// Info about an archive (zip/tarball) that should be made. Currently this is always part
/// of an Artifact, and the final output will be [`Artifact::file_path`][].
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Archive {
/// An optional prefix path to nest all the archive contents under
/// If None then all the archive's contents will be placed in the root
Expand All @@ -433,7 +433,7 @@ pub struct Archive {
}

/// A kind of artifact (more specific fields)
#[derive(Debug)]
#[derive(Clone, Debug)]
#[allow(clippy::large_enum_variant)]
pub enum ArtifactKind {
/// An executable zip
Expand All @@ -447,13 +447,13 @@ pub enum ArtifactKind {
}

/// An ExecutableZip Artifact
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct ExecutableZip {
// everything important is already part of Artifact
}

/// A Symbols/Debuginfo Artifact
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Symbols {
/// The kind of symbols this is
kind: SymbolKind,
Expand Down

0 comments on commit 246c2f4

Please sign in to comment.