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

teavm 0.10 fails to compile to javascript #921

Open
radmanplays opened this issue May 12, 2024 · 1 comment
Open

teavm 0.10 fails to compile to javascript #921

radmanplays opened this issue May 12, 2024 · 1 comment

Comments

@radmanplays
Copy link

radmanplays commented May 12, 2024

ive downloaded this repo and updated the teavm version to 0.10 and changed the OptimizationLevel to AGGRESSIVE but when i try to compile task generateJavaScript fails and i get this error message:

Execution failed for task ':generateJavaScript'.
> org.teavm.tooling.builder.BuildException: java.lang.ClassCastException: class org.teavm.ast.VariableExpr cannot be cast to class org.teavm.ast.ConstantExpr (org.teavm.ast.VariableExpr and org.teavm.ast.ConstantExpr are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @60cde852)

full log:

Initialized native services in: /home/codespace/.gradle/native
Initialized jansi services in: /home/codespace/.gradle/native
Received JVM installation metadata from '/usr/local/sdkman/candidates/java/21.0.2-ms': {JAVA_HOME=/usr/local/sdkman/candidates/java/21.0.2-ms, JAVA_VERSION=21.0.2, JAVA_VENDOR=Microsoft, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=21.0.2+13-LTS, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=21.0.2+13-LTS, VM_VENDOR=Microsoft, OS_ARCH=amd64}
The client will now receive all logging from the daemon (pid: 2907). The daemon log file: /home/codespace/.gradle/daemon/8.6/daemon-2907.out.log
Starting 14th build in daemon [uptime: 52 mins 23.879 secs, performance: 94%, GC rate: 0.00/s, heap usage: 0% of 2 GiB]
Using 2 worker leases.
Not watching /eaglercraft/eaglercraft-1.8-workspace since the file system is not supported
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file '/workspaces/eaglercraft/eaglercraft-1.8-workspace/settings.gradle'.
Projects loaded. Root project using build file '/workspaces/codespaces-blank/eaglercraft/eaglercraft-1.8-workspace/build.gradle'.
Included projects: [root project 'eaglercraft-workspace']

> Configure project :
Evaluating root project 'eaglercraft-workspace' using build file '/workspaces/eaglercraft/eaglercraft-1.8-workspace/build.gradle'.
Transforming teavm-gradle-plugin-0.10.0.jar (org.teavm:teavm-gradle-plugin:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-core-0.10.0.jar (org.teavm:teavm-core:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-tooling-0.10.0.jar (org.teavm:teavm-tooling:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-interop-0.10.0.jar (org.teavm:teavm-interop:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-relocated-libs-asm-commons-0.10.0.jar (org.teavm:teavm-relocated-libs-asm-commons:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-metaprogramming-api-0.10.0.jar (org.teavm:teavm-metaprogramming-api:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-relocated-libs-asm-util-0.10.0.jar (org.teavm:teavm-relocated-libs-asm-util:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-relocated-libs-hppc-0.10.0.jar (org.teavm:teavm-relocated-libs-hppc:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-relocated-libs-rhino-0.10.0.jar (org.teavm:teavm-relocated-libs-rhino:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-relocated-libs-commons-io-0.10.0.jar (org.teavm:teavm-relocated-libs-commons-io:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-relocated-libs-asm-analysis-0.10.0.jar (org.teavm:teavm-relocated-libs-asm-analysis:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-relocated-libs-asm-tree-0.10.0.jar (org.teavm:teavm-relocated-libs-asm-tree:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
Transforming teavm-relocated-libs-asm-0.10.0.jar (org.teavm:teavm-relocated-libs-asm:0.10.0) with ExternalDependencyInstrumentingArtifactTransform
All projects evaluated.
Task name matched 'generateJavaScript'
Selected primary task 'generateJavaScript' from project :
Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':compileTeavmJava', task ':processTeavmResources', task ':teavmClasses', task ':generateJavaScript']
Tasks that were excluded: []
Resolve mutations for :compileJava (Thread[#278,included builds,5,main]) started.
:compileJava (Thread[#278,included builds,5,main]) started.

> Task :compileJava UP-TO-DATE
Caching disabled for task ':compileJava' because:
  Build cache is disabled
Skipping task ':compileJava' as it is up-to-date.
Resolve mutations for :processResources (Thread[#279,Execution worker,5,main]) started.
:processResources (Thread[#279,Execution worker,5,main]) started.

> Task :processResources NO-SOURCE
Skipping task ':processResources' as it has no source files and no previous output files.
Resolve mutations for :classes (Thread[#279,Execution worker,5,main]) started.
:classes (Thread[#279,Execution worker,5,main]) started.

> Task :classes UP-TO-DATE
Skipping task ':classes' as it has no actions.
Resolve mutations for :compileTeavmJava (Thread[#279,Execution worker,5,main]) started.
:compileTeavmJava (Thread[#279,Execution worker,5,main]) started.

> Task :compileTeavmJava UP-TO-DATE
Caching disabled for task ':compileTeavmJava' because:
  Build cache is disabled
Skipping task ':compileTeavmJava' as it is up-to-date.
Resolve mutations for :processTeavmResources (Thread[#278,included builds,5,main]) started.
:processTeavmResources (Thread[#278,included builds,5,main]) started.

> Task :processTeavmResources NO-SOURCE
Skipping task ':processTeavmResources' as it has no source files and no previous output files.
Resolve mutations for :teavmClasses (Thread[#278,included builds,5,main]) started.
:teavmClasses (Thread[#278,included builds,5,main]) started.

> Task :teavmClasses UP-TO-DATE
Skipping task ':teavmClasses' as it has no actions.
Resolve mutations for :generateJavaScript (Thread[#278,included builds,5,main]) started.
:generateJavaScript (Thread[#278,included builds,5,main]) started.

> Task :generateJavaScript
Caching disabled for task ':generateJavaScript' because:
  Build cache is disabled
Task ':generateJavaScript' is not up-to-date because:
  Task has failed previously.
Running TeaVM

> Task :generateJavaScript FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateJavaScript'.
> org.teavm.tooling.builder.BuildException: java.lang.ClassCastException: class org.teavm.ast.VariableExpr cannot be cast to class org.teavm.ast.ConstantExpr (org.teavm.ast.VariableExpr and org.teavm.ast.ConstantExpr are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @60cde852)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 2m 27s
3 actionable tasks: 1 executed, 2 up-to-date
Some of the file system contents retained in the virtual file system are on file systems that Gradle doesn't support watching. The relevant state was discarded to ensure changes to these locations are properly detected. You can override this by explicitly enabling file system watching.
@konsoletyper
Copy link
Owner

Could not reproduce. When I first tried to compile project, I got issue with IndexedDB wrappers (see #914). I also tried with locally installed 0.11.0-SNAPSHOT (which contains fix for the issue) and it compiles successfully. Anyway, you should run Gradle with --stacktrace and report stacktrace here. Or you should provide more details. For example, if you did some more changes than just updating version and optimization level, then you should provide a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants