You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output of cargo metadata --format-version=1 is a bit different in beta. For optional dependency foo, it adds "foo" = ["dep:foo"] to the feature list. This breaks one of my crates that reads the output it.
Steps
Run cargo +beta metadata --fomat-version=1 in any workspace with optional dependencies.
Possible Solution(s)
Define and document a policy for what type of changes are allowed in the output without requiring a bump to the format version argument.
Notes
The crate in question is a CI tool for running a cargo command repeatedly with all valid sets of features. It reads the metadata so that it doesn't run the two extra times for features that are dependencies of other features. As of now, it makes its list of feature sets by reading the features field to get the list of features and their dependencies, and the dependencies field to get the list of optional dependencies.
With the beta version, are all optional dependencies guaranteed to show up in the feature list?
It definitely would be great to clarify the documentation for how things can change. In general, new versions may introduce new fields. The change in value formats is a little more nebulous, so it might be difficult to specify exactly what can and can't change. The types of the values won't change (like for example, a string won't change to an array), but the contents might (for example, if cargo ever adds a new dependency kind, then the "kind" could add a new value).
I think the important thing is that the values can be used the same way, although that might be a bit nebulous as well.
My crate reads the features from the manifest and then compiles and runs the tests with different combinations of features. The problems is that the new dependencies can't be passed to cargo as part of the feature list.
#12313 is an effort of this, and for external tool maintainers we occasionally post announcement that may potentially break tools on Zulip t-cargo/build-integration. Please subscribe if you're interested.
#12377 is also relevant however regarding --message-format=json.
Problem
The output of
cargo metadata --format-version=1
is a bit different in beta. For optional dependencyfoo
, it adds"foo" = ["dep:foo"]
to the feature list. This breaks one of my crates that reads the output it.Steps
Run
cargo +beta metadata --fomat-version=1
in any workspace with optional dependencies.Possible Solution(s)
Define and document a policy for what type of changes are allowed in the output without requiring a bump to the format version argument.
Notes
The crate in question is a CI tool for running a cargo command repeatedly with all valid sets of features. It reads the metadata so that it doesn't run the two extra times for features that are dependencies of other features. As of now, it makes its list of feature sets by reading the features field to get the list of features and their dependencies, and the dependencies field to get the list of optional dependencies.
With the beta version, are all optional dependencies guaranteed to show up in the feature list?
Version
The text was updated successfully, but these errors were encountered: