gelisam / hawk

Haskell text processor for the command-line
Apache License 2.0
361 stars 20 forks source link

"" interpreted as "()" #103

Closed gelisam closed 10 years ago

gelisam commented 10 years ago

As discussed in #95, hawk "" should be a user error.

melrief commented 10 years ago

Can I work on this or do you prefer to keep working on the refactoring before I start changing stuff? I promise I won't override your changes this time :).

gelisam commented 10 years ago

Please go ahead! On 1 Mar 2014 14:22, "Mario Pastorelli" notifications@github.com wrote:

Can I work on this or do you prefer to keep working on the refactoring before I start changing stuff? I promise I won't override your changes this time :).

— Reply to this email directly or view it on GitHubhttps://github.com/gelisam/hawk/issues/103#issuecomment-36433816 .

melrief commented 10 years ago

I'm going to fix this in branch issue-95 or develop?

gelisam commented 10 years ago

Actually, I have just merged issue-95 into develop, so develop is now your only remaining choice!

melrief commented 10 years ago

Ok, so this issue will have it's own branch issue-103 based on current develop.

melrief commented 10 years ago

Commit d38219b fixes this, if you confirm I merge issue-103 into develop.

gelisam commented 10 years ago

Looks good! But the test for null made me think of another similar case:

> hawk " "

> 

I guess "( )" is interpreted as "()". Maybe we should check for printable characters? Or maybe there is another way to test if the user expression is well-formed?

Also, the test suite fails.

melrief commented 10 years ago

I think spaces and the empty string should give the error, for anything else we rely on hint to say if the expression is well-formed or not. I have to remove spaces before and after the expression.

What kind of error do you get from tests?

gelisam commented 10 years ago
> cabal test
[...]
18 examples, 0 failures

Hawk
user expression cannot be empty

Usage: reference [option]... <expr> [<file>]
Options:
  -a         --apply                      apply <expr> to the entire table
  -m         --map                        apply <expr> to each row
  -d[delim]  --word-delimiter[=delim]     default ' '
  -D[delim]  --line-delimiter[=delim]     default '\n'
  -o[delim]  --output-word-delim[=delim]  default <word-delim>
  -O[delim]  --output-line-delim[=delim]  default <line-delim>
  -v         --version                    print version and exit
  -h         --help                       this help
  -c path    --context-directory=path     <ctx-dir> directory, default is
                                          '~/.hawk'
Test suite reference: FAIL
Test suite logged to: dist/test/haskell-awk-1.0.1-reference.log
0 of 1 test suites (0 of 1 test cases) passed.

I think it's just the itEval "" test failing, since "" is no longer a valid input. We should remove that test from tests/System/Console/Hawk/Test.hs.

melrief commented 10 years ago

Commit f52775e adds the check for empty strings and strings containing only spaces (matching against Data.Char.isSpace). About the tests I noticed that I have the "resource vanished" problem so I can't reach your error:

> cabal test
Building haskell-awk-1.0.1...
Preprocessing library haskell-awk-1.0.1...
In-place registering haskell-awk-1.0.1...
Preprocessing executable 'hawk' for haskell-awk-1.0.1...
Linking dist/build/hawk/hawk ...
Preprocessing test suite 'reference' for haskell-awk-1.0.1...
Linking dist/build/reference/reference ...
Running 1 test suites...
Test suite reference: RUNNING...
Examples: 6  Tried: 6  Errors: 0  Failures: 0
Examples: 13  Tried: 13  Errors: 0  Failures: 0
Examples: 166  Tried: 166  Errors: 0  Failures: 0
### Error in tests/System/Console/Hawk/PreludeTests.hs:43: expression `test ["-d:", "-m"] "head" "passwd"'
fd:5: hGetLine: end of file
reference: fd:4: hClose: resource vanished (Broken pipe)
Test suite reference: FAIL
Test suite logged to: dist/test/haskell-awk-1.0.1-reference.log
0 of 1 test suites (0 of 1 test cases) passed.

The fact that we have different outputs from our test suite is not a good sign...

gelisam commented 10 years ago

Oh no, not that bug again! :(

There must be something stale in your sandbox, dist, or .cabal folder. Does the error also occur if you checkout master, cabal install and cabal test? The tests passed for sure at that version, so if the issue occurs then, the problem must definitely be in a non-tracked file.

melrief commented 10 years ago

I spent some hours trying to fix my cabal folder but nothing: the error is still there :(. Tomorrow I will try to reinstall everything (rm .cabal) but that will take time...

gelisam commented 10 years ago

I erase ~/.cabal often, and I assure you that rebuilding everything from scratch doesn't take that much time :)

melrief commented 10 years ago

I'm doing it :-). If it completes in time I will change the test that fails.

melrief commented 10 years ago

Now I have a strange error: after reinstalling everything I created a sandbox but cabal test fails with a missing library error:

> cabal sandbox init
> cabal install --only-dependencies --enable-tests
> cabal build
> cabal test
Building haskell-awk-1.0.1...
Preprocessing library haskell-awk-1.0.1...
In-place registering haskell-awk-1.0.1...
Preprocessing executable 'hawk' for haskell-awk-1.0.1...
Linking dist/build/hawk/hawk ...
Preprocessing test suite 'reference' for haskell-awk-1.0.1...
Linking dist/build/reference/reference ...
Running 1 test suites...
Test suite reference: RUNNING...
Examples: 6  Tried: 6  Errors: 0  Failures: 0
Examples: 13  Tried: 13  Errors: 0  Failures: 0

src/System/Console/Hawk.hs:52:8:
    Could not find module `System.Console.Hawk.Runtime.Base'
    Use -v to see a list of the files searched for.
Test suite reference: FAIL
Test suite logged to: dist/test/haskell-awk-1.0.1-reference.log
0 of 1 test suites (0 of 1 test cases) passed.

Do you have every seen this kind of error?

gelisam commented 10 years ago

Why --only-dependencies? As previously-discussed, the runtime must be installed in order for the tests to pass. We had decided against using Make to encode this dependency between cabal test and cabal install. Wait, do I read in that discussion that I had implemented a workaround? Has the test suite ever passed without a prior install?

Anyway, the error you have clearly indicates that Hawk can't find it's runtime, and that's because you haven't installed it yet.

melrief commented 10 years ago

You are right, but the test suite still fails because of Paths_haskell_awk:

> Configuring haskell-awk-1.0.1...
Building haskell-awk-1.0.1...
Failed to install haskell-awk-1.0.1
Last 10 lines of the build log ( /mnt/git/hawk/.cabal-sandbox/logs/haskell-awk-1.0.1.log ):
Examples: 6  Tried: 6  Errors: 0  Failures: 0
Examples: 13  Tried: 13  Errors: 0  Failures: 0

src/System/Console/Hawk/Version.hs:8:8:
    Could not find module `Paths_haskell_awk'
    Use -v to see a list of the files searched for.
Test suite reference: FAIL
Test suite logged to:
dist/dist-sandbox-eee71532/test/haskell-awk-1.0.1-reference.log
0 of 1 test suites (0 of 1 test cases) passed.
cabal: Error: some packages failed to install:
haskell-awk-1.0.1 failed during the tests phase. The exception was:
ExitFailure 1

This is weird because cabal should automagitically create that module. Do you know what could be the problem?

gelisam commented 10 years ago

Yup, it's a regression. On master, you still had to install before testing, but at least the test suite was warning you about it. I have created issue #107.

melrief commented 10 years ago

Installing fixes the issue. But now I'm back to the first problem:

### Error in tests/System/Console/Hawk/PreludeTests.hs:43: expression `test ["-d:", "-m"] "head" "passwd"'
fd:6: hGetLine: end of file
reference: fd:5: hClose: resource vanished (Broken pipe)

I hate this error.

gelisam commented 10 years ago

The test suite can't find Paths_haskell_awk? That's weird. It should be in ./dist/build/autogen/Paths_haskell_awk.hs, is it there? I remember I had to add -idist/build/autogen to inside tests/RunTests.hs so that Paths_haskell_awk would be found by doctest.

melrief commented 10 years ago

After the second cabal install everything works fine except that I have the resource vanished error again. Uff..

gelisam commented 10 years ago

I also hate this error :(

Well, since I can't reproduce it on my machine, I can't really investigate, but I can help you investigate on your side. hClose means ghci crashed while doctest (not hint) evaluated the test. Here are the commands it should be sending to ghci:

$ ghci -v0 --interactive -ignore-dot-ghci -isrc -idist/build/autogen tests/System/Console/Hawk/PreludeTests.hs -no-user-package-db -package-db /Users/gelisam/working/haskell/hawk/.cabal-sandbox/x86_64-osx-ghc-7.6.3-packages.conf.d
>>> import System.IO
>>> import GHC.IO.Handle
>>> hDuplicateTo stdout stderr
>>> hSetBuffering stdout LineBuffering
>>> hSetBuffering stderr LineBuffering
>>> hSetEncoding stdout utf8
>>> hSetEncoding stderr utf8
>>> :reload
>>> :m *System.Console.Hawk.PreludeTests
>>> test ["-d:", "-m"] "head" "passwd"

Does ghci crash when you try those?

melrief commented 10 years ago

No it doesn't. It reports a problem with the Data.ByteString.Search library:

GHCi runtime linker: fatal error: I found a duplicate definition for symbol
   __stginit_stringsearchzm0zi3zi6zi5_DataziByteStringziSearch
whilst processing object file
   /mnt/git/hawk/.cabal-sandbox/lib/x86_64-linux-ghc-7.6.3/stringsearch-0.3.6.5/libHSstringsearch-0.3.6.5.a
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.
GHCi cannot safely continue in this situation.  Exiting now.  Sorry.

Is this happening only to me? I have a complete new installation of cabal...

melrief commented 10 years ago

I'm trying without the sandbox

gelisam commented 10 years ago

No it doesn't.

It doesn't crash, but it exits early! That would explain the hClose.

It reports a problem with the Data.ByteString.Search library

That library! It's back! The first time I encountered the hClose bug, I had managed to minimize the Hawk source code while still reproducing the issue, and the issue was only occurring when the file on which doctest was run imported a file which imported a file which imported Data.ByteString.Search. Now we have a better idea why!

Hmm, I notice that I have stringsearch installed in my ~/.cabal instead of the sandbox, let me try to reproduce the issue by removing it.

Could you please paste the full output of ghci, from the start, including all the modules it loads? It's a very important piece of the puzzle.

melrief commented 10 years ago

Sure:

> ghci -v1 --interactive -ignore-dot-ghci -isrc -idist/build/autogen tests/System/Console/Hawk/PreludeTests.hs -no-user-package-db -package-db ~/.ghc/x86_64-linux-7.6.3/package.conf.d/
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[ 1 of 24] Compiling Data.Cache       ( src/Data/Cache.hs, interpreted )
[ 2 of 24] Compiling Control.Monad.Trans.State.Persistent ( src/Control/Monad/Trans/State/Persistent.hs, interpreted )
[ 3 of 24] Compiling System.Console.Hawk.UserPrelude.Base ( src/System/Console/Hawk/UserPrelude/Base.hs, interpreted )
[ 4 of 24] Compiling System.Console.Hawk.UserPrelude.Cache ( src/System/Console/Hawk/UserPrelude/Cache.hs, interpreted )
[ 5 of 24] Compiling System.Console.Hawk.UserPrelude.Extend ( src/System/Console/Hawk/UserPrelude/Extend.hs, interpreted )
[ 6 of 24] Compiling System.Console.Hawk.UserPrelude.Parse ( src/System/Console/Hawk/UserPrelude/Parse.hs, interpreted )
[ 7 of 24] Compiling Paths_haskell_awk ( dist/build/autogen/Paths_haskell_awk.hs, interpreted )
[ 8 of 24] Compiling System.Console.Hawk.Version ( src/System/Console/Hawk/Version.hs, interpreted )
[ 9 of 24] Compiling System.Console.Hawk.Lock ( src/System/Console/Hawk/Lock.hs, interpreted )
[10 of 24] Compiling System.Console.Hawk.Sandbox ( src/System/Console/Hawk/Sandbox.hs, interpreted )
[11 of 24] Compiling System.Console.Hawk.UserPrelude.Compile ( src/System/Console/Hawk/UserPrelude/Compile.hs, interpreted )
[12 of 24] Compiling System.Console.Hawk.UserPrelude ( src/System/Console/Hawk/UserPrelude.hs, interpreted )
[13 of 24] Compiling Control.Monad.Trans.Uncertain ( src/Control/Monad/Trans/Uncertain.hs, interpreted )
[14 of 24] Compiling Control.Monad.Trans.OptionParser ( src/Control/Monad/Trans/OptionParser.hs, interpreted )
[15 of 24] Compiling System.Console.Hawk.Args.Option ( src/System/Console/Hawk/Args/Option.hs, interpreted )
[16 of 24] Compiling System.Console.Hawk.Help ( src/System/Console/Hawk/Help.hs, interpreted )
[17 of 24] Compiling System.Console.Hawk.Context.Dir ( src/System/Console/Hawk/Context/Dir.hs, interpreted )
[18 of 24] Compiling System.Console.Hawk.Context.Base ( src/System/Console/Hawk/Context/Base.hs, interpreted )
[19 of 24] Compiling System.Console.Hawk.Context ( src/System/Console/Hawk/Context.hs, interpreted )
[20 of 24] Compiling System.Console.Hawk.Context.Compatibility ( src/System/Console/Hawk/Context/Compatibility.hs, interpreted )
[21 of 24] Compiling System.Console.Hawk.Args.Parse ( src/System/Console/Hawk/Args/Parse.hs, interpreted )
[22 of 24] Compiling System.Console.Hawk.Args ( src/System/Console/Hawk/Args.hs, interpreted )
[23 of 24] Compiling System.Console.Hawk ( src/System/Console/Hawk.hs, interpreted )
[24 of 24] Compiling System.Console.Hawk.PreludeTests ( tests/System/Console/Hawk/PreludeTests.hs, interpreted )
Ok, modules loaded: System.Console.Hawk, System.Console.Hawk.PreludeTests, Control.Monad.Trans.Uncertain, System.Console.Hawk.Args, System.Console.Hawk.Context, System.Console.Hawk.Context.Compatibility, System.Console.Hawk.Sandbox, System.Console.Hawk.UserPrelude, System.Console.Hawk.Help, System.Console.Hawk.Lock, System.Console.Hawk.Version, Paths_haskell_awk, Control.Monad.Trans.OptionParser, System.Console.Hawk.Args.Option, System.Console.Hawk.UserPrelude.Base, System.Console.Hawk.UserPrelude.Cache, System.Console.Hawk.UserPrelude.Compile, System.Console.Hawk.UserPrelude.Extend, System.Console.Hawk.UserPrelude.Parse, System.Console.Hawk.Context.Base, Control.Monad.Trans.State.Persistent, Data.Cache, System.Console.Hawk.Context.Dir, System.Console.Hawk.Args.Parse.
*System.Console.Hawk.PreludeTests> import System.IO
*System.Console.Hawk.PreludeTests System.IO> import GHC.IO.Handle
*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> hDuplicateTo stdout stderr
*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> hSetBuffering stdout LineBufferin

<interactive>:5:22:
    Not in scope: data constructor `LineBufferin'
    Perhaps you meant `LineBuffering' (imported from System.IO)
*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> hSetBuffering stdout LineBuffering
*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> hSetBuffering stderr LineBuffering
*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> hSetEncoding stdout utf8
*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> hSetEncoding stderr utf8
*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> :reload
Ok, modules loaded: System.Console.Hawk, System.Console.Hawk.PreludeTests, Control.Monad.Trans.Uncertain, System.Console.Hawk.Args, System.Console.Hawk.Context, System.Console.Hawk.Context.Compatibility, System.Console.Hawk.Sandbox, System.Console.Hawk.UserPrelude, System.Console.Hawk.Help, System.Console.Hawk.Lock, System.Console.Hawk.Version, Paths_haskell_awk, Control.Monad.Trans.OptionParser, System.Console.Hawk.Args.Option, System.Console.Hawk.UserPrelude.Base, System.Console.Hawk.UserPrelude.Cache, System.Console.Hawk.UserPrelude.Compile, System.Console.Hawk.UserPrelude.Extend, System.Console.Hawk.UserPrelude.Parse, System.Console.Hawk.Context.Base, Control.Monad.Trans.State.Persistent, Data.Cache, System.Console.Hawk.Context.Dir, System.Console.Hawk.Args.Parse.
*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> :m *System.Console.Hawk.PreludeTests
*System.Console.Hawk.PreludeTests> test ["-d:", "-m"] "head" "passwd"
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package unix-2.6.0.1 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package hpc-0.6.0.0 ... linking ... done.
Loading package old-time-1.1.0.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package process-1.1.0.2 ... linking ... done.
Loading package Cabal-1.16.0 ... linking ... done.
Loading package binary-0.5.1.1 ... linking ... done.
Loading package bin-package-db-0.0.0.0 ... linking ... done.
Loading package hoopl-3.9.0.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package ghc-7.6.3 ... linking ... done.
Loading package stringsearch-0.3.6.5 ... linking ... done.
Loading package haskell-awk-1.0.1 ... linking ... done.
Loading package cpphs-1.18.2 ... linking ... done.
Loading package haskell-src-exts-1.14.0.1 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package monads-tf-0.1.0.1 ... linking ... done.
Loading package MonadCatchIO-transformers-0.3.1.0 ... linking ... done.
Loading package MonadCatchIO-mtl-0.3.1.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package ghc-mtl-1.0.1.2 ... linking ... done.
Loading package ghc-paths-0.1.0.9 ... linking ... done.
Loading package syb-0.4.1 ... linking ... done.
Loading package haskell-src-1.0.1.5 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package utf8-string-0.3.7 ... linking ... done.
Loading package hint-0.3.3.7 ... linking ... done.
Loading package easy-file-0.1.1 ... linking ... done.
Loading package text-1.1.0.0 ... linking ... done.
Loading package parsec-3.1.5 ... linking ... done.
Loading package network-2.4.2.2 ... linking ... done.

GHCi runtime linker: fatal error: I found a duplicate definition for symbol
   __stginit_stringsearchzm0zi3zi6zi5_DataziByteStringziSearch
whilst processing object file
   /home/rief/.cabal/lib/x86_64-linux-ghc-7.6.3/stringsearch-0.3.6.5/libHSstringsearch-0.3.6.5.a
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.
GHCi cannot safely continue in this situation.  Exiting now.  Sorry.

Maybe the problem is related to this.

gelisam commented 10 years ago

Hmm, I notice that I have stringsearch installed in my ~/.cabal instead of the sandbox, let me try to reproduce the issue by removing it.

No luck.

gelisam commented 10 years ago

Maybe the problem is related to [a version of cryptohash built against one version of bytestring, but the rest of the GHC system built against another]

Probably! Except my ghci output uses the exact same version numbers for all of the libraries (but they are listed in a different order?) as your output, and mine doesn't complain.

My libHSstringsearch-0.3.6.5.a has this same symbol (albeit with three underscores?), and I assume yours do too. Can you find the other file which contains the duplicate symbol? Or is it hint which is trying to load the file twice? Are you running master or develop?

> nm .cabal-sandbox/lib/x86_64-osx-ghc-7.6.3/stringsearch-0.3.6.5/libHSstringsearch-0.3.6.5.a | grep '__stginit_stringsearchzm0zi3zi6zi5_DataziByteStringziSearch$'
0000000000000180 D ___stginit_stringsearchzm0zi3zi6zi5_DataziByteStringziSearch
melrief commented 10 years ago

I'm running develop (branch issue-103) without sandbox and there aren't duplicates:

> for f in `find ~/.cabal/lib/x86_64-linux-ghc-7.6.3/ -type f -iname "*.a"`; do nm $f | grep '__stginit_stringsearchzm0zi3zi6zi5_DataziByteStringziSearch$'; done   
0000000000000000 D __stginit_stringsearchzm0zi3zi6zi5_DataziByteStringziSearch
gelisam commented 10 years ago

Okay, so maybe it's hint who is loading a second copy of stringsearch. Can you try with ghci -v3? It displays extra stuff for some libraries such as unix:

*** gcc:
'/usr/bin/gcc' '-m64' '-fno-stack-protector' '-m64' '-L/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/unix-2.6.0.1' '--print-file-name' 'libdl.dylib'
Loading package unix-2.6.0.1 ... linking ... done.

On my machine, however, there is no such extra commands prior to loading stringsearch. In fact I don't think those *.a files come from C ffi calls at all; I think this is the compiled code which ghc produces. Every single library has one! It's probably the *.dylib files which contain extra C code.

There is also -v4, but the output is really excessive, and on my machine it didn't even display anything extra before stringsearch either.

melrief commented 10 years ago

Uhmm it doesn't add informations:

*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> :reload
*** Chasing dependencies:
Chasing modules from: *tests/System/Console/Hawk/PreludeTests.hs
Stable obj: []
Stable BCO: [System.Console.Hawk.PreludeTests, System.Console.Hawk,
             System.Console.Hawk.Args, System.Console.Hawk.Args.Parse,
             System.Console.Hawk.Context.Compatibility,
             System.Console.Hawk.Context, System.Console.Hawk.Context.Base,
             System.Console.Hawk.Context.Dir, System.Console.Hawk.Help,
             System.Console.Hawk.Args.Option, Control.Monad.Trans.OptionParser,
             Control.Monad.Trans.Uncertain, System.Console.Hawk.UserPrelude,
             System.Console.Hawk.UserPrelude.Compile,
             System.Console.Hawk.Sandbox, System.Console.Hawk.Lock,
             System.Console.Hawk.Version, Paths_haskell_awk,
             System.Console.Hawk.UserPrelude.Parse,
             System.Console.Hawk.UserPrelude.Extend,
             System.Console.Hawk.UserPrelude.Cache,
             System.Console.Hawk.UserPrelude.Base,
             Control.Monad.Trans.State.Persistent, Data.Cache]
unload: retaining objs []
unload: retaining bcos []
Ready for upsweep
  [NONREC
      ModSummary {
         ms_hs_date = 2014-01-26 20:12:38 UTC
         ms_mod = main:Data.Cache,
         ms_textual_imps = [import (implicit) Prelude, import Data.Maybe,
                            import Control.Monad.Trans.State, import "mtl" Control.Monad.Trans,
                            import Control.Monad]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-01-26 20:12:38 UTC
         ms_mod = main:Control.Monad.Trans.State.Persistent,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Directory, import Data.Functor.Identity,
                            import Control.Monad.Trans.State, import "mtl" Control.Monad.Trans,
                            import Control.Monad.IO.Class, import Control.Monad]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-02 13:15:46 UTC
         ms_mod = main:System.Console.Hawk.UserPrelude.Base,
         ms_textual_imps = [import (implicit) Prelude,
                            import Data.ByteString.Char8]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-03-01 20:01:01 UTC
         ms_mod = main:System.Console.Hawk.UserPrelude.Cache,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.UserPrelude.Base,
                            import System.EasyFile,
                            import qualified Data.ByteString.Char8 as B,
                            import Control.Applicative ( (<$>) )]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-02 13:15:46 UTC
         ms_mod = main:System.Console.Hawk.UserPrelude.Extend,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.UserPrelude.Base, import Text.Printf,
                            import Data.Monoid ( (<>) ), import Data.Maybe, import Data.Char,
                            import qualified Data.ByteString.Search as BSS,
                            import qualified Data.ByteString.Char8 as C8,
                            import Data.ByteString.Char8 ( ByteString )]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-02 13:15:46 UTC
         ms_mod = main:System.Console.Hawk.UserPrelude.Parse,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.UserPrelude.Base, import Text.Printf,
                            import System.Exit, import Language.Haskell.Exts.Syntax,
                            import Language.Haskell.Exts.Parser
                                ( getTopPragmas, ParseResult(..) ),
                            import Language.Haskell.Exts.Extension
                                ( parseExtension, Extension(..) ),
                            import Language.Haskell.Exts ( parseFileContentsWithExts ),
                            import Data.Maybe, import qualified Data.ByteString.Char8 as C8,
                            import Control.Applicative ( (<$>) )]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-03-03 09:51:50 UTC
         ms_mod = main:Paths_haskell_awk,
         ms_textual_imps = [import Prelude,
                            import System.Environment ( getEnv ),
                            import Data.Version ( Version(..) ),
                            import qualified Control.Exception as Exception]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-01-18 21:04:51 UTC
         ms_mod = main:System.Console.Hawk.Version,
         ms_textual_imps = [import (implicit) Prelude,
                            import Paths_haskell_awk ( version ),
                            import Data.Version ( versionBranch ),
                            import Data.List ( intercalate )]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-09 18:28:09 UTC
         ms_mod = main:System.Console.Hawk.Lock,
         ms_textual_imps = [import (implicit) Prelude, import Text.Printf,
                            import Network.Socket, import Network ( PortID(..), connectTo ),
                            import Network.BSD ( getProtocolNumber ),
                            import GHC.IO.Handle ( Handle, hGetContents, hClose ),
                            import GHC.IO.Exception, import Data.List ( elemIndex ),
                            import Control.Monad ( when, guard ), import Control.Exception,
                            import Control.Concurrent ( threadDelay )]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-09 18:28:09 UTC
         ms_mod = main:System.Console.Hawk.Sandbox,
         ms_textual_imps = [import (implicit) Prelude,
                            import Paths_haskell_awk ( getBinDir ),
                            import Text.Printf ( printf ),
                            import System.FilePath ( pathSeparator ),
                            import System.Directory ( getDirectoryContents ),
                            import Language.Haskell.Interpreter.Unsafe
                                ( unsafeRunInterpreterWithArgs ),
                            import Language.Haskell.Interpreter
                                ( InterpreterT, InterpreterError ),
                            import Data.List, import Control.Applicative]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-02 14:08:55 UTC
         ms_mod = main:System.Console.Hawk.UserPrelude.Compile,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.Sandbox ( extraGhcArgs ),
                            import System.Process, import System.IO, import System.FilePath,
                            import System.Exit, import System.Directory,
                            import Control.Monad ( when )]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-03-01 20:04:53 UTC
         ms_mod = main:System.Console.Hawk.UserPrelude,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.UserPrelude.Parse,
                            import System.Console.Hawk.UserPrelude.Extend,
                            import System.Console.Hawk.UserPrelude.Compile,
                            import System.Console.Hawk.UserPrelude.Cache,
                            import System.Console.Hawk.UserPrelude.Base,
                            import System.EasyFile, import Control.Monad ( when ),
                            import Control.Arrow ( (&&&) )]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-09 18:28:09 UTC
         ms_mod = main:Control.Monad.Trans.Uncertain,
         ms_textual_imps = [import (implicit) Prelude, import Text.Printf,
                            import System.IO, import System.Exit,
                            import "transformers" Control.Monad.Trans.Writer,
                            import "transformers" Control.Monad.Trans.Error hiding ( Error ),
                            import "mtl" Control.Monad.Identity,
                            import "mtl" Control.Monad.Trans, import Control.Applicative]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-09 18:28:09 UTC
         ms_mod = main:Control.Monad.Trans.OptionParser,
         ms_textual_imps = [import (implicit) Prelude,
                            import Control.Monad.Trans.Uncertain, import Text.Printf,
                            import qualified System.Console.GetOpt as GetOpt,
                            import Data.Maybe, import Data.List,
                            import Control.Monad.Trans.State, import "mtl" Control.Monad.Trans,
                            import "mtl" Control.Monad.Identity, import Control.Monad,
                            import Control.Applicative]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-09 18:28:09 UTC
         ms_mod = main:System.Console.Hawk.Args.Option,
         ms_textual_imps = [import (implicit) Prelude,
                            import Control.Monad.Trans.OptionParser, import Text.Printf,
                            import Data.ByteString.Char8 ( pack ),
                            import Data.ByteString ( ByteString )]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-01-26 20:12:38 UTC
         ms_mod = main:System.Console.Hawk.Help,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.Args.Option,
                            import Control.Monad.Trans.OptionParser, import Text.Printf,
                            import System.IO, import System.Exit, import System.Environment]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-09 18:28:09 UTC
         ms_mod = main:System.Console.Hawk.Context.Dir,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.UserPrelude.Cache,
                            import System.Console.Hawk.UserPrelude,
                            import Control.Monad.Trans.Uncertain,
                            import System.EasyFile
                                hiding ( getCurrentDirectory, getModificationTime ),
                            import System.Directory, import "mtl" Control.Monad.Trans,
                            import Control.Monad]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-09 19:32:00 UTC
         ms_mod = main:System.Console.Hawk.Context.Base,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.UserPrelude.Parse,
                            import System.Console.Hawk.UserPrelude.Cache,
                            import System.Console.Hawk.UserPrelude.Base,
                            import System.Console.Hawk.UserPrelude,
                            import System.Console.Hawk.Lock,
                            import System.Console.Hawk.Context.Dir, import Data.Cache,
                            import Control.Monad.Trans.State.Persistent,
                            import Control.Monad.Trans.Uncertain, import System.IO,
                            import System.Directory, import "mtl" Control.Monad.Trans]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-02 13:15:46 UTC
         ms_mod = main:System.Console.Hawk.Context,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.Context.Base]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-02 13:15:46 UTC
         ms_mod = main:System.Console.Hawk.Context.Compatibility,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.Context.Base, import Control.Arrow]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-03-01 23:49:36 UTC
         ms_mod = main:System.Console.Hawk.Args.Parse,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.Context.Dir,
                            import System.Console.Hawk.Args.Spec,
                            import System.Console.Hawk.Args.Option ( HawkOption, options ),
                            import qualified System.Console.Hawk.Args.Option as Option,
                            import Control.Monad.Trans.Uncertain,
                            import Control.Monad.Trans.OptionParser,
                            import "mtl" Control.Monad.Trans, import Data.Char ( isSpace ),
                            import Control.Applicative]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-03-01 20:04:53 UTC
         ms_mod = main:System.Console.Hawk.Args,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk.Args.Spec,
                            import System.Console.Hawk.Args.Parse]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-03-01 20:04:53 UTC
         ms_mod = main:System.Console.Hawk,
         ms_textual_imps = [import System.Console.Hawk.Version,
                            import System.Console.Hawk.Runtime.Base,
                            import System.Console.Hawk.Lock, import System.Console.Hawk.Help,
                            import System.Console.Hawk.UserPrelude,
                            import System.Console.Hawk.Sandbox,
                            import System.Console.Hawk.Context.Compatibility,
                            import qualified System.Console.Hawk.Context as Context,
                            import System.Console.Hawk.Args.Spec,
                            import System.Console.Hawk.Args,
                            import Control.Monad.Trans.Uncertain,
                            import Text.Printf ( printf ), import System.IO ( IO ),
                            import qualified System.IO as IO, import qualified Prelude as P,
                            import Language.Haskell.Interpreter,
                            import Data.Typeable.Internal ( TypeRep(..), tyConName ),
                            import qualified Data.Typeable.Internal as Typeable,
                            import Data.String, import Data.Maybe, import Data.Function,
                            import Data.Either, import Data.List ( (++) ),
                            import qualified Data.List as L, import Control.Monad]
         ms_srcimps = []
      },
   NONREC
      ModSummary {
         ms_hs_date = 2014-02-09 19:32:00 UTC
         ms_mod = main:System.Console.Hawk.PreludeTests,
         ms_textual_imps = [import (implicit) Prelude,
                            import System.Console.Hawk, import System.FilePath]
         ms_srcimps = []
      }]
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
*** Deleting temp files:
Deleting: 
Upsweep completely successful.
*** Deleting temp files:
Deleting: 
Ok, modules loaded: System.Console.Hawk, System.Console.Hawk.PreludeTests, Control.Monad.Trans.Uncertain, System.Console.Hawk.Args, System.Console.Hawk.Context, System.Console.Hawk.Context.Compatibility, System.Console.Hawk.Sandbox, System.Console.Hawk.UserPrelude, System.Console.Hawk.Help, System.Console.Hawk.Lock, System.Console.Hawk.Version, Paths_haskell_awk, Control.Monad.Trans.OptionParser, System.Console.Hawk.Args.Option, System.Console.Hawk.UserPrelude.Base, System.Console.Hawk.UserPrelude.Cache, System.Console.Hawk.UserPrelude.Compile, System.Console.Hawk.UserPrelude.Extend, System.Console.Hawk.UserPrelude.Parse, System.Console.Hawk.Context.Base, Control.Monad.Trans.State.Persistent, Data.Cache, System.Console.Hawk.Context.Dir, System.Console.Hawk.Args.Parse.
*System.Console.Hawk.PreludeTests System.IO GHC.IO.Handle> :m *System.Console.Hawk.PreludeTests
*System.Console.Hawk.PreludeTests> test ["-d:", "-m"] "head" "passwd"
*** Parser:
*** Desugar:
*** Simplify:
*** CorePrep:
*** ByteCodeGen:
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
*** gcc:
'/usr/bin/gcc' '-fno-stack-protector' '-Wl,--hash-size=31' '-Wl,--reduce-memory-overheads' '-L/usr/lib/ghc/unix-2.6.0.1' '--print-file-name' 'librt.so'
*** gcc:
'/usr/bin/gcc' '-fno-stack-protector' '-Wl,--hash-size=31' '-Wl,--reduce-memory-overheads' '-L/usr/lib/ghc/unix-2.6.0.1' '--print-file-name' 'libutil.so'
*** gcc:
'/usr/bin/gcc' '-fno-stack-protector' '-Wl,--hash-size=31' '-Wl,--reduce-memory-overheads' '-L/usr/lib/ghc/unix-2.6.0.1' '--print-file-name' 'libdl.so'
*** gcc:
'/usr/bin/gcc' '-fno-stack-protector' '-Wl,--hash-size=31' '-Wl,--reduce-memory-overheads' '-L/usr/lib/ghc/unix-2.6.0.1' '--print-file-name' 'libpthread.so'
Loading package unix-2.6.0.1 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package hpc-0.6.0.0 ... linking ... done.
Loading package old-time-1.1.0.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package process-1.1.0.2 ... linking ... done.
Loading package Cabal-1.16.0 ... linking ... done.
Loading package binary-0.5.1.1 ... linking ... done.
Loading package bin-package-db-0.0.0.0 ... linking ... done.
Loading package hoopl-3.9.0.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package ghc-7.6.3 ... linking ... done.
Loading package stringsearch-0.3.6.5 ... linking ... done.
Loading package haskell-awk-1.0.1 ... linking ... done.
Loading package cpphs-1.18.2 ... linking ... done.
Loading package haskell-src-exts-1.14.0.1 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package monads-tf-0.1.0.1 ... linking ... done.
Loading package MonadCatchIO-transformers-0.3.1.0 ... linking ... done.
Loading package MonadCatchIO-mtl-0.3.1.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package ghc-mtl-1.0.1.2 ... linking ... done.
Loading package ghc-paths-0.1.0.9 ... linking ... done.
Loading package syb-0.4.1 ... linking ... done.
Loading package haskell-src-1.0.1.5 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package utf8-string-0.3.7 ... linking ... done.
Loading package hint-0.3.3.7 ... linking ... done.
Loading package easy-file-0.1.1 ... linking ... done.
Loading package text-1.1.0.0 ... linking ... done.
Loading package parsec-3.1.5 ... linking ... done.
Loading package network-2.4.2.2 ... linking ... done.

GHCi runtime linker: fatal error: I found a duplicate definition for symbol
   __stginit_stringsearchzm0zi3zi6zi5_DataziByteStringziSearch
whilst processing object file
   /home/rief/.cabal/lib/x86_64-linux-ghc-7.6.3/stringsearch-0.3.6.5/libHSstringsearch-0.3.6.5.a
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.
GHCi cannot safely continue in this situation.  Exiting now.  Sorry.
gelisam commented 10 years ago

I'm running out of ideas. Just as a sanity check: if you modify the runtime so that it no longer needs stringsearch, the error goes away, right?

melrief commented 10 years ago

I have removed Data.ByteString.Search from runtime/System/Console/Hawk/Runtime/Base.hs but the result is the same. I really don't understand why this happens! I checked with ghc-pkg and did some tests on the integrity of the package database but everything seems fine. And this happens with and without the sandbox on my computer.

gelisam commented 10 years ago

Did you cabal install after removing Data.ByteString.Search? Does the error still happen if you reduce the runtime to foo = 42 and the doctest to runInterpreter $ loadModuleQ [("Runtime", Nothing)] >> interpret "foo" (as :: Int)?

melrief commented 10 years ago

Yes I cabal install. I commented the whole runtime/System/Console/Hawk/Runtime/Base.hs and added foo, but what do you mean by reducing doctest to that expression?

gelisam commented 10 years ago

Oh, right, we're using ghci now, not doctest. I meant to use runInterpreter ... instead of test ["-d:", "-m"] "head" "passwd".

melrief commented 10 years ago

Now it says that it cannot import the module Runtime (I changed loadModuleQ to loadModules because hint-0.3.3.7 doesn't have that function...):

> ghci -v0 --interactive -ignore-dot-ghci -isrc -idist/build/autogen tests/System/Console/Hawk/PreludeTests.hs -no-user-package-db -package-db .cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d
*System.Console.Hawk.PreludeTests> 
*System.Console.Hawk.PreludeTests> :m *System.Console.Hawk.PreludeTests
*System.Console.Hawk.PreludeTests> import Language.Haskell.Interpreter
*System.Console.Hawk.PreludeTests Language.Haskell.Interpreter> runInterpreter $ loadModules ["Runtime"] >> interpret "foo" (as :: Int)
Left (WontCompile [GhcError {errMsg = "Could not find module `Runtime'\nUse -v to see a list of the files searched for."}])
gelisam commented 10 years ago

I changed loadModuleQ to loadModules because hint-0.3.3.7 doesn't have that function...

Oops! I wrote the code from memory and got some details wrong.

Could not find module `Runtime'

Yes, because module "Runtime" doesn't exist. I thought it was clear that I meant System.Console.Hawk.Runtime.Base, sorry for being so vague!

At this point, I'm just trying to help you debug by pointing out the steps I have followed (namely reducing all the code as much as possible) when I last encountered the issue. My suggestions might actually be useful!

Another thing to try: can you at least get master to work?

melrief commented 10 years ago

Sorry, I'm doing some debugging in parallel and I haven't elaborate what you where saying. I did also the experiment with the correct one:

*System.Console.Hawk.PreludeTests Language.Haskell.Interpreter> runInterpreter $ loadModules ["System.Console.Hawk.Runtime.Base"] >> interpret "foo" (as :: Int)
Left (WontCompile [GhcError {errMsg = "module `System.Console.Hawk.Runtime.Base' is a package module"}])

I don't know why I can't import a package module. Tomorrow I will try with master.

gelisam commented 10 years ago

My suggestions might actually be useful!

What a typo. I meant to say that they might not be useful :)

gelisam commented 10 years ago

I changed loadModuleQ to loadModules because hint-0.3.3.7 doesn't have that function...

It was setImportsQ. I think there is a big difference between loadModule and setImports: one of them interprets the module, while the other loads the compiled module. If loadModule works, that's actually bad news, because it means the source for hawk's runtime is available to hint. The whole point of moving the source to runtime instead of src was to prevent ghci and hint from finding and interpreting it!

gelisam commented 10 years ago

I don't know why I can't import a package module.

I know what's a package, I know what's a module... but what's a "package module"?

melrief commented 10 years ago

No ok, there is a problem in my configuration: I removed everything from Runtime but the interpreter can still see processTable and not foo. That means that there is another copy of the library with this info and probably this is the source of the problem.

By the way thanks for your help gelisam. I was trying to fix this asap and then close this issue but apparently it's more complicated than what I thought. In particular because I deleted .cabal and .ghc yesterday so everything is new...

gelisam commented 10 years ago

I think you might need to delete it again! That might be where processTable is hidden. Either there or in the sandbox.

gelisam commented 10 years ago

Oh, I know where that copy must be! It must be in ~/.cabal. Normally hint doesn't look inside the sandbox, unless you tell him where to look via something like unsafeRunInterpreterWithArgs ["-package-db", ".cabal-sandbox/x86-linux.conf"]. With the regular runInterpreter, hint only looks in ~/.cabal.

melrief commented 10 years ago

Apparently if I create a new user and use it to test hawk tests work perfectly. So my normal user has something wrong in its configuration and it's not hawk. But I still have no idea of what can be.

gelisam commented 10 years ago

I can think of six places: ~/.cabal, ~/.ghc, ~/.ghci, ~/.hawk, ./cabal-sandbox, and ./cabal-dev. If you copy all those (if applicable, you probably don't have two flavors of sandboxes at once) to the new user, does the error transfer to the new user?

Another possible difference: maybe the PATH of your new user finds a different version of cabal, ghc or doctest? On 4 Mar 2014 15:45, "Mario Pastorelli" notifications@github.com wrote:

Apparently if I create a new user and use it to test hawk tests work perfectly. So my normal user has something wrong in its configuration and it's not hawk. But I still have no idea of what can be.

— Reply to this email directly or view it on GitHubhttps://github.com/gelisam/hawk/issues/103#issuecomment-36671907 .

melrief commented 10 years ago

No, it's incredible but the error doesn't transfer to the new user and I copied everything. Also, the version of cabal, ghc and doctest are the same. The only difference is that the two hawk directories differs on files that haven't been committed or are not part of the repository. So I'm cloning the project again and building it again.

melrief commented 10 years ago

Ok, I cloned the repository again with my original user and it does work! So there is something in the old directory that is creating the problem. I'm investigating further. Just to double-check: can you confirm that when you run the tests on the issue-103 branch you get:

Building haskell-awk-1.0.1...
Preprocessing library haskell-awk-1.0.1...
In-place registering haskell-awk-1.0.1...
Preprocessing executable 'hawk' for haskell-awk-1.0.1...
Preprocessing test suite 'reference' for haskell-awk-1.0.1...
Running 1 test suites...
Test suite reference: RUNNING...
Examples: 6  Tried: 6  Errors: 0  Failures: 0

repr'
- can convert tuple values

repr
- can convert boolean values
- can convert char values
- can convert double values
- can convert float values
- can convert int values
- can convert integer values
- can convert maybe values
- can convert unit value
- can convert string values
- can convert tuple values
- can convert list values
- can convert map values
- can convert set values

parseModules
- returns empty when no modules are declared
- returns the module with Nothing for unqualified imports
- returns the module with its qualification for qualified imports
- returns the module both unqualified and with qualification for mixed

Finished in 0.0033 seconds
18 examples, 0 failures

Hawk
- evals "" on input "" equals to "" FAILED [1]
- evals "1" on input "" equals to "1" FAILED [2]
- evals "1+1" on input "" equals to "2" FAILED [3]
- evals "[]" on input "" equals to "" FAILED [4]
- evals "[1]" on input "" equals to "1" FAILED [5]
- evals "[1,2]" on input "" equals to "1\n2" FAILED [6]
- evals "(1,2)" on input "" equals to "1\n2" FAILED [7]
- evals "[[1]]" on input "" equals to "1" FAILED [8]
- evals "[[1,2]]" on input "" equals to "1 2" FAILED [9]
- evals "[[1,2],[3,4]]" on input "" equals to "1 2\n3 4" FAILED [10]
- evals "id" on input "foo" equals to "foo" FAILED [11]
- evals "L.transpose" on input "1 2\n3 4" equals to "1 3\n2 4" FAILED [12]
- evals "L.map (!! 1)" on input "1 2\n3 4" equals to "2\n4" FAILED [13]
- evals "(!! 1)" on input "1 2\n3 4" equals to "2\n4" FAILED [14]

1) Hawk evals "" on input "" equals to ""
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

2) Hawk evals "1" on input "" equals to "1"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

3) Hawk evals "1+1" on input "" equals to "2"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

4) Hawk evals "[]" on input "" equals to ""
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

5) Hawk evals "[1]" on input "" equals to "1"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

6) Hawk evals "[1,2]" on input "" equals to "1\n2"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

7) Hawk evals "(1,2)" on input "" equals to "1\n2"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

8) Hawk evals "[[1]]" on input "" equals to "1"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

9) Hawk evals "[[1,2]]" on input "" equals to "1 2"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

10) Hawk evals "[[1,2],[3,4]]" on input "" equals to "1 2\n3 4"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

11) Hawk evals "id" on input "foo" equals to "foo"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

12) Hawk evals "L.transpose" on input "1 2\n3 4" equals to "1 3\n2 4"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

13) Hawk evals "L.map (!! 1)" on input "1 2\n3 4" equals to "2\n4"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

14) Hawk evals "(!! 1)" on input "1 2\n3 4" equals to "2\n4"
WontCompile [GhcError {errMsg = "Could not find module `System.Console.Hawk.IO'\nPerhaps you meant System.Console.ANSI (from ansi-terminal-0.6.1.1)\nUse -v to see a list of the files searched for."}]

Randomized with seed 87384712961134

Finished in 1.3403 seconds
14 examples, 14 failures
Test suite reference: FAIL
Test suite logged to: dist/test/haskell-awk-1.0.1-reference.log
0 of 1 test suites (0 of 1 test cases) passed.
melrief commented 10 years ago

I forgot to switch to issue-103 branch. So master does compile and test hawk but issue-103 branch doesn't and I get the resource vanished error. I'm trying on develop.