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

Root Package Workspace #56

Open
jwinarske opened this issue Sep 15, 2022 · 1 comment
Open

Root Package Workspace #56

jwinarske opened this issue Sep 15, 2022 · 1 comment

Comments

@jwinarske
Copy link

jwinarske commented Sep 15, 2022

cargo bitbake has trouble parsing a workspace Cargo.toml (root).

error: failed to parse manifest at `.../Cargo.toml`

Caused by:
  feature `resolver` is required

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

Adding cargo-features = ["resolver"] and moving to nightly still ends in failure.

This is from the root of a project with many packages. The root Cargo.toml looks something like this:

[workspace]
resolver = "2"
members = [
  "pkg_a",
  "pkg_a_tests",
  "pkg_b",
  "pkg_b/a/*",
  "pkg_b/b/a",
  "pkg_c",
  "pkg_d",
  "pkg_e",
  "pkg_f",
  "pkg_g",
  "pkg_h",
  "pkg_i",
  "pkg_j",
  "pkg_k",
  "pkg_l",
]

[profile.dev]
codegen-units = 1
split-debuginfo = "unpacked"

[profile.release]
codegen-units = 1
lto = true
opt-level = "z"
@jwinarske jwinarske changed the title Workspace Parsing Root Package Workspace Sep 15, 2022
@jwinarske
Copy link
Author

jwinarske commented Oct 15, 2022

Using cargo_metadata I have a working pattern which should work with anything:
Gist: https://gist.github.com/jwinarske/69e23129c0d822f0a7eb72335e95459d

So the resolved object returns for all the non-git crates. For some reason it doesn't include git crate deps. So querying the git Cargo.toml crates and appending to the base resolved list gets all of the dependencies.

The project I'm currently working with has nearly 800 crates. I'll work on a PR the next week or so.

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

No branches or pull requests

1 participant