message: Canonicalize paths passed as `--target`
diff: use std::collections::{HashMap, HashSet};
  use std::default::Default;
  -use std::path::PathBuf;
  +use std::path::{Path, PathBuf};
  use std::sync::Arc;
  use core::{Package, Source, Target};
  @@ -32,7 +32,7 @@ use core::{PackageId, PackageIdSpec, Profile, Profiles, TargetKind, Workspace};
  use core::resolver::{Method, Resolve};
  use ops::{self, BuildOutput, DefaultExecutor, Executor};
  use util::config::Config;
  -use util::{profile, CargoResult};
  +use util::{profile, CargoResult, CargoResultExt};
  /// Contains information about how a package should be compiled.
  #[derive(Debug)]
  @@ -235,7 +235,17 @@ pub fn compile_ws<'a>(
  ref target_rustc_args,
  } = *options;
  - let target = target.clone();
  + let target = match target {
  + &Some(ref target) if target.ends_with(".json") => {
  + let path = Path::new(target)
  + .canonicalize()
  + .chain_err(|| format_err!("Target path {:?} is not a valid file", target))?;
  + Some(path.into_os_string()
  + .into_string()
  + .map_err(|_| format_err!("Target path is not valid unicode"))?)
  + }
  + other => other.clone(),
  + };
  if jobs == Some(0) {
  bail!("jobs must be at least 1")
  