Skip to content

Misleading message when using invalid (?) include field #6830

@Thomasdezeeuw

Description

@Thomasdezeeuw

Problem

When using an invalid (?) include field in Cargo.toml cargo package will fail with "failed to verify package tarball".

Steps

  1. Create a new repo, cargo init tmp && cd tmp
  2. Add include = [ "./src/main.rs" ] to Cargo.toml.
  3. Add and commit everything: git add . && git commit -m "init".
  4. Package (or publish) the create: cargo package
   Packaging tmp v0.1.0 (/private/var/folders/lq/rzq0zxld0bb5mcy4jl1txrf00000gn/T/tmp.1svg10Al/tmp)
   Verifying tmp v0.1.0 (/private/var/folders/lq/rzq0zxld0bb5mcy4jl1txrf00000gn/T/tmp.1svg10Al/tmp)
error: failed to verify package tarball

Caused by:
  failed to read `/private/var/folders/lq/rzq0zxld0bb5mcy4jl1txrf00000gn/T/tmp.1svg10Al/tmp/target/package/tmp-0.1.0/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

Possible Solution(s)

In the actual code I dropped ./ from the include field and it worked, it doesn't seem to be the case with a new crate.

Notes

Output of cargo version: cargo 1.35.0-nightly (0e35bd8 2019-03-13) (currently can't get a newer version due to clippy being broken on nightly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions