-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
clap
fails to compile if serde_yaml
is used, because of preserve_order
feature of yaml-rust
#747
Comments
This reverts commit 7cc3be9. See clap-rs/clap#747 and dtolnay/serde-yaml#33 for more details.
+1 as I am facing the exact same problem. Both clap and serde are really popular libraries which makes this a huge problem. I would be happy to help but have honestly no idea on where to start... |
@Prior99: Try downgrading your |
Catching up on issues. Thanks for reporting this, I'm looking into it as well! 👍 |
Ok, so I've read all the related issues and unfortunately changing clap's API to work with the I've been toying with the idea of a 3.x for a while now, at which case I could change clap's API to match the This is a very sticky situation, and I tend to agree with the cargo maintainers that features should be additive only, and not change the API at all. It also seems to me if |
I have a fix which I will publish after some testing. It basically uses LinkedHashMap instead of BTree for the yaml feature of clap. |
@Prior99 I haven't looked in depth yet, since it's been quite a while since I wrote the YAML parts of clap, but I think you can't do that without changing the public API, making it a breaking change. I'm open to seeing what you've got though! 😄 |
Couldn't this be fixed by #750? All the tests passed for me, but please make sure this works by integrating it somewhere. I currently have nothing ready to do so on my own, if this would be an acceptable fix. |
@kbknapp yaml-rust 0.4 has been released and now it uses only linked-hash-map, no more btreemap. Should not we change that too? |
@ignatenkobrain I'm not against it...however that is technically a breaking change to the public API and any code using BTreeMap (or any code using |
Edit: This was my mistake.. my editor auto-formatted the yaml in an incorrect way and I was not indenting each arg under the array to become a map. |
This has been fixed on v3-master |
I see that v3-master hasn't been updated in a while and I get a compile error if I try and reference it in my
Are there any plans to push v3 forward or get this back-ported into v2? |
Rust Version
rustc 1.14.0-nightly (cae6ab1c4 2016-11-05)
Affected Version of clap
2.18.0 (and
serde_yaml
0.5.0)Expected Behavior Summary
Clap should compile and link when
serde_yaml
0.5.0 is being used in the same project.Actual Behavior Summary
When
serde_yaml
andclap
are linked into the same executable, compilation fails with the following error:The problem is that
serde_yaml
configuresyaml-rust
to use thepreserve_order
feature, which breaksclap
, becauseclap
doesn't expect the type of the exportedyaml-rust
APIs to change.I'm going to file an issue with
serde_yaml
linking back here.I'm not sure what the fix would be, but thank you for any help or advice you can provide!
The text was updated successfully, but these errors were encountered: