-
Notifications
You must be signed in to change notification settings - Fork 3
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
It does not find when it is called in crate workspace #4
Comments
Hey, @botika. This is most likely a mistake on my part of not properly documenting this crate. It was intended to solve this issue so that a cargo plugin could work more seamlessly. I could be misunderstanding your question but the goal of this crate is to find components installed via |
No problem with the rust version. The case is main Cargo.toml [workspace]
members = [ "lib", "lib_some"] Cargo.toml workspace = ".." Cargo.toml example crate, where is the problem [workspace]
members = ["."] In the case of using |
I'm not able to reproduce this. I created a new crate to test this with a workspace. Here is my layout: .
├── Cargo.lock
├── Cargo.toml
├── bin
│ ├── Cargo.toml
│ └── src
│ └── main.rs
├── lib
│ ├── Cargo.toml
│ └── src
│ └── lib.rs
└── src
5 directories, 6 files
[workspace]
members = ["lib", "bin"]
[package]
name = "bin"
version = "0.1.0"
authors = ["Garrett Squire <redacted>"]
edition = "2018"
[dependencies]
lib = { path = "../lib" }
use lib::works;
fn main() {
works();
}
[package]
name = "lib"
version = "0.1.0"
authors = ["Garrett Squire <redacted>"]
edition = "2018"
[dependencies]
toolchain_find = "0.1"
use toolchain_find::find_installed_component;
pub fn works() {
println!("{:?}", find_installed_component("cargo-clippy"));
} Commands I ran: # Build entire package.
cargo build
# Run the binary.
cargo run -p bin Output: Some("/Users/garrett.squire/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo-clippy") |
In that structure, add another example crate, as I describe above and you should be able to reproduce it. |
I added another library crate to my example and still wasn't able to reproduce this. It would be helpful to see a gist or repository if you have one handy. Thanks! |
https://github.com/rust-iendo/debug_find_toolchain workspace = ".." , in all cases. It's a bit strange. Thank you. |
I pulled down that repository locally and was able to run the example crate without any problems. Per the documentation, the workspace properties in the For reference here are the steps I took:
Output: Finished dev [unoptimized + debuginfo] target(s) in 0.12s
Running `target/debug/example`
Some("/Users/garrett.squire/.rustup/toolchains/stable-x86_64-apple-darwin/bin/rustfmt") I'm sorry if I am misunderstanding you completely but I can't reproduce the bug you claim to have. |
I'm seeing you work on a Mac, I on a Linux, could this be? I want to use it in my derives, will not I have any problem? Is there coverage for all this? Thanks for your time. |
I have Docker on my system so I gave this a spin with your repository. Below are the steps I took to try and reproduce it: Dockerfile: FROM rust:1.33.0-slim
RUN rustup component add rustfmt
VOLUME ["/build"] Commands run: docker build . -t toolchain:latest
docker run --rm -it -v $PWD/debug_find_toolchain:/build -w /build/example toolchain cargo run Output: Finished dev [unoptimized + debuginfo] target(s) in 1m 19s
Running `target/debug/example`
Some("/usr/local/rustup/toolchains/1.33.0-x86_64-unknown-linux-gnu/bin/rustfmt") I added the |
Looks like it's ok. Could you add some coverage in these cases? It's not blocking for me, I just want to make sure. |
I'll have to think through how to add a test case. It seems like more of an integration test than a unit test to me. Thanks for your patience. |
Yes, a couple of e2e tests should be enough. |
Looks like you can run docker images in Travis CI. I'll look into automating the test I mentioned above. |
After doing tome more research it seems like this would introduce some complexity into the CI pipeline. I'm going to put this on the backlog for now and circle back around later. If you run into any more problems, feel free to make a new issue. |
Basically it is a structure of crate type workspace that is,
Example is in own workspace and the rest share the main workspace.
There is a problem looking for the path.
The text was updated successfully, but these errors were encountered: