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

[regression] Fatal: Invalid TOML file format: error during execution of cargo metadata #129

Closed
LegNeato opened this issue Jul 19, 2019 · 6 comments · Fixed by #130
Closed
Labels
bug Not as expected

Comments

@LegNeato
Copy link
Contributor

Juniper (https://github.com/graphql-rust/juniper/) uses cargo-release to test our release pipeline in CI. The most recent release breaks that CI job.

Everything was fine with cargo-release v0.11.2 and it breaks with cargo-release v0.12.1.

Fatal: Invalid TOML file format: error during execution of `cargo metadata`: error: failed to parse manifest at `/home/vsts/work/1/s/juniper_codegen/Cargo.toml`

Caused by:
  Dependency 'juniper' has different source paths depending on the build target. Each dependency must have a single canonical source path irrespective of build target.

You can see the command run and output in our CI.

@LegNeato
Copy link
Contributor Author

This was likely broken by workspace support. juniper is in a workspace but we run cargo-release manually via a build system for each crate.

@epage
Copy link
Collaborator

epage commented Jul 20, 2019

error during execution ofcargo metadata`

This is the weird part. How can cargo-metadata fail on your project and yet it otherwise works fine?

@epage
Copy link
Collaborator

epage commented Jul 21, 2019

I bet this is related to our updating dependent dependencies. Itd be helpful if you could post hhe invalid Cargo.toml so we could see what, if anything, we can do.

Dependent version updating can be controlled in the config file or on the command line. See the reference for how to disable it.

@theduke
Copy link

theduke commented Jul 22, 2019

This is the problematic diff.

diff --git a/juniper_codegen/Cargo.toml b/juniper_codegen/Cargo.toml
index 6ce783fc..10294daf 100644
--- a/juniper_codegen/Cargo.toml
+++ b/juniper_codegen/Cargo.toml
@@ -20,6 +20,7 @@ syn = { version = "0.15.28", features = ["full", "extra-traits", "parsing"] }
 quote = "0.6"
 regex = "1"
 lazy_static = "1.0.0"
+juniper = {version = "^0.14.0"}

 [dev-dependencies]
 juniper = { version = "0.13.0", path = "../juniper" }

Note: juniper should not be added as a dependency here!

Also: the issue happens on 0.11.02 as well, so it's not a regression.

@epage epage added the bug Not as expected label Jul 22, 2019
@epage
Copy link
Collaborator

epage commented Jul 22, 2019

This is the problematic diff.

Yeah, that explains it. We read all dependencies and write them back as dependencies rather than checking of they are dev- or build-

See https://github.com/sunng87/cargo-release/blob/master/src/cargo.rs#L92

Also: the issue happens on 0.11.02 as well, so it's not a regression.

Weird, it doesn't look like our messing with dependencies was in that version

@theduke
Copy link

theduke commented Jul 24, 2019

Weird, it doesn't look like our messing with dependencies was in that version

My bad, this was a mistake on my part, it indeed only happens with 0.12.

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

Successfully merging a pull request may close this issue.

3 participants