Open sfackler opened 7 years ago
Hm, and what is "the current crate"? The one specified with --manifest-path
or the closest to the current working directory?
We can surface that to cargo-metadata
for sure, but logically it does not belong there (i.e, I expect cargo metadata
to return the same output regardless of the location in the workspace it is invoked from).
I also feel that "current crate" is a bit elusive concept (there's no current
crate with -all
flag).
Perhaps it would not be that difficult to reconstruct "current" on the client's side? You don't have to do directory traversal, you can look at the manifest_path
fields of Package
nodes of metadata
.
The "current" crate is the one that builds if I run cargo build
with the same flags.
The "current" crate is the one that builds if I run cargo build with the same flags.
Cargo may build any set of packages from a workspace depending on the flags. For example
$ cargo build -p foo -p bar
will build foo
and bar
and their dependencies, but not, for example, baz
. And there's also cargo build --all
. So there's no the "current" crate really. Why do you need to know current
crate?
cc @matklad