From cb8d924ab894cb3fb2b0e6cfe2fc41afc0b52457 Mon Sep 17 00:00:00 2001 From: stusmall Date: Sun, 2 Aug 2015 20:31:15 -0600 Subject: 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. --- src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index a34ab914ef..fca0582539 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -532,6 +532,10 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self => case e: java.lang.RuntimeException if e.getMessage != null && (e.getMessage contains "too large!") => reporter.error(sym.pos, s"Could not write class $jclassName because it exceeds JVM code size limits. ${e.getMessage}") + case e: java.io.IOException if e.getMessage != null && (e.getMessage contains "File name too long") => + reporter.error(sym.pos, e.getMessage + "\n" + + "This can happen on some encrypted or legacy file systems. Please see SI-3623 for more details.") + } } -- cgit v1.2.3