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 does not always work if used with 2018 edition #5906

Closed
orium opened this issue Aug 18, 2018 · 2 comments · Fixed by #5908
Closed

cargo package does not always work if used with 2018 edition #5906

orium opened this issue Aug 18, 2018 · 2 comments · Fixed by #5908

Comments

@orium
Copy link
Member

orium commented Aug 18, 2018

To reproduce create a project with the following Cargo.toml:

cargo-features = ["edition"]

[package]
name = "example"
version = "0.0.0"
authors = ["Example <example@example.com>"]

edition = "2018"

[package.metadata.docs.rs]
features = ["foobar"]

and an empty file as src/lib.rs.

When you try to package this will happen:

orium@laptop-orion cargofixbug % cargo package --allow-dirty --verbose
[...]
   Packaging example v0.0.0 (file:///home/orium/tmp/cargofixbug)
   Archiving .codecov.yml
   Archiving .gitignore
   Archiving .rustfmt.toml
   Archiving .travis.yml
   Archiving Cargo.toml
error: failed to prepare local package for uploading

Caused by:
  values must be emitted before tables
@orium
Copy link
Member Author

orium commented Aug 18, 2018

I'm working on a fix.

@orium
Copy link
Member Author

orium commented Aug 18, 2018

The problem is due to the way the Cargo.toml generated for packaging is serialized. The edition field is emitted after the metadata table, which is not correct. PR soon.

orium added a commit to orium/rpds that referenced this issue Aug 19, 2018
Note that `tools/check.sh` does not pass yet because of these bugs:

  * rust-lang/cargo#5906
  * rust-lang/rustfmt#2927
bors added a commit that referenced this issue Aug 19, 2018
Fix serialization bug in `edition` field of `TomlProject`.

Fixes #5906.
orium added a commit to orium/rpds that referenced this issue Sep 27, 2018
Note that `tools/check.sh` does not pass yet because of these bugs:

  * rust-lang/cargo#5906
  * rust-lang/rustfmt#2927
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

Successfully merging a pull request may close this issue.

1 participant