IOException on compilation (filename too long). #10
Comments
I am facing this issue as well. Compiler crashes. import scala.pickling._
import binary._
object Enclose {
case class Test1(s: String, t: List[(String, Test2)])
case class Test2(s: String, i: Int, o: Option[String])
}
object Application extends App {
import Enclose._
val pl = Test1("some string", List(("some string", Test2("some string", 23, Some("some string"))))).pickle
println(pl)
println(pl.unpickle[Test1])
} uncaught exception during compilation: java.io.IOException Error log: http://pastebin.com/rB87zrb4 |
Thanks for the reports. This is on our shortlist, will try to get to the bottom of it shortly :) Thanks for your patience! |
I ran across this bug report while trying to figure out a similar problem (on a different Scala project). In case it helps, this mail is reporting similar failures when compiling inside an Ubuntu encrypted home directory. Not sure if it's the problem here but thought I'd drop in a comment. |
I'm getting the same compiler error: I tried to set -Xmax-classfile-name to 255, the max value, (must be in range 72 to 255 inclusive). The weird thing is, if you set the max size to 72 <= size <= 254, it works. 255 breaks it. |
So the workaround is adding this to build.sbt:
scala-pickling seems to generate so insanely long filenames that it's almost scary. I think there should be fair warning about this on the documentation, because if you use real package names instead of just toying around, you hit the problem pretty much instantly. |
This problem really occurs on encrypted home folders in Ubuntu. |
Same here, this problem occurs when I do it in my encrypted home directory, doesn't elsewhere. |
I have the same issue but my drive is not encrypted. I've tried moving my project out of my /home folder (even moved it on to a usb stick to be certain it wasn't encrypted) and still get the issue! I have a Play! project that uses pickle. I added: to Build.scala but made no difference! I'm stuck, any ideas? |
Ok. This is very odd. On the play! command line if I run 'clean' then 'compile' I get:
if I then run 'compile' a second time then it succeeds! |
This problem really occurs on encrypted home folders in Ubuntu. |
That workaround does not help on encrypted filesystems like encfs/cryptfs because it limits the plaintext filename length only. The filename encryption can create much longer filenames that hit the maximum filename length in the underlying filesystem, so when running on encfs/cryptfs you need a much much lower limit for "-Xmax-classfile-name". |
Well as I stated previously, I do not have an encrypted file system (I checked, I also moved my project to a usb stick and the problem remained). Running 'clean' and then 'compile' causes the error. Running 'compile' a second time works with no error! Its all very odd behaviour. |
Ok, this error is too random to reliably reproduce. I can't seem to recreate it at all now. Not sure if restarting my computer this morning altered the state of something somewhere on my machine. Thanks guys for the tips anyway |
At least we know some approaches to fix the problem. |
This might also be related to: https://issues.scala-lang.org/browse/SI-8199 There is sort of an off-by-one error in the limit. I'm fixing this in 2.11.0 |
I had the same problem compiling playframework 2.2.2 from sources, restricting the file size to 254 did not help, moving the sources to unencrypted directory did the trick. I am on ubunutu as well. |
Hi, Just link your project target directory to a directory outside the encrypted directory. From inside you project directory (the directory containing the target folder) run this command: ln -s /tmp target Note: Cleaning your build (e.g. using 'sbt clean') may delete the target soft link and recreate the original directory, which will again give you the 'file name too long' issue, so after doing sbt clean, just delete the new target directory and create the link again. rm -r -f target/ Cheers, p.s. Take care when using commands like rm -r -f on linux ;-) |
* fixes problems with compiling on encrypted harddrives * as per: <scala/pickling#10>
…g in docker-alpine-linux without that fails with scala/scala@d8c7850 or scala/pickling#10
…ng in docker-alpine-linux without that fails with scala/scala@d8c7850 or scala/pickling#10
I get this error on CircleCI. I am assuming that it's due to encrypted file system but it only occurs where I use pickling so I think it still qualifies as a bug in pickling. |
The following is fine:
When I add this line, I get a 658-line long compile-time exception:
error log: https://gist.github.com/Synesso/e2d39de5be20e7f302be
The text was updated successfully, but these errors were encountered: