Two problems here:
- 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.
- 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.
Two problems here:
binariesin Cargo.toml to specify one (and hence ignore other) binaries in my image. However packager is trying to include the binaries not included inbinaries. It looks like when loading packager config from Cargo.toml, packager is adding all binaries to the binaries list.For 1 see
load_configs_from_cargo_workspacelet 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.