meta-rust / cargo-bitbake

cargo extension that can generate BitBake recipes utilizing the classes from meta-rust
Apache License 2.0
83 stars 57 forks source link

Root Package Workspace #56

Open jwinarske opened 1 year ago

jwinarske commented 1 year ago

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 commented 1 year ago

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.