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

Rustdoc fails on modules with reserved file names #86458

Open
vihdzp opened this issue Jun 19, 2021 · 3 comments
Open

Rustdoc fails on modules with reserved file names #86458

vihdzp opened this issue Jun 19, 2021 · 3 comments
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@vihdzp
Copy link

vihdzp commented Jun 19, 2021

Problem
Adding a module named con, nul, or any other reserved name on Windows causes Rustdoc to fail.

Steps

  1. Add an empty module named con.
  2. Run cargo doc.

Possible Solution(s)
A fix similar to #83612 should get rid of this issue.

Notes

I'm on Windows 10. I haven't tested this, but I'm almost certain this bug should exist in all other versions of Windows, and in no other operating system.

@vihdzp vihdzp added the C-bug Category: This is a bug. label Jun 19, 2021
@ChrisDenton
Copy link
Member

ChrisDenton commented Jun 19, 2021

Full list of redirected names:

  • AUX
  • CON
  • CONIN$
  • CONOUT$
  • COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, COM², COM³, COM¹
  • LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9, LPT², LPT³, LPT¹
  • NUL
  • PRN

By default Windows will rewrite paths containing these filenames to a legacy dos device path. So, for example:

C:\path\to\docs\con.something.html

Becomes:

\\.\CON

While this behaviour can be disabled using verbatim paths (i.e. using the \\?\ prefix), this still leaves files which would be hard for the user to access.

@inquisitivecrystal
Copy link
Contributor

@rustbot label +A-rustdoc +T-rustdoc

@rustbot rustbot added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc labels Jun 20, 2021
@Stupremee Stupremee added the O-windows Operating system: Windows label Jun 21, 2021
@jyn514
Copy link
Member

jyn514 commented Aug 16, 2021

This is basically #25879 - I'll leave this open so we remember to add a test case, but I expect the fixes to look very similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants