dtolnay / cargo-llvm-lines

Count lines of LLVM IR per generic function

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting "the system cannot find the file specified. (os error 2)" on Windows

panstromek opened this issue · comments

Running cargo llvm-lines inside fresh project ends with "file not found" message from OS. At first I thought this package doesn't work on Windows but then I saw that the support was added in #8, but I can't really tell what's wrong or which file it can't find...

Steps to reproduce:

cargo init llvmlinestest
cd llvmlinestest
cargo llvm-lines

Output:

   Compiling llvmlinestest v0.1.0 (C:\Users\panstromek\IdeaProjects\llvmlinestest)
    Finished dev [unoptimized + debuginfo] target(s) in 0.33s
the system cannot find the file specified. (os error 2)

So I tried to debug this a bit and I found that the offeding line is /src/main:rs::91 :

let _wait = cmd.pipe_to(&[OsStr::new("cat")], &filter_cargo)?;

If I comment it out, it prints the results (seemingly correctly?). At first I though it's because cmd doesn't have cat, but after trying it with powershell (which has cat) or using type (which is Windows equivalent of cat) I still got the same error so now I am bit confused about what's is the real problem.

I am now trying to dig into the pipe_to but I don't actually understand much what's the purpose of that piping there.