Skip to content

"Fix" the tool not working on Windows #23

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

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

panstromek
Copy link
Contributor

@panstromek panstromek commented Jun 11, 2020

fixes #18

Well.. sort of. It's not really a fix, it's more like ¯\_(ツ)_/¯

After a lot of digging, I found out that the compilation actually runs just fine and the llvm-ir gets generated and we can read it, but the piped cargo process just fails mysteriously. Sadly, this infamous Windows error message ("Cannot find the file specified") doesn't give the name of the file or any other context, so I have no idea how to find out what actually happened or how to fix it. So in the end, I changed the code to just ignore the error and try to read the llvm-ir anyway. This is not ideal, but it at least makes it work on Windows and I feel like it's fine for a tool like this.

That said, I found out that this error isn't thrown if I comment out this line in pipe_to method

*self = Command::new(out[0])

This effectively disables the piping through cat (I think).

The problem is that I don't know if that would be ok to do. Can we just not pipe through cat? Can that break something on Linux maybe? It's hard for me to understand why is it written this way so I can't really tell. Let me know what do you think would be a good way to resolve this.

btw. Some new comments from @nnethercote were really helpful in the process, so big 👏 👏 for that. Last time I had a lot more trouble understanding it ;)

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay dtolnay merged commit 0d2a3ba into dtolnay:master Jun 12, 2020
@panstromek panstromek deleted the fix-windows branch June 12, 2020 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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