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 help <command> doesn't work on Windows #9291

Closed
inliquid opened this issue Mar 20, 2021 · 7 comments
Closed

cargo help <command> doesn't work on Windows #9291

inliquid opened this issue Mar 20, 2021 · 7 comments
Labels
A-cli-help Area: built-in command-line help C-bug Category: bug

Comments

@inliquid
Copy link

cargo help doesn't work on clean Windows installation.

Steps
Just run any help command, such as cargo help init:

C:\Users\***>cargo help build
No manual entry for C:\Users\***\AppData\Local\Temp\cargo-man07xxpc

Notes

Output of cargo version:

cargo 1.50.0 (f04e7fab7 2021-02-04)
@inliquid inliquid added the C-bug Category: bug label Mar 20, 2021
@ehuss
Copy link
Contributor

ehuss commented Mar 22, 2021

Thanks for the report! The built-in help uses the man command to display the help page if man can be found in PATH. This seems to be finding a man executable that maybe doesn't support Windows file paths.

It looks like you might be using cmd. Can you check your PATH environment variable and find where the man executable is coming from? I suspect it is something like msys2 or cygwin. When running those commands outside of the cygwin path translation environment, passing Windows-style paths doesn't work.

@ehuss ehuss added the A-cli-help Area: built-in command-line help label Mar 22, 2021
@inliquid
Copy link
Author

Apparently man is coming from c:\cygwin64\bin which is cygwin installation as you suggested, and cargo was run from plain cmd. However it looks like error is the same when command is run from cygwin terminal:

<username>@<hostname> ~
$ cargo help build
No manual entry for C:\cygwin64\tmp\cargo-maneMpHvV

@ehuss
Copy link
Contributor

ehuss commented Mar 22, 2021

Yea, Cargo is not aware of cygwin-style paths. I thought I had tested this, but I can confirm it doesn't work. I think the code should just be changed to not try to run man on windows at all.

@inliquid
Copy link
Author

Does it mean that cargo help <command> won't work at all on Windows? That would be unfortunate. Other tools workaround this, for instance:

  • git help <...> opens a web browser with (locally stored) *.html man page
  • go help <...> doesn't rely on man, instead it just outputs text to stdout. So I can read it as go help <...> | less on any platform. Even on Windows without cygwin I can still run go help <...> | more or can just scroll it in terminal.

@ehuss
Copy link
Contributor

ehuss commented Mar 23, 2021

It works, it just isn't formatted with underlines/bold/word-wrapping, etc.

@inliquid
Copy link
Author

Ah, ok then.

@ehuss
Copy link
Contributor

ehuss commented May 5, 2021

I'm going to close this as fixed by #9378. I somehow didn't recognize that this was essentially the same as #9197. I'd appreciate it if you could try with the most recent nightly and let me know if it still doesn't work.

@ehuss ehuss closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli-help Area: built-in command-line help C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants