rust-mobile / cargo-subcommand

Library for implementing cargo subcommands
6 stars 6 forks source link

utils: Search for workspace members relative to root manifest #3

Closed MarijnS95 closed 3 years ago

MarijnS95 commented 3 years ago

Workspace members (globs) should be discovered from the directory containing Cargo.toml with these workspaces, not from the directory the user happens to in.

Take for example android-ndk-rs. When cd'd into ndk-examples this would find the root manifest file in ../Cargo.toml, but try to glob in the current directory - ndk-examples - where it's obviously not going to find another ndk-examples containing Cargo.toml. The Subcommand constructor hence considers this package as not being in a workspace and emits target_dir at ndk-examples/target. This fails later in the build when files cannot be found in the toplevel target/ dir.

Fixes https://github.com/rust-windowing/android-ndk-rs/issues/105

dvc94ch commented 3 years ago

Thanks!