8000 SI-3623 Improved error message for "filename too long" build errors · scala/scala-dev@cb8d924 · GitHub
[go: up one dir, main page]

Skip to content

Commit cb8d924

Browse files
committed
SI-3623 Improved error message for "filename too long" build errors
When building on ecryptfs filenames can be limited to ~142 characters. This limit doesn't take long to hit and can leave the the user with a hard to diagnosis error message. Some legacy file systems will have similarly small limits. This just adds a hint that the error might be related to the underlying fs.
1 parent a745f06 commit cb8d924

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,10 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self =>
532532
case e: java.lang.RuntimeException if e.getMessage != null && (e.getMessage contains "too large!") =>
533533
reporter.error(sym.pos,
534534
s"Could not write class $jclassName because it exceeds JVM code size limits. ${e.getMessage}")
535+
case e: java.io.IOException if e.getMessage != null && (e.getMessage contains "File name too long") =>
536+
reporter.error(sym.pos, e.getMessage + "\n" +
537+
"This can happen on some encrypted or legacy file systems. Please see SI-3623 for more details.")
538+
535539
}
536540
}
537541

0 commit comments

Comments
 (0)
0