Skip to content

binaries in Cargo.toml is override and --binaries-dir command line option is ignored #385

@piersfinlayson

Description

@piersfinlayson

Two problems here:

  1. I am trying to use binaries in Cargo.toml to specify one (and hence ignore other) binaries in my image. However packager is trying to include the binaries not included in binaries. It looks like when loading packager config from Cargo.toml, packager is adding all binaries to the binaries list.
  2. To work around this I attempted to put my config in a dedicated Packager.toml, and pass --binaries-dir on the comand line. It ignored this and continued to look for my binaries in out-dir.

For 1 see load_configs_from_cargo_workspace

let targets = package .targets .iter() .filter(|t| t.is_bin()) .collect::<Vec<_>>(); for target in &targets { config.binaries.push(Binary { path: target.name.clone().into(), main: match targets.len() { 1 => true, _ => target.name == package.name, }, }) }

If I put binaries-dir in my Packager.toml it correctly picks the binaries directory, but this requires me to have target specific Packager.toml files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions