Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo package fails with submodules #2657

Closed
brson opened this issue May 6, 2016 · 11 comments
Closed

cargo package fails with submodules #2657

brson opened this issue May 6, 2016 · 11 comments

Comments

@brson
Copy link
Contributor

brson commented May 6, 2016

This tree fails cargo package with:

   Packaging sha2 v0.1.0 (file:///home/brian/dev/rust-sha2)
   Verifying sha2 v0.1.0 (file:///home/brian/dev/rust-sha2)
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling rustc-serialize v0.3.19
   Compiling sha2 v0.1.0 (file:///home/brian/dev/rust-sha2/target/package/sha2-0.1.0)
target/package/sha2-0.1.0/lib.rs:5:9: 5:15 error: couldn't read "target/package/sha2-0.1.0/rust-crypto/src/buffer.rs": No such file or directory (os error 2)
target/package/sha2-0.1.0/lib.rs:5 pub mod buffer;
                                           ^~~~~~
error: failed to verify package tarball

Caused by:
  Could not compile `sha2`.

To learn more, run the command again with --verbose.

I've tried adding include directives to Cargo.toml and moving the submodule under src.

@brson
Copy link
Contributor Author

brson commented May 6, 2016

Oh, I did work around this with include after I realized I had to specify every file.

Edit: No, not true. Still haven't gotten it to work.

@brson
Copy link
Contributor Author

brson commented May 6, 2016

This may have to do with something else besides submodules. Even after removing the submodule I can't get this to package.

@alexcrichton
Copy link
Member

Was the submodule not checked out? Cargo doesn't automatically check out local submodules, and if it was checked out it worked locally for me

@brson
Copy link
Contributor Author

brson commented May 6, 2016

It was checked out. cargo build works, cargo package fails.

@alexcrichton
Copy link
Member

How are you repro'ing? This works for me:

$ git clone https://github.com/brson/rust-sha2 --branch broken --recursive
$ cd rust-sha2
$ cargo package

@brson
Copy link
Contributor Author

brson commented May 6, 2016

Those exact commands don't work for me. They produce the error in the OP.

  • rustc 1.10.0-nightly (8da2bcac5 2016-04-28)
  • cargo 0.11.0-nightly (afac7fc 2016-04-27)

@brson
Copy link
Contributor Author

brson commented May 6, 2016

No matter what I do rust-crypto doesn't exist in target/package/sha2-0.1.0.

@alexcrichton
Copy link
Member

Looks like this is a beta regression, I can reproduce on beta's cargo and not on stable's

@brson
Copy link
Contributor Author

brson commented May 6, 2016

Ah. Well, I'll publish this with stable, then!

@alexcrichton
Copy link
Member

Oh actually this may have been a bug fix. The traversal logic for including crates is skipping rust-crypto because it looks like a sub-crate (e.g. it has a Cargo.toml).

@carols10cents
Copy link
Member

This sounds like the change was intentional, and if this continued to have been a problem, I would have expected this issue to have had activity in the last year. Closing, please reopen if I'm mistaken!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants