title: Cargo package doesn't work with Rust's workspace?
body: <p>I create a &quot;workspace&quot; with several folder within it following <a href="https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html" rel="nofollow noreferrer">the tutorial I read here</a></p>
  <p>It runs successfully with <code>cargo run</code> or <code>cargo build</code></p>
  <p>if all of the package were independent from each other, <code>cargo package</code> would run successfully. But as soon as one package depends on the other the <code>cargo package</code> will fail.</p>
  <p>It displays: <code>no matching package named &quot;foo_2&quot; found. location searched: registry &quot;crates-io&quot;</code>. Which is pretty weird, since I specifically add a local path on the dependencies.</p>
  <p>Is this an intended behavior? if so, then why should I bother with workspace at all ?</p>
  <p>The root Cargo.toml</p>
  <pre><code>[workspace]
  members = [
      &quot;foo_1&quot;,
      &quot;foo_2&quot;,
  ]
  </code></pre>
  <p>foo_1/Cargo.toml</p>
  <pre><code>[package]
  name = &quot;foo_1&quot;
  version = &quot;0.1.0&quot;
  edition = &quot;2021&quot;
  
  # error here. It can't found the foo_2 package.
  [dependencies] 
  foo_2 = { path = &quot;../foo_2&quot;, version = &quot;0.1.0&quot; }
  </code></pre>
  <p>foo_2/Cargo.toml</p>
  <pre><code>[package]
  name = &quot;foo_2&quot;
  version = &quot;0.1.0&quot;
  edition = &quot;2021&quot;
  
  [dependencies]
  </code></pre>
  <p><a href="https://i.stack.imgur.com/8LRFM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8LRFM.png" alt="enter image description here" /></a></p>
  <p>Error message:</p>
  <pre class="lang-none prettyprint-override"><code>PS E:\Works\Experimentals\rust-workspace&gt; cargo package --workspace
  warning: manifest has no description, license, license-file, documentation, homepage or repository.
  See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
     Packaging foo_1 v0.1.0 (E:\Works\Experimentals\rust-workspace\foo_1)
     Verifying foo_1 v0.1.0 (E:\Works\Experimentals\rust-workspace\foo_1)
      Updating crates.io index
  error: failed to verify package tarball
  
  Caused by:
    no matching package named `foo_2` found
    location searched: registry `crates-io`
    required by package `foo_1 v0.1.0 (E:\Works\Experimentals\rust-workspace\target\package\foo_1-0.1.0)`
  </code></pre>