mozilla-mobile / firefox-echo-show

Firefox for Amazon's Echo Show
Mozilla Public License 2.0
25 stars 12 forks source link

IllegalStateException: File name too long when compiling unit tests #247

Closed mcomella closed 5 years ago

mcomella commented 5 years ago

Steps to reproduce

Expected behavior

Successful compile.

Actual behavior

e: java.lang.IllegalStateException: Backend Internal error: Exception during code generation
Cause: /home/mcomella/dev/moz/firefox-echo-show/app/build/tmp/kotlin-classes/amazonWebviewDebugUnitTest/org/mozilla/focus/ext/LiveDataPostIfNewTest$GIVEN old value was posted AND a different value was posted WHEN the original value is posted again THEN three total values should have been emitted$1.class (File name too long)
File being compiled at position: file:///home/mcomella/dev/moz/firefox-echo-show/app/src/test/java/org/mozilla/focus/ext/LiveDataPostIfNewTest.kt
The root cause was thrown at: FileOutputStream.java:-2

It looks like we're unable to save the class file because the name of the generated class (from the lambda?) is too long.

Device information

I'm running ubuntu 18.04 on ext4: I'm guessing APFS (or whatever) on macOS has a longer file name limit (ext4 seems to be 255 bytes; APFS is 255 UTF-8 characters).

mcomella commented 5 years ago

Action item: probably just shorten the test name.

kartikgits commented 5 years ago

I'm a beginner and would like to work on it.

mcomella commented 5 years ago

Hello @kartikgits ! Feel free to get started. First, get the project set up with Android Studio. Then try to follow the steps to reproduce above: run ./gradlew assembleamazonwebviewdebugunittest from the command line. If you're able to reproduce, great! If not, you can make our suggested speculative fix: just shorten the test name (the one on line 2 of the error message above) but still try to keep it meaningful.

If you have questions, please @ mention me and let me know.

unicorn-io commented 5 years ago

By any chance is this issue solved? If no, I am a beginner can I contribute to it?

mcomella commented 5 years ago

@unicorn-io I don't believe it's solved: the test still exists in the code base. However, I don't have my ubuntu machine right now to test for sure. If you want to take this bug, feel free!

unicorn-io commented 5 years ago

I'll take it then😊

unicorn-io commented 5 years ago

@mcomella I'm not able to reproduce it, can you help me with this!

mcomella commented 5 years ago

@unicorn-io If you can't reproduce, unfortunately, I think it's going to be hard to fix this one – sorry about that!

Maybe you'd like to try to address https://github.com/mozilla-mobile/firefox-tv/issues/1247 on Firefox for Fire TV? I think it's a good starter issue. btw, you can find us on IRC in the #focus channel during PT working hours (~9am - 5pm, Monday - Friday): feel free to ask for help there for faster communication!

mcomella commented 5 years ago

See https://github.com/mozilla-mobile/firefox-tv/issues/1868 – this was a problem with my environment, specifically my file system encryption.