typelead / eta

The Eta Programming Language, a dialect of Haskell on the JVM
https://eta-lang.org
BSD 3-Clause "New" or "Revised" License
2.61k stars 145 forks source link

NoSuchMethodError when trying to use stm-containers library #480

Closed rpeszek closed 7 years ago

rpeszek commented 7 years ago

This appears to be the last issue with stm-containers map. Trying to list map elements result in

Exception in thread "main" java.lang.NoSuchMethodError: eta.runtime.stg.Closure.applyI(Leta/runtime/stg/StgContext;I)Leta/runtime/stg/Closure;
    at stm_containers.stmcontainers.hamt.Nodes$sat_s1T7Q.thunkEnter(Unknown Source)
    at eta.runtime.thunk.UpdatableThunk.enter(UpdatableThunk.java:18)
    at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    at base.ghc.conc.Sync$$fMonadSTM1.enter(Unknown Source)
    at eta.runtime.apply.PAP.apply(PAP.java:31)
    at eta.runtime.apply.PAP.applyV(PAP.java:41)
    at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
    at base.ghc.conc.Sync$$fMonadSTM1.enter(Unknown Source)
    at eta.runtime.apply.PAP.apply(PAP.java:31)
    at eta.runtime.apply.PAP.applyV(PAP.java:41)
    at eta.runtime.apply.Function.applyPV(Function.java:117)
    at base.ghc.conc.Sync$$fMonadSTM1.enter(Unknown Source)
    at eta.runtime.apply.PAP.apply(PAP.java:31)
    at eta.runtime.apply.PAP.applyV(PAP.java:41)
    at main.Main$$LrPHTa1.enter(Unknown Source)
    at main.Main$$sfold.enter(Unknown Source)
    at main.Main$sat_sPNR.enter(Unknown Source)
    at eta.runtime.apply.Function.applyV(Function.java:16)
    at eta.runtime.stm.STM.atomically(STM.java:67)
    at main.Main$main1.enter(Unknown Source)
    at main.Main$DZCmain.enter(Unknown Source)
    at eta.runtime.apply.Function.applyV(Function.java:16)
    at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:100)
    at eta.runtime.stg.Capability.schedule(Capability.java:153)
    at eta.runtime.stg.Capability.scheduleClosure(Capability.java:100)
    at eta.runtime.Runtime.evalLazyIO(Runtime.java:189)
    at eta.runtime.Runtime.main(Runtime.java:182)
    at eta.main.main(Unknown Source)

EDITED: Example repo has been removed.

I tested that the same code runs with stack This code uses list-t transformer library as well.

rahulmutt commented 7 years ago

Thank you so much for catching this! This a bug due to the massive perf refactoring that happened just before 0.0.9 release. The fix is quite simple, see the tagged commit.

This time, the fix is in the compiler so the rebuilding steps are a bit different: 1) Clone the eta repo (see docs for instructions) 2) stack install eta to install the fixed compiler. If you did the binary installation, let me know and I'll provide extra steps. 3) etlas install stm-containers --reinstall to recompile the package with the fix. If by chance it doesn't succeed, add on a --force-reinstalls flag as well and manually reinstall all packages that etlas tells you are broken.

rpeszek commented 7 years ago

It worked, however I had to do

etlas clean 
etlas install --dependencies-only

doing just

etlas install stm-containers --reinstall 

was not enough (I was getting the same error).
Maybe this is somehow related to moving from 0.0.9.1 to 0.0.9.2 but if this was the case I would expect different errors (like packages missing).

Thanks!