Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

cargo-tree does not work on workspaces that use nightly features #67

Closed
RalfJung opened this issue Jul 25, 2019 · 6 comments · Fixed by #75
Closed

cargo-tree does not work on workspaces that use nightly features #67

RalfJung opened this issue Jul 25, 2019 · 6 comments · Fixed by #75

Comments

@RalfJung
Copy link
Contributor

I am trying to use cargo tree on the rustc workspace, but all I get is

error: failed to parse manifest at `/home/r/src/rust/rustc.2/src/tools/miri/Cargo.toml`

Caused by:
  the `default-run` manifest key is unstable

Caused by:
  feature `default-run` is required

this Cargo does not support nightly features, but if you
switch to nightly channel you can add
`cargo-features = ["default-run"]` to enable this feature

Is there any way to use cargo tree on this workspace? I compiled cargo-tree with a nightly rustc but that did not help.

@RalfJung
Copy link
Contributor Author

I bumped the cargo dependency to the not-yet-released Cargo 0.38 (accompanying Rust 1.37), but that still doesn't work for the rustc repo:

error: manifest path `/home/r/src/rust/rustc.2/Cargo.toml` is a virtual manifest, but this command requires running against an actual package in this workspace

@ehuss @sfackler any advice for how to make cargo-tree work on the rustc repo?

@RalfJung
Copy link
Contributor Author

Hm, actually the error already happens with stable cargo-tree, if I remove the default-run from the rustc repo. That's odd though, I am sure I used cargo-tree on that repo before.

And also, that still means cargo-tree isn't usable for rustc even when the nightly feature situation is resolved. I am not sure how to make progress here. I really want to know which packages pull in old versions of memoffset, and doing that by hand is really hard. :(

@ehuss
Copy link

ehuss commented Aug 15, 2019

cargo-tree only works for a single package. You need to do something like cd src/libstd ; cargo tree or whichever package you're interested in.

I'm not sure why cargo tree only works with a single root. Presumably it could be modified so it works with a list of roots? That is, it would list each root independently in sequence? I'm not sure how useful that would be since the output could be very large. For more complex workspaces, I use cargo-deps, but it doesn't support workspaces, either. 😞

@ehuss
Copy link

ehuss commented Aug 15, 2019

Oh, I remembered about a year ago I made a tool for graphing a workspace. As you can see, by default, it is useless. The tool allows you to selectively prune the graph, but it is awkward.
graph2
Any non-trivial workspace will need better ways to visualize and navigate the data.

@RalfJung
Copy link
Contributor Author

My use-case here is to ask "which parts of the rustc workspace still depend on old versions memoffset, and through which other dependencies?"

cargo tree -p memoffset -i is great for that, but having to do that for each and every package in the workspace is not. In principle merging all dependencies graphs and then visualizing the slice that depends on memoffset should be feasible and not produce a ridiculously large result.

@est31
Copy link
Contributor

est31 commented Aug 24, 2019

You can opt into supporting nightly features by calling the maybe_allow_nightly_features function. I've done a PR to add it to cargo-outdated already and I'll file one for this repo as well but ultimately IMO the default is stupid. Virtually every tool that uses cargo as a library lacks support for nightly features because nobody knows you can opt into it, and virtually every tool would be improved from such an opt in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants