Skip to content
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

File name too long #1077

Closed
dours opened this issue Aug 22, 2022 · 21 comments
Closed

File name too long #1077

dours opened this issue Aug 22, 2022 · 21 comments
Assignees
Labels

Comments

@dours
Copy link
Contributor

dours commented Aug 22, 2022

Translation of python code with several (say, 4) levels of structural control flow hierarchy (i.e, an if clause inside a double for loop inside a function) leads to EO code with an hierarchy of about 40 objects in my case. Java files for this EO code have too long file names (for Ubuntu 20!), so the compilation process fails.

The easiest way to reproduce this problem is to use this EO generator:

print("+package org.eolang\n")

print("[] > test")
space = 0
for i in range(1, 40):
    space = (" " * (i * 2))
    print(space + "blah > @")
    print(space + "[] > blah")
print(space + "  TRUE > @")
@yegor256
Copy link
Member

@mximp can we do something about this?

@mximp
Copy link
Contributor

mximp commented Aug 24, 2022

@dours Can you please provide example of Java name the parser is trying to produce?

@dours
Copy link
Contributor Author

dours commented Aug 25, 2022

@mximp , yes:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project test: Compilation failure
[ERROR] /home/bogus/py2eo/runEO/target/generated-test-sources/EOorg/EOeolang/EOnested_for_break_continueTest.java:[6639,14] error while writing EOorg.EOeolang.EOnested_for_break_continueTest.EOω1apply.EOω2φ.EOω3t42$EOt1$EOa1.EOω4apply.EOω5φ.EOω6t41$EOt30$EOt1$EOa0.EOω7t4$EOt0$EOt1$EOa0.EOω8t1$EOt0$EOa1.EOω9t2$EOt0$EOt1$EOa0.EOω10t2$EOt15$EOt1$EOa0.EOω11t4$EOt0$EOt1$EOa0.EOω12t1$EOt0$EOa1.EOω13t2$EOt0$EOt1$EOa0: /home/bogus/py2eo/runEO/target/test-classes/EOorg/EOeolang/EOnested_for_break_continueTest$EOω1apply$EOω2φ$EOω3t42$EOt1$EOa1$EOω4apply$EOω5φ$EOω6t41$EOt30$EOt1$EOa0$EOω7t4$EOt0$EOt1$EOa0$EOω8t1$EOt0$EOa1$EOω9t2$EOt0$EOt1$EOa0$EOω10t2$EOt15$EOt1$EOa0$EOω11t4$EOt0$EOt1$EOa0$EOω12t1$EOt0$EOa1$EOω13t2$EOt0$EOt1$EOa0.class: File name too long

@dours
Copy link
Contributor Author

dours commented Sep 1, 2022

@mximp Do you have an estimate on how long will it take to fix this one? Is it complicated? It currently blocks around 5 tests in the py2eo translator, I would like to know if I need to think about a workaround.

@mximp
Copy link
Contributor

mximp commented Sep 1, 2022

@dours should be finished by tomorrow

@mximp
Copy link
Contributor

mximp commented Sep 7, 2022

@dours fixed. please check & close

@yegor256
Copy link
Member

yegor256 commented Sep 7, 2022

@rultor release, tag is 0.28.2

@rultor
Copy link
Contributor

rultor commented Sep 7, 2022

@rultor release, tag is 0.28.2

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Contributor

rultor commented Sep 7, 2022

@rultor release, tag is 0.28.2

@dours @yegor256 Oops, I failed. You can see the full log here (spent 3min)

[\u001b[1;34mINFO\u001b[m] Running EOorg.EOeolang.\u001b[1mEOnamed_inner_abstract_objectTest\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1;32mTests run: \u001b[0;1;32m1\u001b[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in EOorg.EOeolang.\u001b[1mEOnamed_inner_abstract_objectTest\u001b[m
[\u001b[1;34mINFO\u001b[m] Running EOorg.EOeolang.\u001b[1mEOwrite_and_read_without_errorTest\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1;32mTests run: \u001b[0;1;32m1\u001b[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in EOorg.EOeolang.\u001b[1mEOwrite_and_read_without_errorTest\u001b[m
[\u001b[1;34mINFO\u001b[m] Running EOorg.EOeolang.\u001b[1mEOarray_as_a_bound_attribute_size_1Test\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1;32mTests run: \u001b[0;1;32m1\u001b[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in EOorg.EOeolang.\u001b[1mEOarray_as_a_bound_attribute_size_1Test\u001b[m
[\u001b[1;34mINFO\u001b[m] Running EOorg.EOeolang.\u001b[1mEOtimes_by_zeroTest\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1;32mTests run: \u001b[0;1;32m1\u001b[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in EOorg.EOeolang.\u001b[1mEOtimes_by_zeroTest\u001b[m
[\u001b[1;34mINFO\u001b[m] Running EOorg.EOeolang.\u001b[1mEOavoid_infinite_loop_second_caseTest\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1;32mTests run: \u001b[0;1;32m1\u001b[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in EOorg.EOeolang.\u001b[1mEOavoid_infinite_loop_second_caseTest\u001b[m
[\u001b[1;34mINFO\u001b[m] Running EOorg.EOeolang.\u001b[1mEOconstant_defends_against_side_effectsTest\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1;32mTests run: \u001b[0;1;32m1\u001b[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in EOorg.EOeolang.\u001b[1mEOconstant_defends_against_side_effectsTest\u001b[m
[\u001b[1;34mINFO\u001b[m] Running EOorg.EOeolang.\u001b[1mEOcomplex_bool_expression_in_whileTest\u001b[m
4
3
2
1
0
[\u001b[1;34mINFO\u001b[m] \u001b[1;32mTests run: \u001b[0;1;32m1\u001b[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.03 s - in EOorg.EOeolang.\u001b[1mEOcomplex_bool_expression_in_whileTest\u001b[m
[\u001b[1;34mINFO\u001b[m] Running EOorg.EOeolang.\u001b[1mEOtimes_two_negativesTest\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1;32mTests run: \u001b[0;1;32m1\u001b[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in EOorg.EOeolang.\u001b[1mEOtimes_two_negativesTest\u001b[m
[\u001b[1;34mINFO\u001b[m] 
[\u001b[1;34mINFO\u001b[m] Results:
[\u001b[1;34mINFO\u001b[m] 
[\u001b[1;31mERROR\u001b[m] \u001b[1;31mFailures: \u001b[m
[\u001b[1;31mERROR\u001b[m] \u001b[1;31m  RamTest.writesAndReads:79 
Expected: is "world"
     but: was "ellod"\u001b[m
[\u001b[1;34mINFO\u001b[m] 
[\u001b[1;31mERROR\u001b[m] \u001b[1;31mTests run: 419, Failures: 1, Errors: 0, Skipped: 0\u001b[m
[\u001b[1;34mINFO\u001b[m] 
[\u001b[1;34mINFO\u001b[m] \u001b[1m------------------------------------------------------------------------\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1mReactor Summary for eo 0.28.2:\u001b[m
[\u001b[1;34mINFO\u001b[m] 
[\u001b[1;34mINFO\u001b[m] eo ................................................. \u001b[1;32mSUCCESS\u001b[m [  8.100 s]
[\u001b[1;34mINFO\u001b[m] eo-parser .......................................... \u001b[1;32mSUCCESS\u001b[m [ 23.614 s]
[\u001b[1;34mINFO\u001b[m] eo-maven-plugin .................................... \u001b[1;32mSUCCESS\u001b[m [ 28.515 s]
[\u001b[1;34mINFO\u001b[m] eo-runtime ......................................... \u001b[1;31mFAILURE\u001b[m [01:17 min]
[\u001b[1;34mINFO\u001b[m] \u001b[1m------------------------------------------------------------------------\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1;31mBUILD FAILURE\u001b[m
[\u001b[1;34mINFO\u001b[m] \u001b[1m------------------------------------------------------------------------\u001b[m
[\u001b[1;34mINFO\u001b[m] Total time:  02:18 min
[\u001b[1;34mINFO\u001b[m] Finished at: 2022-09-07T12:17:46Z
[\u001b[1;34mINFO\u001b[m] \u001b[1m------------------------------------------------------------------------\u001b[m
[\u001b[1;31mERROR\u001b[m] Failed to execute goal \u001b[32morg.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test\u001b[m \u001b[1m(default-test)\u001b[m on project \u001b[36meo-runtime\u001b[m: \u001b[1;31mThere are test failures.\u001b[m
[\u001b[1;31mERROR\u001b[m] \u001b[1;31m\u001b[m
[\u001b[1;31mERROR\u001b[m] \u001b[1;31mPlease refer to /home/r/repo/eo-runtime/target/surefire-reports for the individual test results.\u001b[m
[\u001b[1;31mERROR\u001b[m] \u001b[1;31mPlease refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.\u001b[m
[\u001b[1;31mERROR\u001b[m] -> \u001b[1m[Help 1]\u001b[m
[\u001b[1;31mERROR\u001b[m] 
[\u001b[1;31mERROR\u001b[m] To see the full stack trace of the errors, re-run Maven with the \u001b[1m-e\u001b[m switch.
[\u001b[1;31mERROR\u001b[m] Re-run Maven using the \u001b[1m-X\u001b[m switch to enable full debug logging.
[\u001b[1;31mERROR\u001b[m] 
[\u001b[1;31mERROR\u001b[m] For more information about the errors and possible solutions, please read the following articles:
[\u001b[1;31mERROR\u001b[m] \u001b[1m[Help 1]\u001b[m http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[\u001b[1;31mERROR\u001b[m] 
[\u001b[1;31mERROR\u001b[m] After correcting the problems, you can resume the build with the command
[\u001b[1;31mERROR\u001b[m]   \u001b[1mmvn <args> -rf :eo-runtime\u001b[m
\u001b[0m\u001b[0mcontainer 414cd17d50f82500f5de798a4de6d8753cb33f97232578894d306c3da752fd48 is dead
Wed 07 Sep 2022 02:18:06 PM CEST

@yegor256
Copy link
Member

yegor256 commented Sep 7, 2022

@rultor release, tag is 0.28.2

@rultor
Copy link
Contributor

rultor commented Sep 7, 2022

@rultor release, tag is 0.28.2

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Contributor

rultor commented Sep 7, 2022

@rultor release, tag is 0.28.2

@yegor256 Done! FYI, the full log is here (took me 11min)

@dours
Copy link
Contributor Author

dours commented Sep 7, 2022

@mximp I tried 0.28.2, but still get

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project test: Compilation failure
[ERROR] /home/bogus/py2eo/runEO/target/generated-test-sources/EOorg/EOeolang/EOfor_break_continue_nestedTest.java:[6984,14] error while writing EOorg.EOeolang.EOfor_break_continue_nestedTest.EOω1ap.EOω2φ.EOω3t43$EOt1$EOa1.EOω4ap.EOω5φ.EOω6t55$EOt28$EOt1$EOa0.EOω7t4$EOt0$EOt1$EOa0.EOω8t1$EOt0$EOa1.EOω9t2$EOt0$EOt1$EOa0.EOω10t2$EOt15$EOt1$EOa0.EOω11t4$EOt0$EOt1$EOa0.EOω12t1$EOt0$EOa1.EOω13t2$EOt0$EOt1$EOa0: /home/bogus/py2eo/runEO/target/test-classes/EOorg/EOeolang/EOfor_break_continue_nestedTest$EOω1ap$EOω2φ$EOω3t43$EOt1$EOa1$EOω4ap$EOω5φ$EOω6t55$EOt28$EOt1$EOa0$EOω7t4$EOt0$EOt1$EOa0$EOω8t1$EOt0$EOa1$EOω9t2$EOt0$EOt1$EOa0$EOω10t2$EOt15$EOt1$EOa0$EOω11t4$EOt0$EOt1$EOa0$EOω12t1$EOt0$EOa1$EOω13t2$EOt0$EOt1$EOa0.class: File name too long

the file is for_break_continue_nested.eo.txt

@dours
Copy link
Contributor Author

dours commented Sep 7, 2022

(and the pom is)
pom.xml.txt

@mximp
Copy link
Contributor

mximp commented Sep 12, 2022

@dours can you confirm initial case from the description works fine on your machine?

Could you please also try to save the file manually:
EOfor_break_continue_nestedTest$EOω1ap$EOω2φ$EOω3t43$EOt1$EOa1$EOω4ap$EOω5φ$EOω6t55$EOt28$EOt1$EOa0$EOω7t4$EOt0$EOt1$EOa0$EOω8t1$EOt0$EOa1$EOω9t2$EOt0$EOt1$EOa0$EOω10t2$EOt15$EOt1$EOa0$EOω11t4$EOt0$EOt1$EOa0$EOω12t1$EOt0$EOa1$EOω13t2$EOt0$EOt1$EOa0.class
Max file length in Ubuntu is 255 chars so it must fit.

@mximp
Copy link
Contributor

mximp commented Sep 16, 2022

@dours please check

@dours
Copy link
Contributor Author

dours commented Sep 16, 2022

@mximp sorry for the delay. I've made a workaround for this bug, so it currently prevents me from executing only 1 test (for_break_continue_nested ) .

I can create the file manually. The initial case also passes. BUT! If add +junit to the .eo file of the initial case, then it fails with error

[ERROR] /tmp/reproduce/target/generated-test-sources/EOorg/EOeolang/EOtestTest.java:[887,14] error while writing EOorg.EOeolang.EOtestTest.EOω1blah.EOω2blah.EOω3blah.EOω4blah.EOω5blah.EOω6blah.EOω7blah.EOω8blah.EOω9blah.EOω10blah.EOω11blah.EOω12blah.EOω13blah.EOω14blah.EOω15blah.EOω16blah.EOω17blah.EOω18blah.EOω19blah.EOω20blah.EOω21blah.EOω22blah.EOω23blah.EOω24blah.EOω25blah.EOω26blah.EOω27blah.EOω28blah.EOω29blah.EOω30blah.EOω31blah.EOω32blah.EOω33blah.EOω34blah.EOω35blah.EOω36blah.EOω37blah.EOω38blah.EOω39blah: /tmp/reproduce/target/test-classes/EOorg/EOeolang/EOtestTest$EOω1blah$EOω2blah$EOω3blah$EOω4blah$EOω5blah$EOω6blah$EOω7blah$EOω8blah$EOω9blah$EOω10blah$EOω11blah$EOω12blah$EOω13blah$EOω14blah$EOω15blah$EOω16blah$EOω17blah$EOω18blah$EOω19blah$EOω20blah$EOω21blah$EOω22blah$EOω23blah$EOω24blah$EOω25blah$EOω26blah$EOω27blah$EOω28blah$EOω29blah$EOω30blah$EOω31blah$EOω32blah$EOω33blah$EOω34blah$EOω35blah$EOω36blah$EOω37blah$EOω38blah$EOω39blah.class: File name too long

Checked everything with the release 0.28.2

@mximp
Copy link
Contributor

mximp commented Sep 20, 2022

When you add +junit another mechanism of Java code generation is enabled. It's driven by junit.xsl and rename-junit-inners.xsl. It generates inner Java classes for each inner EO object which leads to long class names during Java compilation.
The only option is to re-design how we generate Java code for tests.
@yegor256 Any objection for such a change? (I will create separate issue for that)

@yegor256
Copy link
Member

@mximp definitely, we need to fix such XSLs

@mximp
Copy link
Contributor

mximp commented Sep 20, 2022

#1249 is created.
@dours let's close this issue.

@mximp
Copy link
Contributor

mximp commented Sep 22, 2022

@dours reminder

@mximp mximp assigned dours and unassigned mximp Sep 22, 2022
@dours dours closed this as completed Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants