softprops / lambda-rust

🐳 🦀 a dockerized lambda build env for rust applications
MIT License
162 stars 76 forks source link

Virtual manifest no longer works #38

Closed eikeon closed 5 years ago

eikeon commented 5 years ago

The List executables with cargo change ea26ecc950f619be424ddd3df4f9a368086f4c68 does now work with a virtual manifest where the previous method did. Now getting:

error: manifest path /code/Cargo.toml is a virtual manifest, but this command requires running against an actual package in this workspace

Perhaps there's a way to continue to support the virtual manifest case? I've yet to dig in to look for one.

softprops commented 5 years ago

linking the docs here for my own reference - https://doc.rust-lang.org/cargo/reference/manifest.html#virtual-manifest

Breaking this was unintentional. I'll look into this. My initial guess is this is a limitation of read-manifest not supporting virtual manifests.

eikeon commented 5 years ago

Looks like cargo metadata --no-deps might work in place of cargo cargo read-manifest see: https://github.com/rust-lang/cargo/issues/2356

In my virtual manifest use case it's returning the expected metadata by the looks of it.

softprops commented 5 years ago

Thanks for the early bread crumbs

softprops commented 5 years ago

@eikeon that turned out to be a terrific tip!

I just tested the following on both a crate with a top level src, I'm learning is now referred to as a "package" as well as a project with workspace members which has multiple "packages" and a virtual manifest and it works in both cases.

cargo metadata --no-deps --format-version=1 \
   | jq -r '.packages[] | .targets[] | select(.kind[] | contains("bin")) | .name'

I'll try to roll this out into a new release at the latest but the end of the weekend

eikeon commented 5 years ago

Awesome; and thank you for lambda-rust!