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

Dottydoc generation broken on Windows because of illegal filenames #3349

Closed
smarter opened this Issue Oct 18, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@smarter
Member

smarter commented Oct 18, 2017

As reported on gitter recently by @DSouzaM:

[doc info] Generating doc page for: dotty.tools.repl.terminal.LazyList$.~:$                                        
Exception in thread "main" java.nio.file.FileSystemException: /mnt/c/Users/mattd_000/Documents/code/dotty/docs/_sit
e/api/dotty/tools/repl/terminal/LazyList$/~:$.html: Invalid argument

The corresponding classfile is called LazyList$$tilde$colon$.class, we should use the same encoding (obtained with the method Name#mangledString) for the html files. According to @felixmulder the relevant code is at

val target = mkdirs(fs.getPath(outDir.getAbsolutePath + "/api/" + e.path.mkString("/") + suffix))

@philwalk

This comment has been minimized.

Show comment
Hide comment
@philwalk

philwalk Oct 24, 2017

Because the Invalid Argument path '/mnt/c/Users/mattd_000/Documents/...' begins with /mnt/, I'm assuming that this exception occurred in WSL (Windows Subsystem for Linux), which permits colons in filenames of files created by the JVM. If this did occur under WSL, then #3373 is unrelated.

To demonstrate the difference, the following scala script fails under cygwin, but passes under WSL:

object ColonFilename extends App {
  val file = new java.io.File("1:2:3")
  file.createNewFile
}

The relevant difference between the two windows environments is that the cygwin environment depends on a Windows version of the JVM, whereas WSL uses an Ubuntu Linux JVM version.

philwalk commented Oct 24, 2017

Because the Invalid Argument path '/mnt/c/Users/mattd_000/Documents/...' begins with /mnt/, I'm assuming that this exception occurred in WSL (Windows Subsystem for Linux), which permits colons in filenames of files created by the JVM. If this did occur under WSL, then #3373 is unrelated.

To demonstrate the difference, the following scala script fails under cygwin, but passes under WSL:

object ColonFilename extends App {
  val file = new java.io.File("1:2:3")
  file.createNewFile
}

The relevant difference between the two windows environments is that the cygwin environment depends on a Windows version of the JVM, whereas WSL uses an Ubuntu Linux JVM version.

rsoeldner added a commit to rsoeldner/dotty that referenced this issue Oct 30, 2017

rsoeldner added a commit to rsoeldner/dotty that referenced this issue Oct 30, 2017

rsoeldner added a commit to rsoeldner/dotty that referenced this issue Oct 31, 2017

rsoeldner added a commit to rsoeldner/dotty that referenced this issue Oct 31, 2017

smarter added a commit to dotty-staging/dotty that referenced this issue Mar 23, 2018

Fix lampepfl#3349: Fix dottydoc filenames for Windows
Many characters are forbidden in Windows filenames, mangled names are
used for classfiles so they should be safe.

Also make factories#path more efficient.

smarter added a commit to dotty-staging/dotty that referenced this issue Mar 23, 2018

Fix lampepfl#3349: Fix dottydoc filenames for Windows
Many characters are forbidden in Windows filenames, mangled names are
used for classfiles so they should be safe.

Also make factories#path more efficient.

@smarter smarter closed this in 54ccac6 Mar 24, 2018

smarter added a commit that referenced this issue Mar 24, 2018

Merge pull request #4171 from dotty-staging/fix/dottydoc-windows
Fix #3349: Fix dottydoc filenames for Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment