typelead / gradle-eta

Gradle plugin for the Eta programming language
BSD 3-Clause "New" or "Revised" License
30 stars 7 forks source link

Multi example doesn't build #32

Closed sir4ur0n closed 6 years ago

sir4ur0n commented 6 years ago

I tried to run the multi example but I get several errors.

The first time:

$ ./gradlew run
Starting a Gradle Daemon, 3 stopped Daemons could not be reused, use --status for details
Download https://plugins.gradle.org/m2/com/typelead/eta/com.typelead.eta.gradle.plugin/0.7.9/com.typelead.eta.gradle.plugin-0.7.9.pom
Download https://plugins.gradle.org/m2/gradle/plugin/com/typelead/gradle-eta/0.7.9/gradle-eta-0.7.9.pom
Download https://plugins.gradle.org/m2/gradle/plugin/com/typelead/gradle-eta/0.7.9/gradle-eta-0.7.9.jar

> Task :setupEnvironmentEta
Downloading etlas from: http://cdnverify.eta-lang.org/eta-binaries/etlas-1.4.0.0/binaries/x86_64-osx/etlas ; caching to /Users/Julien/.gradle/caches/etlas/1.4.0.0/etlas

> Task :setupEnvironmentEta FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':setupEnvironmentEta'.
> No value has been specified for this provider.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --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 24s

However if I run the same command again, it seems to go further, but breaks:

$ ./gradlew run
> Task :run FAILED
Exception in thread "main" java.lang.NoClassDefFoundError: eta/text/Utils
        at hio.hello.Mod.$wa(Mod.hs)
        at hio.hello.Mod.helloText1(Mod.hs)
        at hio.hello.Mod$helloText.thunkEnter(Mod.hs:10)
        at eta.runtime.thunk.CAF.evaluate(CAF.java:30)
        at main.Main$combineTextByteString.thunkEnter(Main.hs:10)
        at eta.runtime.thunk.CAF.evaluate(CAF.java:30)
        at text.data.text.Show$sat_s3JHO.thunkEnter(Show.hs)
        at eta.runtime.thunk.UpdatableThunk.evaluate(UpdatableThunk.java:19)
        at base.ghc.io.handle.Text.$wa7(Text.hs:586)
        at base.ghc.io.handle.Text.hPutStr2(Text.hs:553)
        at main.Main.main1(Main.hs)
        at main.Main$main1.applyV(Main.hs)
        at eta.runtime.exception.Exception.catch_(Exception.java:129)
        at main.Main.main9(Main.hs)
        at main.Main.DZCmain(Main.hs:13)
        at main.Main$DZCmain.applyV(Main.hs:13)
        at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:108)
        at eta.runtime.stg.Capability.schedule(Capability.java:183)
        at eta.runtime.stg.Capability.scheduleClosure(Capability.java:123)
        at eta.runtime.Runtime.evalLazyIO(Runtime.java:284)
        at eta.runtime.Runtime.main(Runtime.java:277)
        at eta.main.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: eta.text.Utils
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 22 more

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':run'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --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 16s
jneira commented 6 years ago

Hi, i've reproduced the first error but it works in the second try. Do you tried the plugin before? Maybe the gradle cache could contain bad versions of libraries. Sometimes wiping out the ~/.gradle directory makes it work again.

The log of my test (to compare with yours):

PS C:\Users\Javier\dev\lang\eta\gradle-eta\examples\multi> gradle run

Welcome to Gradle 4.7!

Here are the highlights of this release:
 - Incremental annotation processing
 - JDK 10 support
 - Grouped non-interactive console logs
 - Failed tests are re-run first for quicker feedback

For more details see https://docs.gradle.org/4.7/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
Download https://plugins.gradle.org/m2/com/typelead/eta/com.typelead.eta.gradle.plugin/0.7.9/com.typelead.eta.gradle.plugin-0.7.9.pom
Download https://plugins.gradle.org/m2/gradle/plugin/com/typelead/gradle-eta/0.7.9/gradle-eta-0.7.9.pom
Download https://plugins.gradle.org/m2/gradle/plugin/com/typelead/gradle-eta/0.7.9/gradle-eta-0.7.9.jar

> Task :setupEnvironmentEta
Downloading etlas from: http://cdnverify.eta-lang.org/eta-binaries/etlas-1.4.0.0/binaries/x86_64-windows/etlas.exe ; caching to C:\Users\Javier\.gradle\caches\etlas\1.4.0.0\etlas.exe

> Task :setupEnvironmentEta FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':setupEnvironmentEta'.
> No value has been specified for this provider.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --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 42s
1 actionable task: 1 executed
PS C:\Users\Javier\dev\lang\eta\gradle-eta\examples\multi> gradle run
Download https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.pom
Download https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar

> Task :run
"Hello ByteString HappyHello Text"
"Hello Again!"
[0,0,0,10]

BUILD SUCCESSFUL in 1m 8s
PS C:\Users\Javier\dev\lang\eta\gradle-eta\examples\multi> gradle -version
------------------------------------------------------------
Gradle 4.7
------------------------------------------------------------
Build time:   2018-04-18 09:09:12 UTC
Revision:     b9a962bf70638332300e7f810689cb2febbd4a6c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_25 (Oracle Corporation 25.25-b02)
OS:           Windows 8.1 6.3 amd64
sir4ur0n commented 6 years ago

I just tried on another computer (Windows this time), I still can't build it.

First error is exactly the same. Second (and next tries) all result in the same error:

$ ./gradlew run
> Task :setupEnvironmentEta
> Task :resolveDependenciesEta UP-TO-DATE
> Task :java-deep:injectDependenciesEta
> Task :java-deep:compileJava UP-TO-DATE
> Task :java-deep:processResources NO-SOURCE
> Task :java-deep:classes UP-TO-DATE
> Task :java-deep:jar UP-TO-DATE
Building eta-java-interop-0.1.5.0 (lib)...
Building bytestring-0.10.8.1 (lib)...
etlas.exe: Failed to build bytestring-0.10.8.1 (which is required by
text-1.2.2.2). See the build log above for details.
Failed to build eta-java-interop-0.1.5.0 (which is required by text-1.2.2.2).
See the build log above for details.
> Task :hio:installDependenciesEta FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':hio:installDependenciesEta'.
> [C:\Users\sir4ur0n\.gradle\caches\etlas\1.4.0.0\etlas.exe, --select-eta=0.8.0b2, deps, lib:hio] failed with ExitCode 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --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 18s
6 actionable tasks: 3 executed, 3 up-to-date
jneira commented 6 years ago

Jumm, so you did the test in a fresh computer with no previous tries to build the example, right? What version of the plugin are you trying? the master version? I'll try using the gradle wrapping instead a system install (i am using an external gradle 4.7) to try reproduce the error.

sir4ur0n commented 6 years ago

Yes, that was on a fresh clone of this repo, never tried to install it before. I was on master branch. I was using gradlew which is supposed to make the build fully reproducible šŸ˜„

jneira commented 6 years ago

Hi, sorry for the delat but i get to reproduce the error, wiping out my local ~\eta\0.8.0b2 and ~\etlas\0.8.0b2. We have to investigate why but the versions used in master eta-gradle don't work anymore (and it should!) In the meanwhile i've tried newer versions of etlas, eta and libs and they have worked for me:

allprojects { repositories { mavenCentral() } }

eta { version = '0.8.6b2' etlasVersion = '1.5.0.0' }

dependencies { compile eta('text:1.2.3.0') compile eta('memory:0.14.14') compile project(':hio') compile project(':java-shallow') }

- `multi/hio/build.gradle`
```groovy
plugins {
    id 'com.typelead.eta'
}

dependencies {
    compile eta('text:1.2.3.0')
    compile eta('bytestring:0.10.8.2')
    compile project(':java-deep')
}

hope it helps!

sir4ur0n commented 6 years ago

Your fix seems to work šŸ˜„ Waiting for the PR to be merged before closing.

rahulmutt commented 6 years ago

Closing since the relevant PR was merged.