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

Handle man pages better on Windows. #9378

Merged
merged 1 commit into from
Apr 19, 2021
Merged

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Apr 19, 2021

If a user has man installed on Windows via msys/mingw/etc, then cargo help <subcommand> would fail with No manual entry for C:\Users\User\AppData\Local\Temp\cargo-manlSKwTQ. This is because the cygwin universe does not handle windows-style paths and does not auto-translate in this scenario.

The solution here is to run the command from within the temp directory and use a relative path which should work on all platforms and environments. I tested on windows (powershell, cmd, and mingw), macos, and linux.

Fixes #9197

@rust-highfive
Copy link

r? @alexcrichton

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 19, 2021
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Apr 19, 2021

📌 Commit 1a3bb39 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 19, 2021
@bors
Copy link
Collaborator

bors commented Apr 19, 2021

⌛ Testing commit 1a3bb39 with merge 905af54...

@bors
Copy link
Collaborator

bors commented Apr 19, 2021

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing 905af54 to master...

@bors bors merged commit 905af54 into rust-lang:master Apr 19, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 24, 2021
Update cargo, rls

## cargo

18 commits in 65d57e6f384c2317f76626eac116f683e2b63665..0ed318d182e465cd66071b91ac3d265af63ef8a1
2021-04-04 15:07:52 +0000 to 2021-04-23 20:54:54 +0000
- Restore crates.io's `SourceId` hash value to before (rust-lang/cargo#9397)
- Fix loading `branch=master` patches in the v3 lock transition (rust-lang/cargo#9392)
- Update changelog for 1.52 beta changes. (rust-lang/cargo#9396)
- Fix build-std updating the index on every build. (rust-lang/cargo#9393)
- Fix typo in profile docs (rust-lang/cargo#9386)
- Fix disagreement about lockfile ordering on stable/nightly (rust-lang/cargo#9384)
- Don't give a hard error when the end-user specifies RUSTC_BOOTSTRAP=crate_name (rust-lang/cargo#9365)
- Fix rust-lang/cargo#9350 (cargo build -Z help is missing options) (rust-lang/cargo#9369)
- an struct -&gt; a struct (rust-lang/cargo#9379)
- Handle man pages better on Windows. (rust-lang/cargo#9378)
- fix: better error message when dependency/workspace member missing (rust-lang/cargo#9368)
- Fix typo in book (rust-lang/cargo#9376)
- Don't re-use rustc cache when RUSTC_WRAPPER changes (rust-lang/cargo#9348)
- doc: add split-debuginfo doc in config chapter (rust-lang/cargo#9372)
- refactor: remove `CargoResultExt` (rust-lang/cargo#9367)
- Track "CARGO" in environment fingerprint. (rust-lang/cargo#9363)
- Update clippy lint allow set. (rust-lang/cargo#9356)
- Fix 'suport' typo in documentation (rust-lang/cargo#9338)

## rls

3 commits in 32c0fe006dcdc13e1ca0ca31de543e4436c1299e..74d1800c25498689c5b5120a1e8495fce0cd0d0d
2021-04-12 11:21:12 +0000 to 2021-04-22 21:29:51 +0000
- Bump default integration test message timeout to 30s (rust-lang/rls#1731)
- itertools = 0.9, fst = 0.4 (rust-lang/rls#1729)
- Update cargo (rust-lang/rls#1728)
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 24, 2021
Update cargo, rls

## cargo

18 commits in 65d57e6f384c2317f76626eac116f683e2b63665..0ed318d182e465cd66071b91ac3d265af63ef8a1
2021-04-04 15:07:52 +0000 to 2021-04-23 20:54:54 +0000
- Restore crates.io's `SourceId` hash value to before (rust-lang/cargo#9397)
- Fix loading `branch=master` patches in the v3 lock transition (rust-lang/cargo#9392)
- Update changelog for 1.52 beta changes. (rust-lang/cargo#9396)
- Fix build-std updating the index on every build. (rust-lang/cargo#9393)
- Fix typo in profile docs (rust-lang/cargo#9386)
- Fix disagreement about lockfile ordering on stable/nightly (rust-lang/cargo#9384)
- Don't give a hard error when the end-user specifies RUSTC_BOOTSTRAP=crate_name (rust-lang/cargo#9365)
- Fix rust-lang/cargo#9350 (cargo build -Z help is missing options) (rust-lang/cargo#9369)
- an struct -&gt; a struct (rust-lang/cargo#9379)
- Handle man pages better on Windows. (rust-lang/cargo#9378)
- fix: better error message when dependency/workspace member missing (rust-lang/cargo#9368)
- Fix typo in book (rust-lang/cargo#9376)
- Don't re-use rustc cache when RUSTC_WRAPPER changes (rust-lang/cargo#9348)
- doc: add split-debuginfo doc in config chapter (rust-lang/cargo#9372)
- refactor: remove `CargoResultExt` (rust-lang/cargo#9367)
- Track "CARGO" in environment fingerprint. (rust-lang/cargo#9363)
- Update clippy lint allow set. (rust-lang/cargo#9356)
- Fix 'suport' typo in documentation (rust-lang/cargo#9338)

## rls

3 commits in 32c0fe006dcdc13e1ca0ca31de543e4436c1299e..74d1800c25498689c5b5120a1e8495fce0cd0d0d
2021-04-12 11:21:12 +0000 to 2021-04-22 21:29:51 +0000
- Bump default integration test message timeout to 30s (rust-lang/rls#1731)
- itertools = 0.9, fst = 0.4 (rust-lang/rls#1729)
- Update cargo (rust-lang/rls#1728)
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2021
Update cargo, rls

## cargo

18 commits in 65d57e6f384c2317f76626eac116f683e2b63665..0ed318d182e465cd66071b91ac3d265af63ef8a1
2021-04-04 15:07:52 +0000 to 2021-04-23 20:54:54 +0000
- Restore crates.io's `SourceId` hash value to before (rust-lang/cargo#9397)
- Fix loading `branch=master` patches in the v3 lock transition (rust-lang/cargo#9392)
- Update changelog for 1.52 beta changes. (rust-lang/cargo#9396)
- Fix build-std updating the index on every build. (rust-lang/cargo#9393)
- Fix typo in profile docs (rust-lang/cargo#9386)
- Fix disagreement about lockfile ordering on stable/nightly (rust-lang/cargo#9384)
- Don't give a hard error when the end-user specifies RUSTC_BOOTSTRAP=crate_name (rust-lang/cargo#9365)
- Fix rust-lang/cargo#9350 (cargo build -Z help is missing options) (rust-lang/cargo#9369)
- an struct -&gt; a struct (rust-lang/cargo#9379)
- Handle man pages better on Windows. (rust-lang/cargo#9378)
- fix: better error message when dependency/workspace member missing (rust-lang/cargo#9368)
- Fix typo in book (rust-lang/cargo#9376)
- Don't re-use rustc cache when RUSTC_WRAPPER changes (rust-lang/cargo#9348)
- doc: add split-debuginfo doc in config chapter (rust-lang/cargo#9372)
- refactor: remove `CargoResultExt` (rust-lang/cargo#9367)
- Track "CARGO" in environment fingerprint. (rust-lang/cargo#9363)
- Update clippy lint allow set. (rust-lang/cargo#9356)
- Fix 'suport' typo in documentation (rust-lang/cargo#9338)

## rls

3 commits in 32c0fe006dcdc13e1ca0ca31de543e4436c1299e..74d1800c25498689c5b5120a1e8495fce0cd0d0d
2021-04-12 11:21:12 +0000 to 2021-04-22 21:29:51 +0000
- Bump default integration test message timeout to 30s (rust-lang/rls#1731)
- itertools = 0.9, fst = 0.4 (rust-lang/rls#1729)
- Update cargo (rust-lang/rls#1728)
@HerbM
Copy link

HerbM commented May 8, 2021

@Dylan-DPC @bors @ehuss

Mostly FYI:

Using "cargo help clean" this problem is occurring 4 days after "Closed" day on above message referencing the commit to master while using Rust nightly from 3 days post Close:

However, cargo is still a week old which would predate the merge.

Apparently rustup didn't fetch the most recent cargo with the nightly fetch yesterday.
(Don't now if that is by design or not.)

Default host: x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc (default)
rustc 1.54.0-nightly (770792ff8 2021-05-07)

cargo 1.53.0-nightly (f3e13226d 2021-04-30)

Syncing rustup update again (just now) shows up to date as above:

nightly-x86_64-pc-windows-msvc unchanged - rustc 1.54.0-nightly (770792ff8 2021-05-07)

And yes, my issue is due to a copy of "man.exe" on the path in PowerShell.
(And it's just the simple "gnu Win32" version so probably stupid about paths.)

My solution is currently to just rename that man.exe, which may not be a solution for everyone.

Thanks for all your hard work and how well Cargo (and most of the rust infrastructure works on Windows.)

@ehuss
Copy link
Contributor Author

ehuss commented May 8, 2021

The date in the version string is the last git commit, not the date when it was built. That is the latest version.

Can you file a new issue with the exact error message that is displayed? And, can you clarify, what is a "simple gnu Win32 version"? Where did you get it? What is the version of man that you are using?

@HerbM
Copy link

HerbM commented May 9, 2021

Exact error with that man.exe on path (see below for source of program):

#> cargo help build
/usr/local/lib/man.config: No such file or directory
Warning: cannot open configuration file /usr/local/lib/man.config
No manual entry for ./cargo-build.60m2LW

The only reason for mentioning it was to alert you if this meant the 'fix' either didn't work fully or perhaps had somehow not made the release (when it should have done so.)

I thought that this man.exe came from GNU utilities for Win32 UnxUtils http://unxutils.sourceforge.net/ but man but there is no "man" in the zip available there now. It lists itself as: "version 1.4h".

It's very old and almost certainly of little value (I didn't mind renaming it.) Definitely not from CygWin or one of he modern sources like MSys2. It's only on my machine because I've long been a user of Unix and Linux utilities available for Windows and was acquired with other items like grep or sed that were of more common use to me.

@ehuss ehuss added this to the 1.53.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cargo can't run help sub-command in command line mode.
5 participants