message: Only `--path` and cwd crate installation need workspace info
diff: @@ -75,26 +75,12 @@ pub fn cli() -> App {
  }
  pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
  - let workspace;
  if let Some(path) = args.value_of_path("path", config) {
  config.reload_rooted_at(path)?;
  - // Only provide worksapce information for local crate installation
  - workspace = args.workspace(config).ok();
  } else {
  config.reload_rooted_at(config.home().clone().into_path_unlocked())?;
  - workspace = None;
  }
  - let mut compile_opts = args.compile_options(
  - config,
  - CompileMode::Build,
  - workspace.as_ref(),
  - ProfileChecking::Checked,
  - )?;
  -
  - compile_opts.build_config.requested_profile =
  - args.get_profile_name(config, "release", ProfileChecking::Checked)?;
  -
  let krates = args
  .values_of("crate")
  .unwrap_or_default()
  @@ -130,6 +116,26 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
  let version = args.value_of("version");
  let root = args.value_of("root");
  + // We only provide worksapce information for local crate installation from
  + // one of the following sources:
  + // - From current working directory (only work for edition 2015).
  + // - From a specific local file path.
  + let workspace = if from_cwd || args.is_present("path") {
  + args.workspace(config).ok()
  + } else {
  + None
  + };
  +
  + let mut compile_opts = args.compile_options(
  + config,
  + CompileMode::Build,
  + workspace.as_ref(),
  + ProfileChecking::Checked,
  + )?;
  +
  + compile_opts.build_config.requested_profile =
  + args.get_profile_name(config, "release", ProfileChecking::Checked)?;
  +
  if args.is_present("list") {
  ops::install_list(root, config)?;
  } else {
  