Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building just the library component #3427

Closed
ivan-m opened this issue Sep 12, 2017 · 3 comments
Closed

Building just the library component #3427

ivan-m opened this issue Sep 12, 2017 · 3 comments

Comments

@ivan-m
Copy link
Contributor

ivan-m commented Sep 12, 2017

General summary/comments (optional)

I have a package with both a library and an executable (which depends on the library). Whenever I try to build just the library (so that I can restart my stack ghci process for the executable to develop against the changes I've made) the executable section is built as well.

As an example I'm going to take my jbi project (as I first noticed this on an internal project).

Steps to reproduce

  1. Clone jbi src
  2. echo "resolver: lts-9.4" >> stack.yaml
  3. echo "blah" >> src/Main.hs
  4. Try to build the library only: stack build jbi:lib.

Expected

Library is built successfully. Executable is not touched.

Actual

Library is built, then stack attempts to build the executable as well and fails. As such, the entire build fails.

(Run once already to get dependencies downloaded, library built, etc. thus minimising noise.)

$ stack build jbi:lib --verbose
Version 1.5.1 x86_64
Compiled with:
- Cabal-1.24.2.0
- Glob-0.8.0
- HUnit-1.5.0.0
- MonadRandom-0.5.1
- QuickCheck-2.9.2
- SHA-1.6.4.2
- StateVar-1.1.0.4
- aeson-1.1.2.0
- aeson-compat-0.3.6
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.6.3.1
- ansi-wl-pprint-0.6.7.3
- array-0.5.1.1
- asn1-encoding-0.9.5
- asn1-parse-0.9.4
- asn1-types-0.3.2
- async-2.1.1.1
- attoparsec-0.13.1.0
- attoparsec-iso8601-1.0.0.0
- auto-update-0.1.4
- base-4.9.1.0
- base-compat-0.9.3
- base-orphans-0.6
- base16-bytestring-0.1.1.6
- base64-bytestring-1.0.0.1
- bifunctors-5.4.2
- binary-0.8.3.0
- binary-tagged-0.1.4.2
- bitarray-0.0.1.1
- blaze-builder-0.4.0.2
- blaze-html-0.9.0.1
- blaze-markup-0.8.0.0
- byteable-0.1.1
- bytestring-0.10.8.1
- call-stack-0.1.0
- case-insensitive-1.2.0.10
- cereal-0.5.4.0
- clock-0.7.2
- comonad-5.0.2
- conduit-1.2.11
- conduit-extra-1.1.16
- connection-0.2.8
- constraints-0.9.1
- containers-0.5.7.1
- contravariant-1.4
- cookie-0.4.2.1
- cryptohash-0.11.9
- cryptohash-sha256-0.11.100.1
- cryptonite-0.23
- cryptonite-conduit-0.2.0
- data-default-class-0.1.2.0
- deepseq-1.4.2.0
- digest-0.0.1.2
- directory-1.3.0.0
- distributive-0.5.3
- dlist-0.8.0.3
- easy-file-0.2.1
- echo-0.1.3
- ed25519-0.0.5.0
- either-4.4.1.1
- errors-2.2.1
- exceptions-0.8.3
- extra-1.5.3
- fail-4.9.0.0
- fast-logger-2.4.10
- file-embed-0.0.10
- filelock-0.1.1.2
- filepath-1.4.1.1
- foundation-0.0.13
- free-4.12.4
- fsnotify-0.2.1.1
- generic-deriving-1.11.2
- generics-sop-0.3.1.0
- ghc-boot-th-8.0.2
- ghc-prim-0.5.0.0
- gitrev-1.3.1
- hackage-security-0.5.2.2
- hashable-1.2.6.1
- hastache-0.6.1
- hfsevents-0.1.6
- hourglass-0.2.10
- hpack-0.18.1
- hpc-0.6.0.3
- hspec-2.4.4
- hspec-core-2.4.4
- hspec-discover-2.4.4
- hspec-expectations-0.8.2
- hspec-smallcheck-0.4.2
- http-api-data-0.3.7.1
- http-client-0.5.7.0
- http-client-tls-0.3.5.1
- http-conduit-2.2.3.2
- http-types-0.9.1
- ieee754-0.8.0
- integer-gmp-1.0.0.1
- integer-logarithms-1.0.2
- lifted-async-0.9.3
- lifted-base-0.2.3.11
- logict-0.6.0.2
- memory-0.14.6
- microlens-0.4.8.1
- microlens-mtl-0.1.11.0
- microlens-th-0.4.1.1
- mime-types-0.1.0.7
- mintty-0.1.1
- mmorph-1.0.9
- monad-control-1.0.2.2
- monad-logger-0.3.25
- monad-loops-0.4.3
- monad-unlift-0.2.0
- mono-traversable-1.0.2.1
- mtl-2.2.1
- nats-1.1.1
- network-2.6.3.2
- network-uri-2.6.1.0
- old-locale-1.0.0.7
- old-time-1.1.0.3
- open-browser-0.2.1.0
- optparse-applicative-0.13.2.0
- optparse-simple-0.0.3
- parsec-3.1.11
- path-0.5.13
- path-io-1.2.2
- path-pieces-0.2.1
- pem-0.2.2
- persistent-2.7.0
- persistent-sqlite-2.6.2
- persistent-template-2.5.2
- pid1-0.1.2.0
- prelude-extras-0.4.0.3
- pretty-1.1.3.3
- primitive-0.6.2.0
- process-1.4.3.0
- profunctors-5.2.1
- project-template-0.2.0
- quickcheck-io-0.2.0
- random-1.1
- regex-applicative-0.3.3
- regex-applicative-text-0.1.0.1
- resource-pool-0.2.3.2
- resourcet-1.1.9
- retry-0.7.4.2
- rts-1.0
- safe-0.3.15
- safe-exceptions-0.1.6.0
- scientific-0.3.5.1
- semigroupoids-5.2.1
- semigroups-0.18.3
- setenv-0.1.1.3
- silently-1.2.5
- smallcheck-1.1.2
- socks-0.5.5
- split-0.2.3.2
- stm-2.4.4.1
- stm-chans-3.0.0.4
- store-0.4.3.1
- store-core-0.4.1
- streaming-commons-0.1.17
- syb-0.7
- tagged-0.8.5
- tar-0.5.0.3
- template-haskell-2.11.1.0
- temporary-1.2.1.1
- text-1.2.2.2
- text-binary-0.2.1.1
- text-metrics-0.3.0
- tf-random-0.5
- th-expand-syns-0.4.3.0
- th-lift-0.7.7
- th-lift-instances-0.1.11
- th-orphans-0.13.4
- th-reify-many-0.1.8
- th-utilities-0.2.0.1
- time-1.6.0.1
- time-locale-compat-0.1.1.3
- tls-1.3.11
- transformers-0.5.2.0
- transformers-base-0.4.4
- transformers-compat-0.5.1.4
- unexceptionalio-0.3.0
- unicode-transforms-0.3.3
- unix-2.7.2.1
- unix-compat-0.4.3.1
- unix-time-0.3.7
- unordered-containers-0.2.8.0
- uri-bytestring-0.2.3.3
- uuid-types-1.0.3
- vector-0.12.0.1
- vector-algorithms-0.7.0.1
- vector-binary-instances-0.2.3.5
- void-0.7.2
- x509-1.7.2
- x509-store-1.6.5
- x509-system-1.6.6
- x509-validation-1.6.9
- yaml-0.8.23.3
- zip-archive-0.3.1.1
- zlib-0.6.1.2

2017-09-12 17:04:05.764334: [debug] Checking for project config at: /Users/ivan/Haskell/jbi/stack.yaml
@(Stack/Config.hs:974:9)
2017-09-12 17:04:05.765068: [debug] Loading project config file stack.yaml
@(Stack/Config.hs:999:13)
2017-09-12 17:04:05.766829: [debug] Trying to decode /Users/ivan/.stack/build-plan-cache/x86_64-osx/lts-9.4.cache
@(Data/Store/VersionTagged.hs:72:5)
2017-09-12 17:04:05.783273: [debug] Success decoding /Users/ivan/.stack/build-plan-cache/x86_64-osx/lts-9.4.cache
@(Data/Store/VersionTagged.hs:76:13)
2017-09-12 17:04:05.783441: [debug] PATH is: Just "/Users/ivan/.local/bin:/Users/ivan/bin:/Users/ivan/.cabal/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/ivan/bin:/usr/local/sbin:/Users/ivan/.local/bin:/Users/ivan/bin:/Users/ivan/.cabal/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/ivan/bin:/usr/local/sbin:/Users/ivan/.nix-profile/bin:/Users/ivan/.nix-profile/sbin:/Users/ivan/.nix-profile/lib/kde4/libexec:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/nix/var/nix/profiles/default/lib/kde4/libexec:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/nix/store/s10kkzffsab89a1y65iizzwj4h412kmh-cctools-binutils-darwin/bin:/nix/store/v9qaksn6ypgvb36anwcl7gc2gwy9bdl7-coreutils-8.27/bin:/nix/store/s10kkzffsab89a1y65iizzwj4h412kmh-cctools-binutils-darwin/bin:/nix/store/v9qaksn6ypgvb36anwcl7gc2gwy9bdl7-coreutils-8.27/bin"
@(Stack/Nix.hs:126:6)
2017-09-12 17:04:05.783537: [debug] Using a nix-shell environment with nix packages: haskell.compiler.ghc802, git
@(Stack/Nix.hs:127:6)
2017-09-12 17:04:05.783987: [debug] Run process: /Users/ivan/.nix-profile/bin/nix-shell -E "with (import <nixpkgs> {}); let inputs = [haskell.compiler.ghc802 git]; libPath = lib.makeLibraryPath inputs; stackExtraArgs = lib.concatMap (pkg: [ ''--extra-lib-dirs=${lib.getLib pkg}/lib''   ''--extra-include-dirs=${lib.getDev pkg}/include'' ]) inputs; in runCommand ''myEnv'' { buildInputs = lib.optional stdenv.isLinux glibcLocales ++ inputs; STACK_PLATFORM_VARIANT=''nix''; STACK_IN_NIXSHELL=1; LD_LIBRARY_PATH = libPath;STACK_IN_NIX_EXTRA_ARGS = stackExtraArgs; } \"\"" --run "'/nix/store/ndwblsr6dwb108k1b035lc6c4zac708h-stack-1.5.1/bin/stack' $STACK_IN_NIX_EXTRA_ARGS '--internal-re-exec-version=1.5.1' 'build' 'jbi:lib' '--verbose'"
@(Stack/Exec.hs:65:5)
Version 1.5.1 x86_64
Compiled with:
- Cabal-1.24.2.0
- Glob-0.8.0
- HUnit-1.5.0.0
- MonadRandom-0.5.1
- QuickCheck-2.9.2
- SHA-1.6.4.2
- StateVar-1.1.0.4
- aeson-1.1.2.0
- aeson-compat-0.3.6
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.6.3.1
- ansi-wl-pprint-0.6.7.3
- array-0.5.1.1
- asn1-encoding-0.9.5
- asn1-parse-0.9.4
- asn1-types-0.3.2
- async-2.1.1.1
- attoparsec-0.13.1.0
- attoparsec-iso8601-1.0.0.0
- auto-update-0.1.4
- base-4.9.1.0
- base-compat-0.9.3
- base-orphans-0.6
- base16-bytestring-0.1.1.6
- base64-bytestring-1.0.0.1
- bifunctors-5.4.2
- binary-0.8.3.0
- binary-tagged-0.1.4.2
- bitarray-0.0.1.1
- blaze-builder-0.4.0.2
- blaze-html-0.9.0.1
- blaze-markup-0.8.0.0
- byteable-0.1.1
- bytestring-0.10.8.1
- call-stack-0.1.0
- case-insensitive-1.2.0.10
- cereal-0.5.4.0
- clock-0.7.2
- comonad-5.0.2
- conduit-1.2.11
- conduit-extra-1.1.16
- connection-0.2.8
- constraints-0.9.1
- containers-0.5.7.1
- contravariant-1.4
- cookie-0.4.2.1
- cryptohash-0.11.9
- cryptohash-sha256-0.11.100.1
- cryptonite-0.23
- cryptonite-conduit-0.2.0
- data-default-class-0.1.2.0
- deepseq-1.4.2.0
- digest-0.0.1.2
- directory-1.3.0.0
- distributive-0.5.3
- dlist-0.8.0.3
- easy-file-0.2.1
- echo-0.1.3
- ed25519-0.0.5.0
- either-4.4.1.1
- errors-2.2.1
- exceptions-0.8.3
- extra-1.5.3
- fail-4.9.0.0
- fast-logger-2.4.10
- file-embed-0.0.10
- filelock-0.1.1.2
- filepath-1.4.1.1
- foundation-0.0.13
- free-4.12.4
- fsnotify-0.2.1.1
- generic-deriving-1.11.2
- generics-sop-0.3.1.0
- ghc-boot-th-8.0.2
- ghc-prim-0.5.0.0
- gitrev-1.3.1
- hackage-security-0.5.2.2
- hashable-1.2.6.1
- hastache-0.6.1
- hfsevents-0.1.6
- hourglass-0.2.10
- hpack-0.18.1
- hpc-0.6.0.3
- hspec-2.4.4
- hspec-core-2.4.4
- hspec-discover-2.4.4
- hspec-expectations-0.8.2
- hspec-smallcheck-0.4.2
- http-api-data-0.3.7.1
- http-client-0.5.7.0
- http-client-tls-0.3.5.1
- http-conduit-2.2.3.2
- http-types-0.9.1
- ieee754-0.8.0
- integer-gmp-1.0.0.1
- integer-logarithms-1.0.2
- lifted-async-0.9.3
- lifted-base-0.2.3.11
- logict-0.6.0.2
- memory-0.14.6
- microlens-0.4.8.1
- microlens-mtl-0.1.11.0
- microlens-th-0.4.1.1
- mime-types-0.1.0.7
- mintty-0.1.1
- mmorph-1.0.9
- monad-control-1.0.2.2
- monad-logger-0.3.25
- monad-loops-0.4.3
- monad-unlift-0.2.0
- mono-traversable-1.0.2.1
- mtl-2.2.1
- nats-1.1.1
- network-2.6.3.2
- network-uri-2.6.1.0
- old-locale-1.0.0.7
- old-time-1.1.0.3
- open-browser-0.2.1.0
- optparse-applicative-0.13.2.0
- optparse-simple-0.0.3
- parsec-3.1.11
- path-0.5.13
- path-io-1.2.2
- path-pieces-0.2.1
- pem-0.2.2
- persistent-2.7.0
- persistent-sqlite-2.6.2
- persistent-template-2.5.2
- pid1-0.1.2.0
- prelude-extras-0.4.0.3
- pretty-1.1.3.3
- primitive-0.6.2.0
- process-1.4.3.0
- profunctors-5.2.1
- project-template-0.2.0
- quickcheck-io-0.2.0
- random-1.1
- regex-applicative-0.3.3
- regex-applicative-text-0.1.0.1
- resource-pool-0.2.3.2
- resourcet-1.1.9
- retry-0.7.4.2
- rts-1.0
- safe-0.3.15
- safe-exceptions-0.1.6.0
- scientific-0.3.5.1
- semigroupoids-5.2.1
- semigroups-0.18.3
- setenv-0.1.1.3
- silently-1.2.5
- smallcheck-1.1.2
- socks-0.5.5
- split-0.2.3.2
- stm-2.4.4.1
- stm-chans-3.0.0.4
- store-0.4.3.1
- store-core-0.4.1
- streaming-commons-0.1.17
- syb-0.7
- tagged-0.8.5
- tar-0.5.0.3
- template-haskell-2.11.1.0
- temporary-1.2.1.1
- text-1.2.2.2
- text-binary-0.2.1.1
- text-metrics-0.3.0
- tf-random-0.5
- th-expand-syns-0.4.3.0
- th-lift-0.7.7
- th-lift-instances-0.1.11
- th-orphans-0.13.4
- th-reify-many-0.1.8
- th-utilities-0.2.0.1
- time-1.6.0.1
- time-locale-compat-0.1.1.3
- tls-1.3.11
- transformers-0.5.2.0
- transformers-base-0.4.4
- transformers-compat-0.5.1.4
- unexceptionalio-0.3.0
- unicode-transforms-0.3.3
- unix-2.7.2.1
- unix-compat-0.4.3.1
- unix-time-0.3.7
- unordered-containers-0.2.8.0
- uri-bytestring-0.2.3.3
- uuid-types-1.0.3
- vector-0.12.0.1
- vector-algorithms-0.7.0.1
- vector-binary-instances-0.2.3.5
- void-0.7.2
- x509-1.7.2
- x509-store-1.6.5
- x509-system-1.6.6
- x509-validation-1.6.9
- yaml-0.8.23.3
- zip-archive-0.3.1.1
- zlib-0.6.1.2

2017-09-12 17:04:06.758140: [debug] Checking for project config at: /Users/ivan/Haskell/jbi/stack.yaml
@(Stack/Config.hs:974:9)
2017-09-12 17:04:06.759039: [debug] Loading project config file stack.yaml
@(Stack/Config.hs:999:13)
2017-09-12 17:04:06.761398: [debug] Trying to decode /Users/ivan/.stack/build-plan-cache/x86_64-osx-nix/lts-9.4.cache
@(Data/Store/VersionTagged.hs:72:5)
2017-09-12 17:04:06.776033: [debug] Success decoding /Users/ivan/.stack/build-plan-cache/x86_64-osx-nix/lts-9.4.cache
@(Data/Store/VersionTagged.hs:76:13)
2017-09-12 17:04:06.776588: [debug] Getting system compiler version
@(Stack/Setup.hs:379:17)
2017-09-12 17:04:06.776917: [debug] Run process: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc --info
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.835879: [debug] Process finished in �[92m58ms�[0m: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc --info
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.837059: [debug] Asking GHC for its version
@(Stack/Setup/Installed.hs:103:13)
2017-09-12 17:04:06.837305: [debug] Run process: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc --numeric-version
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.838595: [debug] Getting global package database location
@(Stack/GhcPkg.hs:55:5)
2017-09-12 17:04:06.838854: [debug] Run process: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.840031: [debug] Getting Cabal package version
@(Stack/GhcPkg.hs:189:5)
2017-09-12 17:04:06.840109: [debug] Run process: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.868746: [debug] Process finished in �[92m29ms�[0m: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.869352: [debug] Process finished in �[92m29ms�[0m: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.888079: [debug] Process finished in �[92m50ms�[0m: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc --numeric-version
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.888241: [debug] Resolving package entries
@(Stack/Setup.hs:260:5)
2017-09-12 17:04:06.889108: [debug] Starting to execute command inside EnvConfig
@(Stack/Runners.hs:175:18)
2017-09-12 17:04:06.889178: [debug] Parsing the cabal files of the local packages
@(Stack/Build/Source.hs:328:5)
2017-09-12 17:04:06.890849: [debug] Parsing the targets
@(Stack/Build/Source.hs:265:5)
2017-09-12 17:04:06.891194: [debug] Start: getPackageFiles /Users/ivan/Haskell/jbi/jbi.cabal
@(Stack/Package.hs:259:21)
2017-09-12 17:04:06.907128: [debug] Finished in 14ms: getPackageFiles /Users/ivan/Haskell/jbi/jbi.cabal
@(Stack/Package.hs:259:21)
2017-09-12 17:04:06.908754: [debug] Finding out which packages are already installed
@(Stack/Build/Installed.hs:69:5)
2017-09-12 17:04:06.908980: [debug] Run process: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.943526: [debug] Process finished in �[92m34ms�[0m: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:06.956102: [debug] Ignoring package haskeline due to wanting version 0.7.4.0 instead of 0.7.3.0
@(Stack/Build/Installed.hs:199:5)
2017-09-12 17:04:06.956202: [debug] Ignoring package terminfo due to wanting version 0.4.1.0 instead of 0.4.0.2
@(Stack/Build/Installed.hs:199:5)
2017-09-12 17:04:06.956251: [debug] Ignoring package xhtml due to wanting version 3000.2.2 instead of 3000.2.1
@(Stack/Build/Installed.hs:199:5)
2017-09-12 17:04:06.956428: [debug] Run process: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --user --no-user-package-db --package-db /Users/ivan/.stack/snapshots/x86_64-osx-nix/lts-9.4/8.0.2/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:07.003309: [debug] Process finished in �[92m46ms�[0m: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --user --no-user-package-db --package-db /Users/ivan/.stack/snapshots/x86_64-osx-nix/lts-9.4/8.0.2/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:07.003614: [debug] Run process: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --user --no-user-package-db --package-db /Users/ivan/Haskell/jbi/.stack-work/install/x86_64-osx-nix/lts-9.4/8.0.2/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:07.031681: [debug] Process finished in �[92m27ms�[0m: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --user --no-user-package-db --package-db /Users/ivan/Haskell/jbi/.stack-work/install/x86_64-osx-nix/lts-9.4/8.0.2/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:07.032127: [debug] Constructing the build plan
@(Stack/Build/ConstructPlan.hs:188:5)
2017-09-12 17:04:07.032922: [debug] Checking if we are going to build multiple executables with the same name
@(Stack/Build.hs:210:5)
2017-09-12 17:04:07.033007: [debug] Executing the build plan
@(Stack/Build/Execute.hs:478:5)
2017-09-12 17:04:07.033987: [debug] Getting global package database location
@(Stack/GhcPkg.hs:55:5)
2017-09-12 17:04:07.034043: [debug] Run process: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:07.061854: [debug] Process finished in �[92m27ms�[0m: /nix/store/fadpshj8xwhp10zg782gd601ix6b38f7-ghc-8.0.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:07.063157: [debug] Encoding /Users/ivan/Haskell/jbi/.stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0/stack-build-cache
@(Data/Store/VersionTagged.hs:54:5)
2017-09-12 17:04:07.063542: [debug] Finished writing /Users/ivan/Haskell/jbi/.stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0/stack-build-cache
@(Data/Store/VersionTagged.hs:59:5)
2017-09-12 17:04:07.063617: [info] jbi-0.2.0.0: build (lib + exe)
@(Stack/Build/Execute.hs:830:23)
2017-09-12 17:04:07.063891: [debug] Run process: /Users/ivan/.stack/setup-exe-cache/x86_64-osx-nix/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0 build lib:jbi exe:jbi --ghc-options " -ddump-hi -ddump-to-file"
@(System/Process/Read.hs:306:3)
2017-09-12 17:04:07.118962: [info] Preprocessing library jbi-0.2.0.0...
@(Stack/Build/Execute.hs:1096:67)
2017-09-12 17:04:08.328737: [info] Preprocessing executable 'jbi' for jbi-0.2.0.0...
@(Stack/Build/Execute.hs:1096:67)
2017-09-12 17:04:08.516116: [info] [2 of 2] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0/build/jbi/jbi-tmp/Main.o )
@(Stack/Build/Execute.hs:1096:67)
2017-09-12 17:04:08.917064: [warn] 
@(Stack/Build/Execute.hs:1096:67)
2017-09-12 17:04:08.917290: [warn] /Users/ivan/Haskell/jbi/src/Main.hs:171:1: error:
@(Stack/Build/Execute.hs:1096:67)
2017-09-12 17:04:08.917351: [warn]     Parse error: naked expression at top level
@(Stack/Build/Execute.hs:1096:67)
2017-09-12 17:04:08.917391: [warn]     Perhaps you intended to use TemplateHaskell
@(Stack/Build/Execute.hs:1096:67)
2017-09-12 17:04:08.952475: [debug] Start: getPackageFiles /Users/ivan/Haskell/jbi/jbi.cabal
@(Stack/Package.hs:259:21)
2017-09-12 17:04:08.960629: [debug] Finished in 8ms: getPackageFiles /Users/ivan/Haskell/jbi/jbi.cabal
@(Stack/Package.hs:259:21)
2017-09-12 17:04:08.960927: [debug] Encoding /Users/ivan/Haskell/jbi/.stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0/stack-build-cache
@(Data/Store/VersionTagged.hs:54:5)
2017-09-12 17:04:08.961214: [debug] Finished writing /Users/ivan/Haskell/jbi/.stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0/stack-build-cache
@(Data/Store/VersionTagged.hs:59:5)

--  While building package jbi-0.2.0.0 using:
      /Users/ivan/.stack/setup-exe-cache/x86_64-osx-nix/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0 build lib:jbi exe:jbi --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

Note the following line from the logs above:

/Users/ivan/.stack/setup-exe-cache/x86_64-osx-nix/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx-nix/Cabal-1.24.2.0 build lib:jbi exe:jbi --ghc-options " -ddump-hi -ddump-to-file"

Run as-is this fails; remove the "exe:jbi" (that shouldn't be there) and it succeeds.

Stack version

$ stack --numeric-version
1.5.1

Method of installation

  • nix-env on macOS
@mgsloan
Copy link
Contributor

mgsloan commented Sep 13, 2017

Hmm, it should only build the executable the first time. Once it's built, it should be possible to build just the library component. See #3229

Are you getting different behavior? Once stack switches to doing per-component builds (Cabal 2.0 feature), it will hopefully no longer even require the initial build of the executable.

@ivan-m
Copy link
Contributor Author

ivan-m commented Sep 13, 2017

So I tried this:

  1. Remove the "blah" line from src/Main.hs
  2. stack build jbi:lib; build succeeds for both libray and executable.
  3. Run stack build jbi:lib again; no output.
  4. echo "blah" >> src/Main.hs
  5. stack build jbi:lib fails again.

@mgsloan
Copy link
Contributor

mgsloan commented Sep 18, 2017

@ivan-m Ahah! The issue is that the fix in #3229 came after the release of 1.5.0, and 1.5.1 was just a small patch atop 1.5.0. So, you need to use the master version of stack to get the fix for this.

I realize the fix is not really ideal, but it seems like an ok enough workaround until the proper per-component builds stuff is used.

@mgsloan mgsloan closed this as completed Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants