GithubHelp home page GithubHelp logo

eta-hackage's People

Contributors

abhiroop avatar adamschoenemann avatar aktowns avatar alaendle avatar alexeyraga avatar cblp avatar fosskers avatar gwils avatar jneira avatar justusadam avatar jyothsnasrinivas avatar maredv avatar nightscape avatar ouromoros avatar paweln1986 avatar psibi avatar puffnfresh avatar rahulmutt avatar rpeszek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eta-hackage's Issues

Request: patch cryptohash-md5 and cryptohash-sha1

Failed to build cryptohash-md5-0.11.100.1.
  Build log (
  C:\Users\Pichau\AppData\Roaming\etlas\logs\eta-0.7.2.1\cryptohash-md5-0.11.10_-52f81730bfb736cc31aa126a70aa1edd9edc9ca2.log
  ):
  Preprocessing library for cryptohash-md5-0.11.100.1..
  Building library for cryptohash-md5-0.11.100.1..

  [1 of 1] Compiling Crypto.Hash.MD5 eta.exe: panic! (the 'impossible' happened)
    (Eta version 0.7.2b1):
        tcCheckFIType: Unsupported calling convention.
    ccall unsafe "value md5.h hs_cryptohash_md5_finalize"

  Please report this as a Eta bug: http://github.com/typelead/eta/issues


  Failed to build cryptohash-sha1-0.11.100.1.
  Build log (
  C:\Users\Pichau\AppData\Roaming\etlas\logs\eta-0.7.2.1\cryptohash-sh_-0.11.10_-695768348bd51bab30275dc2c81d2422dcf92904.log
  ):
  Preprocessing library for cryptohash-sha1-0.11.100.1..
  Building library for cryptohash-sha1-0.11.100.1..

  [1 of 1] Compiling Crypto.Hash.SHA1eta.exe: panic! (the 'impossible' happened)
    (Eta version 0.7.2b1):
        tcCheckFIType: Unsupported calling convention.
    ccall unsafe "value sha1.h hs_cryptohash_sha1_finalize"

  Please report this as a Eta bug: http://github.com/typelead/eta/issues
  • There is already another package related with crypto to get a model to start with: cryptonite

Issue with compiling language-javascript

I get the following exception. Most likely has something to do with happy.

Configuring library for language-javascript-0.6.0.11..
Preprocessing library for language-javascript-0.6.0.11..
Exception in thread "main" java.lang.NullPointerException
	at eta.runtime.storage.Block.fillCache(Block.java:155)
	at eta.runtime.storage.CachedBlock.setBlock(CachedBlock.java:38)
	at eta.runtime.io.MemoryManager.getBlockSlow(MemoryManager.java:103)
	at eta.runtime.io.MemoryManager.getBlock(MemoryManager.java:96)
	at eta.runtime.io.MemoryManager.get(MemoryManager.java:124)
	at main.Parser.$recBinding0(Parser.hs)
	at main.Parser.$LhappyDoAction$1(Parser.hs:111)
	at main.Parser$sat$31.apply1(Parser.hs)
	at main.Lexer$f29$1.thunkEnter(Lexer.lhs)
	at eta.runtime.thunk.UpdatableThunk.evaluate(UpdatableThunk.java:19)
	at eta.runtime.thunk.Thunk.apply1(Thunk.java:150)
	at main.Lexer$sat$77.apply1(Lexer.lhs)
	at main.Lexer.$wa(Lexer.lhs)
	at main.Lexer$$wa.apply3(Lexer.lhs)
	at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:43)
	at eta.runtime.apply.PAPSlow.apply1(PAPSlow.java:172)
	at main.Lexer.$wa(Lexer.lhs)
	at main.Parser.$wa1(Parser.hs)
	at main.Parser$sat$36.apply1(Parser.hs)
	at eta.runtime.thunk.Thunk.apply1(Thunk.java:150)
        ....
        .....

unix fails to build on macOS Sierra

When I tried etlas install hspec, it failed, with an indirect dependency on unix, so here is the isolated failed unix build:

$ etlas install unix
[...]
configure: creating ./config.status
config.status: creating unix.buildinfo
config.status: creating include/HsUnixConfig.h
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library for unix-2.7.2.1..
In file included from Resource.hsc:28:
include/HsUnix.h:13:10: fatal error: 'HsFFI.h' file not found
#include "HsFFI.h"
         ^
1 error generated.
compiling dist/build/System/Posix/Resource_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c dist/build/System/Posix/Resource_hsc_make.c -o dist/build/System/Posix/Resource_hsc_make.o -Iinclude -Idist/build/autogen -Idist/build/global-autogen -include dist/build/autogen/cabal_macros.h -I/Users/chen/.etlas/lib/x86_64-osx-eta-0.0.6.8-ghc7_10_3/base-4.8.2.0-IPFDtZjmEfh5tPXF10v5hF/include -I/Users/chen/.etlas/lib/x86_64-osx-eta-0.0.6.8-ghc7_10_3/rts-0.1.0.0-5Dj4qf1Wx9cCeYbpni5T1w/include
etlas: Leaving directory '/var/folders/xz/z3wrll111zn03hdhkd_pxs5w0000gp/T/etlas-tmp-33991/unix-2.7.2.1'
etlas: Error: some packages failed to install:
unix-2.7.2.1-AwcK3ka9q5o5yY0lpEawoF failed during the building phase. The
exception was:
ExitFailure 1

network-transport-0.4.4.0

Is a dependency for distributed-process.

Offending code:

#ifdef mingw32_HOST_OS

foreign import stdcall unsafe "htonl" htonl :: CInt -> CInt
foreign import stdcall unsafe "ntohl" ntohl :: CInt -> CInt
foreign import stdcall unsafe "htons" htons :: CShort -> CShort
foreign import stdcall unsafe "ntohs" ntohs :: CShort -> CShort
  
#else
  
foreign import ccall unsafe "htonl" htonl :: CInt -> CInt
foreign import ccall unsafe "ntohl" ntohl :: CInt -> CInt
foreign import ccall unsafe "htons" htons :: CShort -> CShort
foreign import ccall unsafe "ntohs" ntohs :: CShort -> CShort
  
#endif

Nothing fancy. It is used to convert numbers to network-order bytestrings.

I've downloaded etlas merely an hour ago, so no PR for now 😉

lens-aeson examples throw IllegalStateExceptions

Description

lens-aeson examples are throwing runtime exceptions.

Steps to Reproduce

  1. Add build-depends for lens and lens-aeson to a new project .cabal file
  2. etlas repl
  3. import Control.Lens
  4. import Data.Aeson.Lens
  5. "[1, \"x\"]" ^? nth 0 . _Number
    or
    "42" ^? _Integer

Expected

Just 1.0
or
Just 42

Actual

Prelude Data.Aeson.Lens Control.Lens Main>  "[1, \"x\"]" ^? nth 0 . _Number
*** Exception: java.lang.RuntimeException: Failed during evalStmt of Eta REPL expression
	at eta.serv.REPLClassLoader.evalStmt(REPLClassLoader.java:253)
	at eta.serv.Utils.evalStmt(Utils.java:32)
	at main.eta.serv.Run$sat$21.applyV(Run.hs:61)
	at eta.runtime.exception.Exception.catch_(Exception.java:132)
	at main.eta.serv.Run$sat$20.applyV(Run.hs:181)
	at main.eta.serv.Run.$La4$1(Run.hs:166)
	at main.eta.serv.Run$sat$23.applyV(Run.hs)
	at eta.runtime.exception.Exception.unmaskAsyncExceptions(Exception.java:94)
	at main.eta.serv.Run$sat$19.applyV(Run.hs:125)
	at eta.runtime.exception.Exception.catch_(Exception.java:132)
	at main.eta.serv.Run$sat$18.applyV(Run.hs)
	at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:125)
	at eta.runtime.stg.Capability.schedule(Capability.java:254)
	at eta.runtime.concurrent.WorkerThread.run(WorkerThread.java:16)
Caused by: java.lang.RuntimeException: Failed during evalIOInternal of Eta REPL expression
	at eta.serv.REPLClassLoader.evalIOInternal(REPLClassLoader.java:381)
	at eta.serv.REPLClassLoader.evalStmt(REPLClassLoader.java:246)
	... 13 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at eta.serv.REPLClassLoader.evalIOInternal(REPLClassLoader.java:379)
	... 14 more
Caused by: java.lang.IllegalStateException: The trampoline function expects a thunk and not a function [class aeson.data.aeson.types.internal.datacons.Success extends class aeson.data.aeson.types.internal.tycons.Result]
	at eta.runtime.stg.Stg.trampoline(Stg.java:87)
	at lens_aeson.data.aeson.Lens.$fAsNumber_ByteString3(Lens.hs:386)
	at lens_aeson.data.aeson.Lens$$fAsNumber_ByteString3.apply1(Lens.hs)
	at profunctors.data.profunctor.Unsafe$sat$1.thunkEnter(Unsafe.hs:169)
	at eta.runtime.thunk.UpdatableThunk.evaluate(UpdatableThunk.java:19)
	at base.data.Either.$fFunctor_Either_$cfmap(Either.hs:130)
	at base.data.Either$$fFunctor_Either_$cfmap.apply2(Either.hs:130)
	at eta.runtime.apply.PAP1_1.apply1(PAP1_1.java:62)
	at eta.runtime.thunk.Thunk.apply1(Thunk.java:151)
	at profunctors.data.profunctor.Unsafe$sat.thunkEnter(Unsafe.hs:169)
	at eta.runtime.thunk.UpdatableThunk.evaluate(UpdatableThunk.java:19)
	at lens_aeson.data.aeson.Lens$sat$261.apply1(Lens.hs)
	at profunctors.data.profunctor.Unsafe.$fProfunctor_ZLzmzgZR_$cdimap(Unsafe.hs:169)
	at profunctors.data.profunctor.Unsafe$$fProfunctor_ZLzmzgZR_$cdimap.apply4(Unsafe.hs:169)
	at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:53)
	at eta.runtime.apply.PAPSlow.apply1(PAPSlow.java:179)
	at eta.runtime.thunk.Thunk.apply1(Thunk.java:151)
	at profunctors.data.profunctor.Unsafe$sat.thunkEnter(Unsafe.hs:169)
	at eta.runtime.thunk.UpdatableThunk.evaluate(UpdatableThunk.java:19)
	at eta.runtime.stg.Closure.evaluateTail(Closure.java:33)
	at base.data.functor.Const.$fFunctor_Const2(Const.hs:66)
	at base.data.functor.Const$$fFunctor_Const2.apply2(Const.hs)
	at eta.runtime.apply.PAP1_1.apply1(PAP1_1.java:62)
	at eta.runtime.thunk.Thunk.apply1(Thunk.java:151)
	at profunctors.data.profunctor.Unsafe.$fProfunctor_ZLzmzgZR_$cdimap(Unsafe.hs:169)
	at profunctors.data.profunctor.Unsafe$$fProfunctor_ZLzmzgZR_$cdimap.apply4(Unsafe.hs:169)
	at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:53)
	at eta.runtime.apply.PAPSlow.apply1(PAPSlow.java:179)
	at eta.runtime.thunk.Thunk.apply1(Thunk.java:151)
	at profunctors.data.profunctor.Unsafe$sat.thunkEnter(Unsafe.hs:169)
	at eta.runtime.thunk.UpdatableThunk.evaluate(UpdatableThunk.java:19)
	at eta.runtime.stg.Closure.evaluateTail(Closure.java:33)
	at base.data.functor.Const.$fFunctor_Const2(Const.hs:66)
	at base.data.functor.Const$$fFunctor_Const2.apply2(Const.hs)
	at eta.runtime.apply.PAP1_1.apply1(PAP1_1.java:62)
	at eta.runtime.thunk.Thunk.apply1(Thunk.java:151)
	at profunctors.data.profunctor.Unsafe.$fProfunctor_ZLzmzgZR_$cdimap(Unsafe.hs:169)
	at profunctors.data.profunctor.Unsafe$$fProfunctor_ZLzmzgZR_$cdimap.apply4(Unsafe.hs:169)
	at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:53)
	at eta.runtime.apply.PAPSlow.apply1(PAPSlow.java:179)
	at eta.runtime.thunk.Thunk.apply1(Thunk.java:151)
	at profunctors.data.profunctor.Unsafe$sat.thunkEnter(Unsafe.hs:169)
	at eta.runtime.thunk.UpdatableThunk.evaluate(UpdatableThunk.java:19)
	at eta.runtime.stg.Closure.evaluateTail(Closure.java:33)
	at base.data.functor.Const.$fFunctor_Const2(Const.hs:66)
	at base.data.functor.Const$$fFunctor_Const2.apply2(Const.hs)
	at eta.runtime.apply.PAP1_1.apply1(PAP1_1.java:62)
	at eta.runtime.thunk.Thunk.apply1(Thunk.java:151)
	at profunctors.data.profunctor.Unsafe.$fProfunctor_ZLzmzgZR_$cdimap(Unsafe.hs:169)
	at profunctors.data.profunctor.Unsafe$$fProfunctor_ZLzmzgZR_$cdimap.apply4(Unsafe.hs:169)
	at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:53)
	at eta.runtime.apply.PAPSlow.apply1(PAPSlow.java:179)
	at eta.runtime.apply.PAPSlow.apply2(PAPSlow.java:212)
	at eta.runtime.thunk.Thunk.apply2(Thunk.java:161)
	at lens.control.lens.Fold.$La12$1(Fold.hs:1266)
	at lens.control.lens.Fold.zcz3fU(Fold.hs:1266)
	at lens.control.lens.Fold$zcz3fU.apply2(Fold.hs:1266)
	at interactive.EtaRepl1_3$it0.thunkEnter(Interactive.hs)
	at eta.runtime.thunk.UpdatableThunk.evaluate(UpdatableThunk.java:19)
	at base.ghc.Show.$fShow_Maybe_$cshow(Show.hs:190)
	at base.ghc.Show$sat$492.apply1(Show.hs)
	at base.system.IO$sat.thunkEnter(IO.hs:279)
	at eta.runtime.thunk.SingleEntryThunk.evaluate(SingleEntryThunk.java:20)
	at base.ghc.io.handle.Text.hPutStr3(Text.hs:558)
	at base.ghc.io.handle.Text.hPutStr2(Text.hs:550)
	at base.system.IO.print1(IO.hs:265)
	at base.system.IO.print(IO.hs:279)
	at base.system.IO$print.apply2V(IO.hs:279)
	at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:71)
	at eta.runtime.apply.PAPSlow.applyV(PAPSlow.java:119)
	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
	at base.ghc.Base.thenIO1(Base.hs:1335)
	at base.ghc.Base.thenIO(Base.hs:1335)
	at base.ghc.Base$thenIO.apply2V(Base.hs:1335)
	at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:71)
	at eta.runtime.apply.PAPSlow.applyV(PAPSlow.java:119)
	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
	at eta.runtime.exception.Exception.unmaskAsyncExceptions(Exception.java:94)
	at base.control.exception.Base$sat$25.applyV(Base.hs)
	at eta.runtime.exception.Exception.catch_(Exception.java:132)
	at base.control.exception.Base$sat$22.applyV(Base.hs:226)
	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:45)
	at base.control.exception.Base.bracket1(Base.hs:228)
	at base.system.Environment.withArgs1(Environment.hs:156)
	at base.system.Environment.withArgs(Environment.hs:153)
	at base.system.Environment$withArgs.apply2V(Environment.hs:153)
	at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:71)
	at eta.runtime.apply.PAPSlow.applyV(PAPSlow.java:119)
	at eta.runtime.thunk.Thunk.applyV(Thunk.java:121)
	at eta.runtime.exception.Exception.unmaskAsyncExceptions(Exception.java:94)
	at base.control.exception.Base$sat$25.applyV(Base.hs)
	at eta.runtime.exception.Exception.catch_(Exception.java:132)
	at base.control.exception.Base$sat$22.applyV(Base.hs:226)
	at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:45)
	at base.control.exception.Base.bracket1(Base.hs:228)
	at base.system.Environment.withProgName1(Environment.hs:170)
	at base.system.Environment.withProgName(Environment.hs:168)
	at base.system.Environment$withProgName.apply2V(Environment.hs:168)
	at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:71)
	at eta.runtime.apply.PAPSlow.applyV(PAPSlow.java:119)
	at eta.runtime.stg.Closures$EvalIO.enter(Closures.java:150)
	at eta.runtime.stg.Capability.schedule(Capability.java:254)
	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:210)
	at eta.runtime.Runtime.evalIO(Runtime.java:380)
	... 19 more

Environment

  1. etlas --version
    etlas version 1.5.0.0
    compiled using version 2.1.0.0 of the etlas-cabal library
  2. The Eta Programming Language Compiler, Version 0.8.6b2, Git Revision e42f73dcfa407c0f80394240911a488d85c7199a
  3. Mac OS X: Darwin Michaels-MacBook-Pro.local 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

Patch directory-1.3.1.1

This is related to #42 since directory-1.3.1.1 tries to install unix-2.7.2.2 and that fails.

OS-X Sierra
I am at current head commit on eta master

Ankh-Morpork:eta rpeszek$ git rev-parse HEAD
1dbe87b19f815ba12ec33f558cb7b572a74e03c1

the log:

Resolving dependencies...
Configuring unix-2.7.2.2...
Building unix-2.7.2.2...
Failed to install unix-2.7.2.2
...

optparse-applicative fix

Temporarily, functionality that invokes bash in optparse-applicative has been disabled. Users will get a runtime exception notifying them that it's not implemented.

Once process is ported, it should be uncommented.

bytestring install failed

this is a basic package, hope can be supported. thanks.


Resolving dependencies...
Found patch in eta-hackage for bytestring-0.10.8.1
Configuring bytestring-0.10.8.1...
Building bytestring-0.10.8.1...
Failed to install bytestring-0.10.8.1
Build log ( /Users/LambdaCat/.etlas/logs/eta-0.0.6/bytestring-0.10.8.1-BfpZ30g0iJ8LZqZyX72dzK.log ):
etlas: Entering directory '/var/folders/79/l2kk9s8572gdvzc8r5jq2pf40000gn/T/etlas-tmp-30383/bytestring-0.10.8.1'
Configuring bytestring-0.10.8.1...
Preprocessing library for bytestring-0.10.8.1..
Building library for bytestring-0.10.8.1..

java/Utils.java:39:0:
     错误: 找不到符号
            return MemoryManager.nullAddress;
                                ^
      符号:   变量 nullAddress
      位置: 类 MemoryManager
1 个错误
etlas: Leaving directory '/var/folders/79/l2kk9s8572gdvzc8r5jq2pf40000gn/T/etlas-tmp-30383/bytestring-0.10.8.1'
etlas: Error: some packages failed to install:
bytestring-0.10.8.1-BfpZ30g0iJ8LZqZyX72dzK failed during the building phase.
The exception was:
ExitFailure 1

http-client sample program hangs

The following program from http-client docs hangs.

import Network.HTTP.Client
import Network.HTTP.Types.Status (statusCode)

main :: IO ()
main = do
  manager <- newManager defaultManagerSettings

  request <- parseRequest "http://eta-lang.org"
  response <- httpLbs request manager

  putStrLn $ "The status code was: " ++ (show $ statusCode $ responseStatus response)
  print $ responseBody response

Cryptonite

Is it possible to support cryptonite?

Get Duckling to work

I am attempting to incorporate Duckling project with eta but am running into some dependency issues. My main goal is to eventually use Duckling (Haskell) in an Android application. I am first attempting to get Duckling running via eta.

Duckling: https://github.com/facebook/duckling
It is also on Hackage: https://hackage.haskell.org/package/duckling
I clone the Duckling gitHub project here, and I run:
home$ etlas run

Resolving dependencies...
etlas: Could not resolve dependencies:
trying: base-4.11.1.0/installed-9g5... (dependency of duckling-0.1.6.1)
next goal: text-show (dependency of duckling-0.1.6.1)
rejecting: text-show-3.8.2, text-show-3.8.1, text-show-3.8 (conflict: duckling
=> text-show>=2.1.2 && <3.8)
trying: text-show-3.7.5
next goal: integer-gmp (dependency of text-show-3.7.5)
rejecting: integer-gmp-1.0.2.0 (conflict: base =>
ghc-prim==0.4.0.0/installed-Jhi..., integer-gmp => ghc-prim>=0.5.2)
rejecting: integer-gmp-1.0.1.0 (conflict: base =>
ghc-prim==0.4.0.0/installed-Jhi..., integer-gmp => ghc-prim>=0.5.1)
rejecting: integer-gmp-1.0.0.1 (conflict: base =>
ghc-prim==0.4.0.0/installed-Jhi..., integer-gmp => ghc-prim>=0.5)
rejecting: integer-gmp-1.0.0.0, integer-gmp-0.5.1.0 (only already installed
instances can be used)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: integer-gmp, base, text-show, duckling

Patch megaparsec package to avoid StackOverflowException's

  • Testing the new version of dhall with eta a StackOverflowException is thrown:
PS C:\Users\Javier\dev\lang\eta\dhall\dhall-haskell> echo True | etlas run exe:dhall -- --e
xplain
Up to date
Exception in thread "main" java.lang.StackOverflowError
        at dhall.dhall.Parser.$fApplicative_Parser4(Parser.hs)
        at dhall.dhall.Parser$$fApplicative_Parser4.apply6(Parser.hs)
        at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:50)
        at eta.runtime.apply.PAPSlow.apply5(PAPSlow.java:342)
        at eta.runtime.thunk.Thunk.apply5(Thunk.java:182)
        at megaparsec.text.Megaparsec$sat_s3SRE.apply2(Megaparsec.hs)
        at dhall.dhall.Parser.$wa1(Parser.hs)
        at dhall.dhall.Parser.$wa(Parser.hs)
        at dhall.dhall.Parser.$fCharParsing_Parser1(Parser.hs)
        at dhall.dhall.Parser.$Lr8RHRa173(Parser.hs)
        at dhall.dhall.Parser$$Lr8RHRa173.apply5(Parser.hs)
        at dhall.dhall.Parser.$fParsing_Parser6(Parser.hs)
        at dhall.dhall.Parser.$Lr8RTOa361(Parser.hs)
        at dhall.dhall.Parser$$Lr8RTOa361.apply5(Parser.hs)
        at dhall.dhall.Parser$sat_s92UQ.apply5(Parser.hs)
        at megaparsec.text.Megaparsec.$Lr3OP9a7(Megaparsec.hs)
        at megaparsec.text.Megaparsec.pMap(Megaparsec.hs:381)
        at megaparsec.text.Megaparsec$pMap.enter(Megaparsec.hs:381)
        at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:104)
        at eta.runtime.apply.PAPSlow.apply5(PAPSlow.java:342)
        at eta.runtime.thunk.Thunk.apply5(Thunk.java:182)
        at dhall.dhall.Parser.$fApplicative_Parser3(Parser.hs)
        at dhall.dhall.Parser$$fApplicative_Parser3.enter(Parser.hs)
        at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:104)
        at eta.runtime.apply.PAPSlow.apply5(PAPSlow.java:342)
        at eta.runtime.thunk.Thunk.apply5(Thunk.java:182)
        at megaparsec.text.Megaparsec$a29_s3SPR.apply5(Megaparsec.hs)
        at eta.runtime.thunk.Thunk.apply5(Thunk.java:182)
        at dhall.dhall.Parser.$fParsing_Parser6(Parser.hs)
        at dhall.dhall.Parser$sat_s92VG.apply6(Parser.hs)
        at dhall.dhall.Parser$sat_s915D.apply3(Parser.hs)
        at megaparsec.text.Megaparsec.accHints(Megaparsec.hs:323)
        at dhall.dhall.Parser$sat_s915B.apply3(Parser.hs)
        at megaparsec.text.Megaparsec.accHints(Megaparsec.hs:323)
        at dhall.dhall.Parser$sat_s915H.apply3(Parser.hs)
        at dhall.dhall.Parser$sat_s9189.apply6(Parser.hs)
        at dhall.dhall.Parser$sat_s915J.apply3(Parser.hs)
        at dhall.dhall.Parser.$Lr8RFDa120(Parser.hs)
        at dhall.dhall.Parser$$Lr8RFDa120.apply5(Parser.hs)
        at dhall.dhall.Parser.$fParsing_Parser6(Parser.hs)
        at dhall.dhall.Parser$sat_s918A.apply6(Parser.hs)
        at dhall.dhall.Parser$sat_s915D.apply3(Parser.hs)
        at megaparsec.text.Megaparsec.accHints(Megaparsec.hs:323)
        at dhall.dhall.Parser$sat_s915B.apply3(Parser.hs)
        at megaparsec.text.Megaparsec.accHints(Megaparsec.hs:323)
        at dhall.dhall.Parser$sat_s915H.apply3(Parser.hs)
        at dhall.dhall.Parser$sat_s917B.apply6(Parser.hs)
        at dhall.dhall.Parser$sat_s915J.apply3(Parser.hs)
        at dhall.dhall.Parser.$smatch3(Parser.hs)
        at dhall.dhall.Parser$$smatch3.apply5(Parser.hs)
        at dhall.dhall.Parser.$fParsing_Parser6(Parser.hs)
        at dhall.dhall.Parser$sat_s917C.apply6(Parser.hs)
        at dhall.dhall.Parser$sat_s915D.apply3(Parser.hs)
        at megaparsec.text.Megaparsec.accHints(Megaparsec.hs:323)
        at dhall.dhall.Parser$sat_s915B.apply3(Parser.hs)
        at megaparsec.text.Megaparsec.accHints(Megaparsec.hs:323)

As commented by @rahulmutt, the cause should be that megaparsec is continuation based, like aeson or binary so the steps could be:

we'll have to add a trampoline function to get rid of the SO
export ETA_JAVA_ARGS=“-XX:MaxJavaStackTraceDepth=-1”
Then, in the stack trace, go all the way to beginning and figure out where the (somewhat) repeating pattern of apply*’s starts
See the aeson and binary patches for some examples
Typically, the function that triggers the CPS computation by supplying an argument is a good canditate (functions like these will have the word run in their names)

Migrate patches to use MachDeps.h

In a recent patch in Eta, MachDeps.h is included in the include path for rts. That should be imported instead of manually defining the constants for all the relevant patches.

Helper script for patching

The instructions in the README can be converted to a script to make it easier for people to patch libraries.

Basic interface:
The hello-0.0.1 package will be the running example.

$ ./ghcvm-patch init

  1. Prompt the user to create a fork of ghcvm-hackage and take input to get the URL of the fork.
  2. Clone the fork locally (by default in the $HOME directory) and pull any changes.
    NOTE: The location of the ghcvm-hackage fork should be standardised and remembered for usage in the other commands.

$ ./ghcvm-patch start hello-0.0.1

  1. Download hello-0.0.1 from package (via cabalvm get for portability).
  2. Extract the tarball into the current directory (should yield a single folder with name hello-0.0.1).
  3. Initialise a git repository inside the hello-0.0.1 directory.
  4. Add & commit all the files in the hello-0.0.1 directory. The name of the commit should be "First."
  5. If an existing patch is there in ghcvm-hackage,
  6. Notify the user that he can start patching inside the newly created directory.

$ ./ghcvm-patch commit (Should be invoked in the root directory of the extracted package)

  1. Search for the .cabal file in the current directory and obtain the package name & version.
  2. Add all the changes & commit automatically with the commit name "Patched."
  3. Invoke git format-patch HEAD~ --stdout and the output should be redirected to a file named hello-0.0.1.patch.
  4. Check if hello.cabal has been changed since the last commit "First." If so, copy it with new name as `hello-0.0.1.cabal. If not, don't generate any new file.
  5. The files generated from steps 3 & 4 should be copied to thepatches directory of the local clone of the ghcvm-hackage fork. The changes should be committed & pushed automatically. Finally, a PR should automatically be sent upstream.

ghcvm-patch should be ideally be a Haskell utility for easy installation, but if someone is willing to make a bash script, that works too.

Can't install regex-posix even found patch

Hi I can't install regex-posix, the output is as blow.

$ etlas install regex-posix
Resolving dependencies...
Found patch in eta-hackage for regex-posix-0.95.2
Configuring regex-posix-0.95.2...
Building regex-posix-0.95.2...
Failed to install regex-posix-0.95.2
Build log ( /Users/zhangjun/.etlas/logs/eta-0.0.9.2/regex-posix-0.95.2-Kd0wX9w7C2XFMvm3PfgF5c.log ):
etlas: Entering directory '/var/folders/dt/m9kwylpd01v3qh5qlj6dnxch0000gq/T/etlas-tmp-34859/regex-posix-0.95.2'
Configuring regex-posix-0.95.2...
Preprocessing library for regex-posix-0.95.2..
Building library for regex-posix-0.95.2..
[1 of 6] Compiling Text.Regex.Posix.Wrap ( Text/Regex/Posix/Wrap.hs, dist/build/Text/Regex/Posix/Wrap.jar )

Text/Regex/Posix/Wrap.hs:153:20:
Module ‘Java.String’ does not export ‘CharSequence’
etlas: Leaving directory '/var/folders/dt/m9kwylpd01v3qh5qlj6dnxch0000gq/T/etlas-tmp-34859/regex-posix-0.95.2'
etlas: Error: some packages failed to install:
regex-posix-0.95.2-Kd0wX9w7C2XFMvm3PfgF5c failed during the building phase.
The exception was:
ExitFailure 1

dhall-to-etlas doesn't build due to ansi-terminal dependency

The build of dhall-to-etlas is broken in the dependency resolution step:
Dependencies:

  • optparse-applicative == 0.14.0.0 -> ansi-wl-pprint == 0.6.8.2 > ansi-terminal >=0.4.0 && <0.9
  • dhall ==1.14.0 -> ansi-terminal >=0.6.3.1 && <0.9

The build tries several versions of ansi-terminal <=0.6.2.3 via the first path and fails cause dhall needs >=0.6.31
Then it tries ansi-terminal == 0.8.0.4 (the good one) and i dont see why it is rejected

Full output.txt

cabalvm install status

Right now, I want to know if cabalvm install does this stuff:

  • Downloading Hackage package
  • Applying patch from this repository
  • Then registering the package with .ghcvm.

If this is done by cabalvm, then it has to be documented. If it doesn't, then we need to make sure that it is done.

Right now, trying cabalvm seems to install successfully (I'm not sure if it applied the patch - asking you instead):

root@c5c2b0f72f2f:~# cabalvm install containers
Resolving dependencies...
Configuring deepseq-1.4.2.0...
Configuring deepseq-1.4.2.0...
Building deepseq-1.4.2.0...
Building deepseq-1.4.2.0...
Preprocessing library deepseq-1.4.2.0...
[1 of 1] Compiling Control.DeepSeq  ( Control/DeepSeq.hs, dist/build/Control/DeepSeq.jar )
Linking dist/build/HSdeepseq-1.4.2.0.jar ...
In-place registering deepseq-1.4.2.0...
Creating package registration file:
/tmp/pkgConf-deepseq-1.4.27833686901102520059.0
Installing library in
/root/.cabalvm/lib/x86_64-linux-ghcvm-0.0.1-ghc7_10_3/deepseq-1.4.2.0
Registering deepseq-1.4.2.0...
Installed deepseq-1.4.2.0
Downloading containers-0.5.8.1...
Found patch in ghcvm-hackage for containers-0.5.8.1
Initialized empty Git repository in /tmp/cabal-tmp-384/containers-0.5.8.1/.git/
Configuring containers-0.5.8.1...
Configuring containers-0.5.8.1...
Building containers-0.5.8.1...
Building containers-0.5.8.1...
Preprocessing library containers-0.5.8.1...
[ 1 of 25] Compiling Data.Utils.PtrEquality ( Data/Utils/PtrEquality.hs, dist/build/Data/Utils/PtrEquality.jar )
[ 2 of 25] Compiling Data.Utils.StrictMaybe ( Data/Utils/StrictMaybe.hs, dist/build/Data/Utils/StrictMaybe.jar )
[ 3 of 25] Compiling Data.Utils.StrictPair ( Data/Utils/StrictPair.hs, dist/build/Data/Utils/StrictPair.jar )
[ 4 of 25] Compiling Data.Utils.StrictFold ( Data/Utils/StrictFold.hs, dist/build/Data/Utils/StrictFold.jar )
[ 5 of 25] Compiling Data.Utils.BitUtil ( Data/Utils/BitUtil.hs, dist/build/Data/Utils/BitUtil.jar )
[ 6 of 25] Compiling Data.Utils.BitQueue ( Data/Utils/BitQueue.hs, dist/build/Data/Utils/BitQueue.jar )
[ 7 of 25] Compiling Data.Sequence.Base ( Data/Sequence/Base.hs, dist/build/Data/Sequence/Base.jar )
[ 8 of 25] Compiling Data.Sequence    ( Data/Sequence.hs, dist/build/Data/Sequence.jar )
[ 9 of 25] Compiling Data.Tree        ( Data/Tree.hs, dist/build/Data/Tree.jar )
[10 of 25] Compiling Data.Graph       ( Data/Graph.hs, dist/build/Data/Graph.jar )
[11 of 25] Compiling Data.Set.Base    ( Data/Set/Base.hs, dist/build/Data/Set/Base.jar )
[12 of 25] Compiling Data.Set         ( Data/Set.hs, dist/build/Data/Set.jar )
[13 of 25] Compiling Data.Map.Base    ( Data/Map/Base.hs, dist/build/Data/Map/Base.jar )
[14 of 25] Compiling Data.Map.Strict.Internal ( Data/Map/Strict/Internal.hs, dist/build/Data/Map/Strict/Internal.jar )
[15 of 25] Compiling Data.Map.Strict  ( Data/Map/Strict.hs, dist/build/Data/Map/Strict.jar )
[16 of 25] Compiling Data.Map.Strict.Merge ( Data/Map/Strict/Merge.hs, dist/build/Data/Map/Strict/Merge.jar )
[17 of 25] Compiling Data.Map.Lazy.Merge ( Data/Map/Lazy/Merge.hs, dist/build/Data/Map/Lazy/Merge.jar )
[18 of 25] Compiling Data.Map.Lazy    ( Data/Map/Lazy.hs, dist/build/Data/Map/Lazy.jar )
[19 of 25] Compiling Data.Map         ( Data/Map.hs, dist/build/Data/Map.jar )
[20 of 25] Compiling Data.IntSet.Base ( Data/IntSet/Base.hs, dist/build/Data/IntSet/Base.jar )
[21 of 25] Compiling Data.IntSet      ( Data/IntSet.hs, dist/build/Data/IntSet.jar )
[22 of 25] Compiling Data.IntMap.Base ( Data/IntMap/Base.hs, dist/build/Data/IntMap/Base.jar )
[23 of 25] Compiling Data.IntMap.Strict ( Data/IntMap/Strict.hs, dist/build/Data/IntMap/Strict.jar )
[24 of 25] Compiling Data.IntMap.Lazy ( Data/IntMap/Lazy.hs, dist/build/Data/IntMap/Lazy.jar )
[25 of 25] Compiling Data.IntMap      ( Data/IntMap.hs, dist/build/Data/IntMap.jar )
Linking dist/build/HScontainers-0.5.8.1.jar ...
In-place registering containers-0.5.8.1...
Creating package registration file:
/tmp/pkgConf-containers-0.5.810599613932089018456.1
Installing library in
/root/.cabalvm/lib/x86_64-linux-ghcvm-0.0.1-ghc7_10_3/containers-0.5.8.1
Registering containers-0.5.8.1...
Installed containers-0.5.8.1

instructions on adding packages are unclear

If one follows...

Patching

Download the somepackage-0.1.2.3.tar.gz tarball from Hackage.

Initialize a git repository and make an initial commit.

$ git init
$ git add .
$ git commit -m "First"
Build the package.

$ epm build

... the result can only be ...

Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
epm: No cabal file found.
Please create a package description file <pkgname>.cabal

I suppose the instructions need to explain about how this new repo needs to be properly started, and to avoid confusion it should be clear that one needs to move the tar into that same folder.

Support for "extra" package

Hi,

I would like to use the extra package but it is not yet supported.
After a small chat on Gitter, it seems that the following would have to be done:

  • patch the package in order to remove the dependency on the unix package
  • remove/handle the FFI call

Thanks,
Sebastian.

Make etlas apply the patch directly to Cabal files

Currently, when submitting a patch that involves a change to the .cabal file, you need to submit the .caba file as well. This was done for making the patching implementation easier in the beginning, but it's time we made it a lot smarter by applying the patch partially to just the cabal file.

Patch needed to install Reflex? Dependency on haskell-src-exts-1.20.3

I get the following error when trying to build reflex for an Etlas project.
I am quite new to this, could you help me figure out if a patch is needed?
Here is part of the log:

Configuring library for haskell-src-exts-1.20.3..
Preprocessing library for haskell-src-exts-1.20.3..
unused rules: 777
Building library for haskell-src-exts-1.20.3..
[ 4 of 18] Compiling Language.Haskell.Exts.Syntaxeta: panic! (the 'impossible' happened)
(Eta version 0.8.6b5):
Error when generating class 'haskell_src_exts/language/haskell/exts/Syntax': putClassFile: ConstPool size exceeds 65,535 constants: 134672

Please report this as a Eta bug: http://github.com/typelead/eta/issues

etlas: Failed to build haskell-src-exts-1.20.3

filepath

I see filepath was updated just a couple of hours ago, but when I try to install it I get:

Preprocessing library filepath-1.4.1.2...
[1 of 3] Compiling System.FilePath.Windows ( System/FilePath/Windows.hs, dist/build/System/FilePath/Windows.jar )

System/FilePath/Internal.hs:110:1:
    System.Environment: Can't be safely imported!
    The module itself isn't safe.
Failed to install filepath-1.4.1.2

Maybe I need to understand a little better how eta-hackage works. Are all packages got directly from master once updated or there's some delay (like publishing it somewhere)?

Handle string literals > 65535 bytes long

While it's hard to break the 65,535 limit for strings with manual user input, it seems like generated lexers/parsers from alex & happy generate their state tables as a giant primitive string literal and it may happen that for sufficiently large grammars, it may get close to this limit. For now, the compiler will emit a warning when a literal string that consumes > 65,000 bytes is trying to compile.

This problem can be fixed in general:
1.) Add a version of eta.runtime.io.MemoryManager.loadString method that takes an array of strings and adds them sequentially to the allocated byte buffer that has a size of all the string sizes combined.
2.) Modify cgLit (MachStr _) in ETA.CodeGen.Utils to check the size of the ByteString and if it exceeds 65,000 (say) it should split it up into chunks of size 65,000 bytes and generate multiple sconst instructions that get pushed into an array and passed into the variant of loadString that should've been done in (1) above.

Patch for pandoc 2.5

A patch is needed in order to use Pandoc with Eta. The latest release (2.5), as well as other releases since 1.8, has a dependency on unix (>=2.4 && <2.8).

Time 1.6.0.1 installation error

Here's the error I get when running epm install time-1.6.0.1 -v:

/home/jaro/.local/bin/cpphs --version
/usr/bin/gcc -dumpversion
/usr/bin/ghc --numeric-version
/usr/bin/ghc-pkg --version
/usr/bin/git --version
/usr/bin/haddock --version
/usr/bin/hpc version
/home/jaro/.local/bin/hsc2hs --version
/usr/bin/pkg-config --version
/usr/bin/tar --help
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install time-1.6.0.1
Waiting for install task to finish...
Extracting
/home/jaro/.epm/packages/hackage.haskell.org/time/1.6.0.1/time-1.6.0.1.tar.gz
to /tmp/cabal-tmp-22921...
/usr/bin/git --version
Found patch in eta-hackage for time-1.6.0.1
/usr/bin/git -C /tmp/cabal-tmp-22921/time-1.6.0.1 init
/usr/bin/git -C /tmp/cabal-tmp-22921/time-1.6.0.1 apply --ignore-space-change --ignore-whitespace /home/jaro/.epm/patches/patches/time-1.6.0.1.patch
Updating time.cabal with the latest revision from the index.
Configuring time-1.6.0.1...
Dependency base ==4.8.2.0: using base-4.8.2.0
Dependency deepseq ==1.4.2.0: using deepseq-1.4.2.0
Using Cabal-1.22.8.0 compiled by ghc-7.10
Using compiler: eta-0.0.5
Using install prefix: /home/jaro/.epm
Binaries installed in: /home/jaro/.epm/bin
Libraries installed in:
/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/time-1.6.0.1
Private binaries installed in: /home/jaro/.epm/libexec
Data files installed in:
/home/jaro/.epm/share/x86_64-linux-eta-0.0.5-ghc7_10_3/time-1.6.0.1
Documentation installed in:
/home/jaro/.epm/share/doc/x86_64-linux-eta-0.0.5-ghc7_10_3/time-1.6.0.1
Configuration files installed in: /home/jaro/.epm/etc
No alex found
Using ar found on system at: /usr/bin/ar
No c2hs found
Using cpphs version 1.20.2 found on system at: /home/jaro/.local/bin/cpphs
Using eta version 0.0.5 found on system at: /home/jaro/.local/bin/eta
Using eta-pkg version 0.0.5 found on system at: /home/jaro/.local/bin/eta-pkg
Using gcc version 6.2.1 found on system at: /usr/bin/gcc
Using ghc version 8.0.1 found on system at: /usr/bin/ghc
Using ghc-pkg version 8.0.1 found on system at: /usr/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
Using git version 2.11.0 found on system at: /usr/bin/git
No greencard found
Using haddock version 2.17.2 found on system at: /usr/bin/haddock
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at: /usr/bin/hpc
Using hsc2hs version 0.68.1 found on system at: /home/jaro/.local/bin/hsc2hs
No hscolour found
Using java version 1.7.0.111 found on system at: /usr/bin/java
Using javac version 1.7.0.111 found on system at: /usr/bin/javac
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
Using pkg-config version 0.29.1 found on system at: /usr/bin/pkg-config
Using strip version 2.27 found on system at: /usr/bin/strip
Using tar found on system at: /usr/bin/tar
No uhc found
Component build order: library
creating dist/build
creating dist/build/autogen
Building time-1.6.0.1...
/home/jaro/.local/bin/eta-pkg init dist/package.conf.inplace
Preprocessing library time-1.6.0.1...
creating dist/build/Data/Time/Clock
creating dist/build/Data/Time
creating dist/build/Data
creating dist/build/Data/Time
creating dist/build/Data/Time/Clock
/home/jaro/.local/bin/hsc2hs '--cc=/usr/bin/gcc' '--ld=/usr/bin/gcc' '--cflag=-Ilib/include' '--cflag=-DLANGUAGE_Rank2Types' '--cflag=-DLANGUAGE_DeriveDataTypeable' '--cflag=-DLANGUAGE_StandaloneDeriving' '--cflag=-Idist/build/autogen' '--cflag=-include' '--cflag=dist/build/autogen/cabal_macros.h' '--cflag=-I/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/base-4.8.2.0/include' '--lflag=-L/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/deepseq-1.4.2.0' '--lflag=-Wl,-R,/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/deepseq-1.4.2.0' '--lflag=-L/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/array-0.5.1.1' '--lflag=-Wl,-R,/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/array-0.5.1.1' '--lflag=-L/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/base-4.8.2.0' '--lflag=-Wl,-R,/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/base-4.8.2.0' '--lflag=-L/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/integer-0.5.1.0' '--lflag=-Wl,-R,/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/integer-0.5.1.0' '--lflag=-L/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/ghc-prim-0.4.0.0' '--lflag=-Wl,-R,/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/ghc-prim-0.4.0.0' '--lflag=-L/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/rts-0.1.0.0' '--lflag=-Wl,-R,/home/jaro/.epm/lib/x86_64-linux-eta-0.0.5-ghc7_10_3/rts-0.1.0.0' -o dist/build/Data/Time/Clock/CTimespec.hs lib/Data/Time/Clock/CTimespec.hsc
No template specified, and template-hsc.h not located.

Usage: hsc2hs [OPTIONS] INPUT.hsc [...]

  -o FILE          --output=FILE          name of main output file
  -t FILE          --template=FILE        template file
  -c PROG          --cc=PROG              C compiler to use
  -l PROG          --ld=PROG              linker to use
  -C FLAG          --cflag=FLAG           flag to pass to the C compiler
  -I DIR                                  passed to the C compiler
  -L FLAG          --lflag=FLAG           flag to pass to the linker
  -i FILE          --include=FILE         as if placed in the source
  -D NAME[=VALUE]  --define=NAME[=VALUE]  as if placed in the source
                   --no-compile           stop after writing *_hsc_make.c
  -x               --cross-compile        activate cross-compilation mode
                   --cross-safe           restrict .hsc directives to those supported by --cross-compile
  -k               --keep-files           do not remove temporary files
  -v               --verbose              dump commands to stderr
  -?               --help                 display this help and exit
  -V               --version              output version information and exit
Failed to install time-1.6.0.1
World file is already up to date.
epm: Error: some packages failed to install:
time-1.6.0.1 failed during the building phase. The exception was:
ExitFailure 1

Proposal for changing recommended process: Just fork the original repo

Hi all,

I might be missing some background about how etlas works, but I'll just propose this nonetheless 😉
Could the proposed process to create a patch changed to something like this?

  1. Fork the original repo.
  2. Create a new without_eta branch, starting from the commit of the version you want to patch.
  3. Create a new with_eta branch from the same commit.
  4. Create a PR from with_eta to without_eta.
  5. Create an issue on eta-hackage which links to the PR, and add an In Progress label, so everyone knows what you're working on and you can get early feedback.
  6. Write, commit and push the required changes. If you need help, ask the Typelead team on your PR.
  7. Create a patch from the diff without_eta..with_eta.
  8. Submit this patch.

The idea is that it's much easier to discuss code changes and get feedback if there is an easy way to show your current state. Patches don't lend themselves to this, because they have to be created, copied around and then committed themselves. And then you still only see the patch and not its context (i.e. the non-patched code).
Moreover, if you just fork the original project, it's much easier to git-rebase your changes onto newer versions, or maybe even contribute back some commits to the original repo.

If etlas would support directly pulling from a git repository (instead of patching itself), then you could even get rid of at least steps 7. and 8.

I think in the long run it would be great if the Haskell libraries themselves could integrate the patches, e.g. like in Scala where you have a shared code-base for everything that is not platform specific and then some extra folders for scala-jvm, scala-js and scala-native.

request: Patch pretty-show-1.6.16

It imports Paths_pretty_show module which is unsafe, and build fails.

There's just one exported function that uses it, should it be removed, along with the module dependency? Something like this?

Paths_... modules seem to be special, autogenerated to have a few functions returning hard-coded paths. I'm still not sure what they are useful for, but can they be supported in eta?

Patch criterion + support for JMH

Which is funny, since I'm on a Linux system. I got this error when trying to install criterion as a dependency for a test project:

Configuring unix-2.7.2.2...
Preprocessing library for unix-2.7.2.2..
etlas: can't find source for System/Posix/Resource in ., dist/build/autogen,
dist/build/global-autogen
etlas: Leaving directory '/tmp/etlas-tmp-13260/unix-2.7.2.2'
etlas: Error: some packages failed to install:
unix-2.7.2.2-EjsyPnKNuFmAYXDUkSFrP5 failed during the building phase. The
exception was:
ExitFailure 1

Patch process-1.6.2.0

Here's what happens today:

Configuring process-1.6.2.0...
Preprocessing library for process-1.6.2.0..
Building library for process-1.6.2.0..
[1 of 5] Compiling System.Process.Common ( System/Process/Common.hs, dist/dist-sandbox-f6755099/build/System/Process/Common.jar )

System/Process/Common.hs:206:24: Not in scope: ‘FD.fdPath’

There's no FD.fdPath in the source. https://hackage.haskell.org/package/process-1.6.2.0/src/System/Process/Common.hs

I'm probably missing something obvious, any hints?

basement - Implement isPinned# primops

The basement package has some functionality that relies on the pinned status of a ByteArray. We should implement those primops and make it work eventually.

foundation package - implement the missing bits

A lot of the foreign calls in the foundation package were stubbed out since most of that functionality probably wasn't going to be used. We should gradually implement those as the need arises.

Temporary library -- creation of temp files does not work on windows platform

I used temprorary library withFile and got the following exception

xception in thread "main" eta.runtime.exception.EtaException: JException java.lang.UnsupportedOperationException: 'p
osix:permissions' not supported as initial attribute
at base.ghc.TopHandler.runMainIO2(TopHandler.hs)
at base.ghc.TopHandler$runMainIO2.apply1V(TopHandler.hs)
at eta.runtime.exception.Exception.catch_(Exception.java:166)
at main.Main.main11(Main.hs:16)
at main.Main.DZCmain(Main.hs:16)
at main.Main$DZCmain.applyV(Main.hs:16)
at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:104)
at eta.runtime.stg.Capability.schedule(Capability.java:174)
at eta.runtime.stg.Capability.scheduleClosure(Capability.java:119)
at eta.runtime.Runtime.evalLazyIO(Runtime.java:189)
at eta.runtime.Runtime.main(Runtime.java:182)
at eta.main.main(Unknown Source)
Caused by: java.lang.UnsupportedOperationException: 'posix:permissions' not supported as initial attribute
at sun.nio.fs.WindowsSecurityDescriptor.fromAttribute(WindowsSecurityDescriptor.java:358)
at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:107)
at java.nio.channels.FileChannel.open(FileChannel.java:287)
at eta.base.Utils.fileChannelOpen(Utils.java:415)
at base.system.posix.Internals.c_open1(Internals.hs:344)
at base.system.IO.$wa(IO.hs:491)
at temporary.system.io.Temp$sat_sX96.applyV(Temp.hs:86)
at eta.runtime.thunk.Thunk.applyV(Thunk.java:117)
at base.ghc.Base.bindIO1(Base.hs:1021)
at base.ghc.Base$bindIO1.apply2V(Base.hs)
at eta.runtime.apply.PAPSlow.apply(PAPSlow.java:62)
at eta.runtime.apply.PAPSlow.applyV(PAPSlow.java:110)
at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:42)
at exceptions.control.monad.Catch.$fMonadMask_IO2(Catch.hs:194)
at exceptions.control.monad.Catch$$fMonadMask_IO2.apply1V(Catch.hs)
at eta.runtime.apply.PAP1_1.applyV(PAP1_1.java:17)
at mockery.test.mockery.Directory.withFile1(Directory.hs:45)
at main.Main.main1(Main.hs:24)
at main.Main$main1.applyV(Main.hs)
at eta.runtime.exception.Exception.catch_(Exception.java:129)
... 9 more

Patch cborg-0.2.0.0

cborg "provides an efficient implementation of the Concise Binary Object Representation (CBOR), as specified by RFC 7049." and is used in the master version of dhall-haskell to serialize dhall

Patch for cql-io

I am attempting to port a stack build to etlas. Among the dependencies of the project is cql-io, which in turn depends on HsOpenSSL. In @rahulmutt's words, the dependency fails to build because "It has FFI bindings to C++ which don’t work with Eta as of now".

Is there a timeline for support of C++ FFI bindings?

The etlas output is as follows:

[...]
Building HsOpenSSL-0.11.4.14 (lib)...
Building memory-0.14.14 (lib)...
Found patch in eta-hackage for primitive-0.6.4.0
Configuring primitive-0.6.4.0 (lib)...
Building double-conversion-2.0.2.0 (lib)...
Building primitive-0.6.4.0 (lib)...

Failed to build HsOpenSSL-0.11.4.14.
Build log (
/Users/joshsh/.etlas/logs/eta-0.8.0.2/HsOpenSSL-0.11.4.14-c18a307f0987a3fd4c8cdb850a3bf2badb30b9ab98f92fbb507d72c7df2d614a.log
):
Configuring library for HsOpenSSL-0.11.4.14..
Preprocessing library for HsOpenSSL-0.11.4.14..
etlas: can't find source for OpenSSL/BN in ., dist/build/autogen,
dist/build/global-autogen

Failed to build double-conversion-2.0.2.0.
Build log (
/Users/joshsh/.etlas/logs/eta-0.8.0.2/double-conversion-2.0.2.0-46cae44536e03c79c0a4b1e00f9202df45fc29f721f9eb8909feb314b73c6cc6.log
):
Configuring library for double-conversion-2.0.2.0..
Preprocessing library for double-conversion-2.0.2.0..
Building library for double-conversion-2.0.2.0..
etlas:
'/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java'
exited with an error:
Cannot parse dependencies:
Malformed dependency: c++
etlas: Failed to build HsOpenSSL-0.11.4.14 (which is required by u2-0.1). See
the build log above for details.
Failed to build double-conversion-2.0.2.0 (which is required by u2-0.1). See
the build log above for details.

Here is the build log:

Configuring library for double-conversion-2.0.2.0..
Preprocessing library for double-conversion-2.0.2.0..
Building library for double-conversion-2.0.2.0..
etlas:
'/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java'
exited with an error:
^[[2KDownloaded 1 missing file(s) / 17
^[[1A^[[2KDownloaded 2 missing file(s) / 17
^[[1A^[[2KDownloaded 3 missing file(s) / 17
^[[1A^[[2KDownloaded 4 missing file(s) / 17
^[[1A^[[2KDownloaded 5 missing file(s) / 17
^[[1A^[[2KDownloaded 6 missing file(s) / 17
^[[1A^[[2KDownloaded 7 missing file(s) / 17
^[[1A^[[2KDownloaded 8 missing file(s) / 17
^[[1A^[[2KDownloaded 9 missing file(s) / 17
^[[1A^[[2KDownloaded 10 missing file(s) / 17
^[[1A^[[2KDownloaded 11 missing file(s) / 17
^[[1A^[[2KDownloaded 12 missing file(s) / 17
^[[1A^[[2KDownloaded 13 missing file(s) / 17
^[[1A^[[2KDownloaded 14 missing file(s) / 17
^[[1A^[[2KDownloaded 15 missing file(s) / 17
^[[1A^[[2KDownloaded 16 missing file(s) / 17
^[[1A^[[2KDownloaded 17 missing file(s) / 17
^[[1A^[[2KCannot parse dependencies:
Malformed dependency: c++

Memory leak with simple vector code

Vector package is heavily optimized with Core rewrite rules. This code executes in milliseconds and small amount of constant space in GHC:

import qualified Data.Vector as V

sq x = x * x
bigSumVec = V.sum $ V.map sq $ V.enumFromTo  1 (100000000 :: Int64)

But in Eta it runs forever and eventually produces OutOfMemory exception. I have looked at the patch for vector and I did not see any aggressive removal of {# RULES ... #}.

Is this a case of something special that Eta currently does?

I believe that all vector package optimization is in the Core layer and am surprise at such a big difference.
Thank you for any help answering this question.

bytestring (lazy) readFile not working properly

The file is read

import qualified Data.ByteString.Lazy as LBS
    ...
      myLBS <- LBS.readFile "some file"

but doing anything with the bytestring results in error at some point.
I can print the bytestream but stack traces will print afterwords.
Trying something like this:

LBS.length myLBS

will exception immediatelly
The error looks like this:

Caused by: eta.runtime.exception.EtaException: Exception was thrown in rendering exception of type class java.lang.NullPointerException
	at base.foreign.c.Error$throwErrnoIfMinus1RetryMayBlock2.enter(Unknown Source)
	at base.ghc.io.FD$$wa5.enter(Unknown Source)
	at base.ghc.io.handle.Text$sat_sGLFS.enter(Unknown Source)
	at eta.runtime.apply.Function.applyPV(Function.java:120)
	at base.ghc.io.handle.Internals$wantReadableHandle2.enter(Unknown Source)
	at base.ghc.io.handle.Internals$sat_sG0K9.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 eta.runtime.exception.Exception.catch_(Exception.java:136)

Corresponding code works fine if compiled and executed with stack.

Example code reproducing the issue:
https://github.com/rpeszek/eta-misc-test/tree/eta-hackage-issue-54

I am at current head commit on eta master
1dbe87b19f815ba12ec33f558cb7b572a74e03c1

cryptohash-md5 and cryptohash-sha1 large input test

Both packages fail the xltest both of which create an insanely large (lazy) input to hash. It was observed that the Eta process quickly went from 1.0GB -> 2.0GB memory usage within a matter of 20 seconds and just stalled.

Moreover, the boundary cases for testing md5 against the reference implementation were failing for cryptohash-md5.

directory-1.3.1.0 fix createDirectoryIfMissing

@jniera, unfortunately I'm getting the following error from your patch file:

Found patch in eta-hackage for directory-1.3.1.0
etlas: '/usr/bin/git' exited with an error:
fatal: unrecognized input

I've temporarily reverted your changes so that builds don't break. If at all possible can you revert your git version and see if that helps?

failure on Text.Regex.mkRegex

From Gitter:

Joshua Shinavier @joshsh 15:06
can someone shed some light on the following stack trace:

 Exception in thread "main" eta.runtime.exception.EtaException: Prelude.undefined
        at base.ghc.TopHandler.runMainIO2(TopHandler.hs)
        at base.ghc.TopHandler$runMainIO2.apply1V(TopHandler.hs)
        at eta.runtime.exception.Exception.catch_(Exception.java:169)
        at main.Main.main3(Main.hs)
[...]
Caused by: eta.runtime.exception.EtaException: Prelude.undefined
        at base.ghc.Err.errorWithoutStackTrace(Err.hs:39)
        at base.ghc.Err$undefined.thunkEnter(Err.hs:39)
        at eta.runtime.thunk.CAF.evaluate(CAF.java:30)
[...]

the program in question runs normally when executed with stack exec, but throws this error when executed via gradle-eta

Joshua Shinavier @joshsh 15:49
it appears at the point in the program when file output occurs. File input succeeds. FWIW, an earlier version of this program (including the file output) ran via gradle-eta without problems.

Joshua Shinavier @joshsh 16:28
probably related to regex matching as opposed the file I/O itself. Here is more of the stack trace:

 Caused by: eta.runtime.exception.EtaException: Prelude.undefined
        at base.ghc.Err.errorWithoutStackTrace(Err.hs:39)
        at base.ghc.Err$undefined.thunkEnter(Err.hs:39)
        at eta.runtime.thunk.CAF.evaluate(CAF.java:30)
        at eta.runtime.stg.Closure.evaluateTail(Closure.java:33)
        at regex_compat.text.Regex$mkRegex1.thunkEnter(Regex.hs:43)
        at eta.runtime.thunk.CAF.evaluate(CAF.java:30)
        at regex_posix.text.regex.posix.String.$fRegexMaker_Regex_CompOption_ExecOption_ZMZN_$cmakeRegexOpts(String.hs:72)
        at main.data.schemas.Schema$$Llvl40$1.thunkEnter(Schema.hs)
        at eta.runtime.thunk.CAF.evaluate(CAF.java:30)
        at regex_posix.text.regex.posix.Wrap.wrapMatch1(Wrap.hs:588)
        at regex_posix.text.regex.posix.String.$fRegexContext_Regex_ZMZN_ZMZN4(String.hs:107)
        at regex_posix.text.regex.posix.String.$fRegexContext_Regex_ZMZN_ZMZN_$cmatchOnce(String.hs:80)
        at regex_posix.text.regex.posix.String.$fRegexContext_Regex_ZMZN_ZMZN_$cmatchOnceText(String.hs:76)
        at main.data.schemas.Schema.$LcheckName$1(Schema.hs:619)
line 619 is this:
     nameRegex = TR.mkRegex "^[A-Za-z][A-Za-z0-9]*$"

Rahul Muttineni @rahulmutt 22:40
@joshsh It could be referring to a unimplemented function in regex-posix - I just checked the patch and observed that there are some undefined’s sprinkled throughout so they need to be implemented. If possible, can you make a minimal example that causes this problem? I can go ahead and implement those. Do file an issue with the minimal example so that I can close it to let you know it’s been fixed.

Joshua Shinavier @joshsh 23:14
@rahulmutt, the following example reproduces the issue:

 import qualified Text.Regex as TR
import qualified Data.Maybe as Y

main = do
  let name = "foo"
  putStrLn $ show name ++ " is a legal name: " ++ (show $ minimalEtaFailureExample name)

minimalEtaFailureExample s = Y.isJust $ TR.matchRegex nameRegex s
  where
    nameRegex = TR.mkRegex "^[A-Za-z][A-Za-z0-9]*$"

this is via gradle-eta with:

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

package tasty not running

Compiles but won't run, error (on macOS Sierra):

Exception in thread "main" java.lang.NoSuchMethodError: eta.runtime.concurrent.Concurrent.labelThread(Leta/runtime/stg/StgContext;Leta/runtime/stg/TSO;J)Leta/runtime/stg/Closure;
at tasty.test.tasty.Parallel$sat_sMTT.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.Foreign$$wa1.enter(Unknown Source)
at base.ghc.Foreign$$wa3_sDAHO.enter(Unknown Source)
at base.ghc.Foreign$sat_sDAIF.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 eta.runtime.exception.Exception.unmaskAsyncExceptions(Exception.java:90)
at base.ghc.IO$sat_s8Y4ZZ.enter(Unknown Source)
at eta.runtime.apply.Function.applyV(Function.java:16)
at eta.runtime.exception.Exception.catch_(Exception.java:135)
at base.ghc.IO$sat_s8Y5C.enter(Unknown Source)
at eta.runtime.apply.Function.applyV(Function.java:16)
at eta.runtime.exception.Exception.maskAsyncExceptions(Exception.java:41)
at base.ghc.IO$bracket1.enter(Unknown Source)
at base.ghc.Foreign$charIsRepresentable3.enter(Unknown Source)
at tasty.test.tasty.Parallel$runInParallel1.enter(Unknown Source)
at tasty.test.tasty.Run$sat_s21YJ.enter(Unknown Source)
at eta.runtime.apply.Function.applyV(Function.java:16)
at tasty.test.tasty.Run$launchTestTree4.enter(Unknown Source)
at tasty.test.tasty.Run$launchTestTree1.enter(Unknown Source)
at tasty.test.tasty.Ingredients$sat_s235L.enter(Unknown Source)
at eta.runtime.apply.Function.applyV(Function.java:16)
at tasty.test.tasty.CmdLine$defaultMainWithIngredients1.enter(Unknown Source)
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:96)
at eta.runtime.stg.Capability.schedule(Capability.java:150)
at eta.runtime.stg.Capability.scheduleClosure(Capability.java:97)
at eta.runtime.Runtime.evalLazyIO(Runtime.java:189)
at eta.runtime.Runtime.main(Runtime.java:182)
at eta.main.main(Unknown Source)

[Patch Request] MissingH-1.4.0.1

The unix dependency needs to be commented out and all the missing functions should be replaced with a Java standard library shim (if possible). If not possible, the definition of the function can be replaced with an error "[message-here]" expression for now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.