Skip to content

Instantly share code, notes, and snippets.

@nuttycom
Created March 4, 2016 15:57
Show Gist options
  • Save nuttycom/7352d2a510535d753c78 to your computer and use it in GitHub Desktop.
Save nuttycom/7352d2a510535d753c78 to your computer and use it in GitHub Desktop.
WTF, Stack?
nuttycom@lights: ~/personal/aftok (auction_tests|MERGING)$ stack build
aftok-0.1: configure
Configuring aftok-0.1...
aftok-0.1: build
Building aftok-0.1...
Preprocessing library aftok-0.1...
[ 1 of 11] Compiling Aftok.Util.Http ( lib/Aftok/Util/Http.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Util/Http.o )
[ 2 of 11] Compiling Aftok.Util ( lib/Aftok/Util.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Util.o )
[ 3 of 11] Compiling Aftok.Interval ( lib/Aftok/Interval.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Interval.o )
[ 4 of 11] Compiling Aftok.Types ( lib/Aftok/Types.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Types.o )
[ 5 of 11] Compiling Aftok ( lib/Aftok.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok.o )
[ 6 of 11] Compiling Aftok.Auction ( lib/Aftok/Auction.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Auction.o )
[ 7 of 11] Compiling Aftok.TimeLog ( lib/Aftok/TimeLog.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/TimeLog.o )
[ 8 of 11] Compiling Aftok.Database ( lib/Aftok/Database.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Database.o )
[ 9 of 11] Compiling Aftok.Json ( lib/Aftok/Json.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Json.o )
[10 of 11] Compiling Aftok.Client ( lib/Aftok/Client.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Client.o )
[11 of 11] Compiling Aftok.Database.PostgreSQL ( lib/Aftok/Database/PostgreSQL.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Database/PostgreSQL.o )
In-place registering aftok-0.1...
Preprocessing executable 'aftok-server' for aftok-0.1...
[2 of 8] Compiling Aftok.Snaplet ( server/Aftok/Snaplet.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/aftok-server/aftok-server-tmp/Aftok/Snaplet.o ) [Aftok changed]
[3 of 8] Compiling Aftok.Snaplet.Auth ( server/Aftok/Snaplet/Auth.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/aftok-server/aftok-server-tmp/Aftok/Snaplet/Auth.o ) [Aftok changed]
[4 of 8] Compiling Aftok.Snaplet.Users ( server/Aftok/Snaplet/Users.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/aftok-server/aftok-server-tmp/Aftok/Snaplet/Users.o ) [Aftok changed]
[5 of 8] Compiling Aftok.Snaplet.WorkLog ( server/Aftok/Snaplet/WorkLog.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/aftok-server/aftok-server-tmp/Aftok/Snaplet/WorkLog.o ) [Aftok changed]
[7 of 8] Compiling Aftok.Snaplet.Projects ( server/Aftok/Snaplet/Projects.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/aftok-server/aftok-server-tmp/Aftok/Snaplet/Projects.o ) [Aftok changed]
[8 of 8] Compiling Main ( server/Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/aftok-server/aftok-server-tmp/Main.o ) [Aftok.Json changed]
Linking .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/aftok-server/aftok-server ...
aftok-0.1: install
Installing library in
/Users/nuttycom/personal/aftok/.stack-work/install/x86_64-osx/lts-5.3/7.10.3/lib/x86_64-osx-ghc-7.10.3/aftok-0.1-ALypbX4smqg6jMHDTfbZd3
Installing executable(s) in
/Users/nuttycom/personal/aftok/.stack-work/install/x86_64-osx/lts-5.3/7.10.3/bin
Registering aftok-0.1...
nuttycom@lights: ~/personal/aftok (auction_tests|MERGING)$ stack test
aftok-0.1: configure (test)
Configuring aftok-0.1...
aftok-0.1: build (test)
Preprocessing library aftok-0.1...
[ 1 of 11] Compiling Aftok.Util.Http ( lib/Aftok/Util/Http.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Util/Http.o )
[ 2 of 11] Compiling Aftok.Util ( lib/Aftok/Util.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Util.o )
[ 3 of 11] Compiling Aftok.Interval ( lib/Aftok/Interval.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Interval.o )
[ 4 of 11] Compiling Aftok.Types ( lib/Aftok/Types.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Types.o )
[ 5 of 11] Compiling Aftok ( lib/Aftok.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok.o )
[ 6 of 11] Compiling Aftok.Auction ( lib/Aftok/Auction.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Auction.o )
[ 7 of 11] Compiling Aftok.TimeLog ( lib/Aftok/TimeLog.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/TimeLog.o )
[ 8 of 11] Compiling Aftok.Database ( lib/Aftok/Database.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Database.o )
[ 9 of 11] Compiling Aftok.Json ( lib/Aftok/Json.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Json.o )
[10 of 11] Compiling Aftok.Client ( lib/Aftok/Client.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Client.o )
[11 of 11] Compiling Aftok.Database.PostgreSQL ( lib/Aftok/Database/PostgreSQL.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Aftok/Database/PostgreSQL.o )
In-place registering aftok-0.1...
Preprocessing test suite 'spec' for aftok-0.1...
[2 of 4] Compiling Aftok.TimeLogSpec ( test/Aftok/TimeLogSpec.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/spec/spec-tmp/Aftok/TimeLogSpec.o )
test/Aftok/TimeLogSpec.hs:38:38:
Not in scope: ‘end’
Perhaps you meant one of these:
‘I.end’ (imported from Aftok.Interval),
‘snd’ (imported from ClassyPrelude),
‘and’ (imported from ClassyPrelude)
test/Aftok/TimeLogSpec.hs:94:75:
Not in scope: ‘start’
Perhaps you meant one of these:
‘I.start’ (imported from Aftok.Interval),
‘I.start'’ (imported from Aftok.Interval),
‘I._start’ (imported from Aftok.Interval)
test/Aftok/TimeLogSpec.hs:94:101:
Not in scope: ‘end’
Perhaps you meant one of these:
‘I.end’ (imported from Aftok.Interval),
‘snd’ (imported from ClassyPrelude),
‘and’ (imported from ClassyPrelude)
-- While building package aftok-0.1 using:
/Users/nuttycom/.stack/programs/x86_64-osx/ghc-7.10.3/bin/runhaskell -package=Cabal-1.22.5.0 -clear-package-db -global-package-db -package-db=/Users/nuttycom/.stack/snapshots/x86_64-osx/lts-5.3/7.10.3/pkgdb/ /var/folders/nl/0dm4tyhd7kv_w_tmbl62km9h0000gn/T/stack72563/Setup.hs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0/ build test:spec
Process exited with code: ExitFailure 1
nuttycom@lights: ~/personal/aftok (auction_tests|MERGING)$ stack test
Test suite spec executable not found for aftok
Test suite failure for package aftok-0.1
spec: executable not found
Logs printed to console
nuttycom@lights: ~/personal/aftok (auction_tests|MERGING)$ stack build
nuttycom@lights: ~/personal/aftok (auction_tests|MERGING)$ stack test
Test suite spec executable not found for aftok
Test suite failure for package aftok-0.1
spec: executable not found
Logs printed to console
@nuttycom
Copy link
Author

nuttycom commented Mar 4, 2016

In case it's not clear what's going on here, after running 'stack build', the first time around, 'stack test' rightly gives some compilation errors. However, if I attempt to run 'stack test' again, immediately, without changing any source files, it complains that the executable is not found. What am I doing wrong?

@joshcough
Copy link

Sounds like a bug. It might be that it's confused because you haven't made any changes to the test source files. What happens if you change a test file?

@nuttycom
Copy link
Author

nuttycom commented Mar 4, 2016

@joshcough same behavior, running 'stack test' can't find the executable.

@joshcough
Copy link

:( Weird. I will try to reproduce.

@joshcough
Copy link

@nuttycom: i couldn't reproduce. The only difference is that when I do a second stack build, I get some actual output, though it doesn't compile anything:

glam-0.1.0.0: build
Preprocessing library glam-0.1.0.0...
In-place registering glam-0.1.0.0...
glam-0.1.0.0: copy/register
Installing library in
/Users/josh/work/glam/.stack-work/install/x86_64-osx/lts-5.1/7.10.3/lib/x86_64-osx-ghc-7.10.3/glam-0.1.0.0-IcSDZMWfkKDFnxjfyUnj4I
Registering glam-0.1.0.0...
sentinel:flare josh$ stack test
...

@nuttycom
Copy link
Author

nuttycom commented Mar 4, 2016

@joshcough thanks. I'll see if I can develop a minimal example and file a bug.

@nuttycom
Copy link
Author

nuttycom commented Mar 4, 2016

Weirder and weirder. Two different tmux panes on the same machine:

nuttycom@lights: ~/personal/aftok (auction_tests)$ which stack
/Users/nuttycom/.local/bin/stack
nuttycom@lights: ~/personal/aftok (auction_tests)$ stack --version
Version 0.1.2.0, Git revision 65246552936b7da4b64b38372feac903d96a8911
nuttycom@lights: ~/personal/aftok (auction_tests)$ which stack
/Users/nuttycom/.local/bin/stack
nuttycom@lights: ~/personal/aftok (auction_tests)$ stack --version
Version 1.0.4.1 x86_64

How is this even possible??? The only difference between the output of env on these two panes is the value of $OLDPWD

@nuttycom
Copy link
Author

nuttycom commented Mar 4, 2016

However, the pane with 1.0.4.1 seems to build fine. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment