Skip to content
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

Cargo can't run help sub-command in command line mode. #9197

Closed
tomaswuhua123 opened this issue Feb 23, 2021 · 6 comments · Fixed by #9378
Closed

Cargo can't run help sub-command in command line mode. #9197

tomaswuhua123 opened this issue Feb 23, 2021 · 6 comments · Fixed by #9378

Comments

@tomaswuhua123
Copy link

I don't know whether it's Cargo's bug or something wrong with my setting. Here is error in detail:
$ cargo help bench
//or other sub-command
And an error like this pop out:
No manual entry for ~\AppData\Local\Temp\cargo-manGE7Y90
Hope for help ,thanks a lot.

@ehuss
Copy link
Contributor

ehuss commented Feb 23, 2021

Hm, I'm not sure what could cause that. Could you provide some more information, such as what toolchain you are using?

The way it works, is that it writes the file to a temporary directory. Then, if you have a man executable in your PATH, it will run man with the path to that temp file. It is a bit unusual to have man on Windows, are you using something like mingw?

Do you have any of the following environment variables set?

  • TMP
  • TEMP
  • USERPROFILE

The thing that seems suspicious to me is the ~ character, though I am uncertain how that could be created.

@tomaswuhua123
Copy link
Author

Thanks for responding!
1.The toolchain I used to use is stable-x86_64-pc-windows-gnu, but now I'm using stable-x86_64-pc-windows-msvc
2.I'm sure I've never changed any environment variable like TEP
3.The ~character means my user directory, the full path is C:\Users\Myname\AppData\Local\Temp\cargo-mancpbmyf
4.For my own preference, I didn't install my Cargo as default but I installed it as D:\Rustlang\Cargo
5.I used to use mingw, but since I changed my toolchain, I've deleted it.
That's all I think about my settings, and I'm trying to solve this under your hint.

@ehuss
Copy link
Contributor

ehuss commented Feb 24, 2021

You might try running which man and man --version to figure out where the man executable is coming from (it is somewhere in the PATH).

@tomaswuhua123
Copy link
Author

Thanks for your help, I found it's my cygwin64 acting wrongly, which is the man executable comes from. When I remove my cygwin64 from my environment variable, everything get Ok. My cargo help runs well, thank you.

@rmccampbell
Copy link

I encountered this same problem. I think this should be considered a bug; rust on windows should ignore any man found in the path and just use the default behavior.

@ehuss
Copy link
Contributor

ehuss commented Apr 19, 2021

Sorry, I meant to reopen this issue. I have posted a fix at #9378.

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 a pull request may close this issue.

3 participants