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

stack builds happy again and again #3151

Closed
nh2 opened this issue May 1, 2017 · 11 comments
Closed

stack builds happy again and again #3151

nh2 opened this issue May 1, 2017 · 11 comments

Comments

@nh2
Copy link
Collaborator

nh2 commented May 1, 2017

We found a situation where stack seems to build the same thing over and over again.

To reproduce, use this branch: https://github.com/input-output-hk/cardano-sl/tree/vanya (commit 9f57d759) and build with

stack --nix build '--ghc-options=-Wwarn +RTS -A2G -n4m -RTS' --test --no-haddock-deps --bench --jobs=4 --flag cardano-sl-core:-dev-mode --no-run-tests --no-run-benchmarks cardano-sl:cardano-node --fast

The build should fail at the end with a linker error (expected), and building again will build happy again:

➤ time stack --nix build '--ghc-options=-Wwarn +RTS -A2G -n4m -RTS' --test --no-haddock-deps --bench --jobs=4 --flag cardano-sl-core:-dev-mode --no-run-tests --no-run-benchmarks cardano-sl:cardano-node --fast
cardano-sl-core-0.4.3: unregistering (missing dependencies: derive, node-sketch, serokell-util)
cardano-sl-db-0.4.3: unregistering (missing dependencies: cardano-sl-core, node-sketch, serokell-util)
cardano-sl-infra-0.4.3: unregistering (missing dependencies: cardano-sl-core, cardano-sl-db, node-sketch, serokell-util)
cardano-sl-lrc-0.4.3: unregistering (missing dependencies: cardano-sl-core, cardano-sl-db)
cardano-sl-update-0.4.3: unregistering (missing dependencies: cardano-sl-core, cardano-sl-db, cardano-sl-infra, cardano-sl-lrc, node-sketch, serokell-util)
data-msgpack-0.0.9: unregistering (missing dependencies: groom)
derive-2.6.2: unregistering (missing dependencies: haskell-src-exts)
groom-0.1.2.1: unregistering (missing dependencies: haskell-src-exts)
haskell-src-exts-1.18.2: unregistering (missing dependencies: happy)
node-sketch-0.1.1.0: unregistering (missing dependencies: serokell-util)
serokell-util-0.1.5.0: unregistering (missing dependencies: data-msgpack)
happy-1.19.5: configure
happy-1.19.5: build
happy-1.19.5: copy/register
haskell-src-exts-1.18.2: configure
haskell-src-exts-1.18.2: build
haskell-src-exts-1.18.2: copy/register
groom-0.1.2.1: configure
groom-0.1.2.1: build
derive-2.6.2: configure
Progress: 2/13
Linking .stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/build/cardano-analyzer/cardano-analyzer ...
Preprocessing executable 'cardano-checks' for cardano-sl-0.4.3...
Preprocessing executable 'cardano-dht-keygen' for cardano-sl-0.4.3...
Linking .stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/build/cardano-dht-keygen/cardano-dht-keygen ...
Preprocessing executable 'cardano-genupdate' for cardano-sl-0.4.3...
Preprocessing executable 'cardano-keygen' for cardano-sl-0.4.3...
Linking .stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/build/cardano-keygen/cardano-keygen ...
Preprocessing executable 'cardano-launcher' for cardano-sl-0.4.3...
Linking .stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/build/cardano-launcher/cardano-launcher ...
/nix/store/5pwz6vmsmg4phpfahs904fmn6ki2vp91-binutils-2.27/bin/ld.gold: --hash-size=31: unknown option
/nix/store/5pwz6vmsmg4phpfahs904fmn6ki2vp91-binutils-2.27/bin/ld.gold: use the --help option for usage information
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
Completed 13 action(s).

--  While building package cardano-sl-0.4.3 using:
      /raid/stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0 build lib:cardano-sl exe:cardano-analyzer exe:cardano-checks exe:cardano-dht-keygen exe:cardano-genupdate exe:cardano-keygen exe:cardano-launcher exe:cardano-node exe:cardano-smart-generator exe:cardano-swagger exe:cardano-wallet exe:cardano-wallet-hs2purs exe:cardano-wallet-web-docs exe:cardano-web-docs --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
➤ time stack --nix build '--ghc-options=-Wwarn +RTS -A2G -n4m -RTS' --test --no-haddock-deps --bench --jobs=4 --flag cardano-sl-core:-dev-mode --no-run-tests --no-run-benchmarks cardano-sl:cardano-node --fast
cardano-sl-core-0.4.3: unregistering (missing dependencies: derive, node-sketch, serokell-util)
cardano-sl-db-0.4.3: unregistering (missing dependencies: cardano-sl-core, node-sketch, serokell-util)
cardano-sl-infra-0.4.3: unregistering (missing dependencies: cardano-sl-core, cardano-sl-db, node-sketch, serokell-util)
cardano-sl-lrc-0.4.3: unregistering (missing dependencies: cardano-sl-core, cardano-sl-db)
cardano-sl-update-0.4.3: unregistering (missing dependencies: cardano-sl-core, cardano-sl-db, cardano-sl-infra, cardano-sl-lrc, node-sketch, serokell-util)
data-msgpack-0.0.9: unregistering (missing dependencies: groom)
derive-2.6.2: unregistering (missing dependencies: haskell-src-exts)
groom-0.1.2.1: unregistering (missing dependencies: haskell-src-exts)
haskell-src-exts-1.18.2: unregistering (missing dependencies: happy)
node-sketch-0.1.1.0: unregistering (missing dependencies: serokell-util)
serokell-util-0.1.5.0: unregistering (missing dependencies: data-msgpack)
happy-1.19.5: configure
happy-1.19.5: build
happy-1.19.5: copy/register
haskell-src-exts-1.18.2: configure

In particular, it says missing dependencies: happy even though it seems to have installed it just fine before.

I think the reason is that after happy-1.19.5: copy/register, I get this:

➤ stack --nix exec -- ghc-pkg list happy
/nix/store/shv5yba4ns4ax38gvrd36rfynm9yms4i-ghc-8.0.2/lib/ghc-8.0.2/package.conf.d
    (no packages)
/raid/stack/snapshots/x86_64-linux-nix/lts-8.12/8.0.2/pkgdb
    (no packages)
/.../cardano-sl-gold/.stack-work/install/x86_64-linux-nix/lts-8.12/8.0.2/pkgdb
    (no packages)

I even checked this with a Ctrl-Z directly after happy-1.19.5: copy/register, and still had it not appear in the ghc-pkg.

Somebody else reports:

The issue does not reproduce with an older version of Stack, specifically, with Stack 1.3.2.

@nh2
Copy link
Collaborator Author

nh2 commented May 1, 2017

This appears with at least the following 3 stack versions:

Version 1.4.1, Git revision 45e2ba52a08b235ef1a6421e73bbbe7255014796 (4759 commits) x86_64 hpack-0.17.0

ξ> stack --version
Version 1.4.0 x86_64
Compiled with:
- Cabal-1.24.2.0
- Glob-0.7.14
- 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.0.2.1
- aeson-compat-0.3.6
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.6.2.3
- 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.5.4
- 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.8.1.3
- blaze-markup-0.7.1.1
- byteable-0.1.1
- bytestring-0.10.8.1
- call-stack-0.1.0
- case-insensitive-1.2.0.9
- cereal-0.5.4.0
- clock-0.7.2
- comonad-5.0.1
- conduit-1.2.10
- conduit-extra-1.1.15
- 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.21
- 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.2
- dlist-0.8.0.2
- easy-file-0.2.1
- ed25519-0.0.5.0
- either-4.4.1.1
- errors-2.1.3
- exceptions-0.8.3
- extra-1.5.2
- fail-4.9.0.0
- fast-logger-2.4.10
- file-embed-0.0.10
- filelock-0.1.0.1
- filepath-1.4.1.1
- foundation-0.0.7
- free-4.12.4
- fsnotify-0.2.1
- generic-deriving-1.11.2
- generics-sop-0.2.5.0
- ghc-boot-th-8.0.2
- ghc-prim-0.5.0.0
- gitrev-1.2.0
- hackage-security-0.5.2.2
- hashable-1.2.6.0
- hastache-0.6.1
- hinotify-0.3.9
- hit-0.6.3
- hourglass-0.2.10
- hpack-0.17.0
- hpc-0.6.0.3
- hspec-2.4.3
- hspec-core-2.4.3
- hspec-discover-2.4.3
- hspec-expectations-0.8.2
- hspec-smallcheck-0.4.2
- http-api-data-0.3.7
- http-client-0.5.6.1
- http-client-tls-0.3.4.1
- http-conduit-2.2.3.1
- http-types-0.9.1
- ieee754-0.8.0
- integer-gmp-1.0.0.1
- integer-logarithms-1.0.1
- lifted-async-0.9.1.1
- lifted-base-0.2.3.10
- logict-0.6.0.2
- memory-0.14.3
- microlens-0.4.8.0
- microlens-mtl-0.1.10.0
- microlens-th-0.4.1.1
- mime-types-0.1.0.7
- mmorph-1.0.9
- monad-control-1.0.1.0
- monad-logger-0.3.22
- monad-loops-0.4.3
- monad-unlift-0.2.0
- mono-traversable-1.0.2
- mtl-2.2.1
- nats-1.1.1
- network-2.6.3.1
- 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
- patience-0.1.1
- pem-0.2.2
- persistent-2.6.1
- persistent-sqlite-2.6.2
- persistent-template-2.5.2
- pid1-0.1.0.1
- prelude-extras-0.4.0.3
- pretty-1.1.3.3
- primitive-0.6.1.0
- process-1.4.3.0
- profunctors-5.2
- project-template-0.2.0
- quickcheck-io-0.1.4
- 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.14
- safe-exceptions-0.1.5.0
- scientific-0.3.4.12
- semigroupoids-5.1
- semigroups-0.18.2
- setenv-0.1.1.3
- silently-1.2.5
- smallcheck-1.1.1
- socks-0.5.5
- split-0.2.3.1
- stm-2.4.4.1
- stm-chans-3.0.0.4
- store-0.3.1
- store-core-0.3
- streaming-commons-0.1.17
- syb-0.6
- system-fileio-0.3.16.3
- system-filepath-0.4.13.4
- tagged-0.8.5
- tar-0.5.0.3
- template-haskell-2.11.1.0
- temporary-1.2.0.4
- text-1.2.2.1
- text-binary-0.2.1.1
- text-metrics-0.2.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.3
- th-reify-many-0.1.6
- th-utilities-0.2.0.1
- time-1.6.0.1
- time-locale-compat-0.1.1.3
- tls-1.3.10
- transformers-0.5.2.0
- transformers-base-0.4.4
- transformers-compat-0.5.1.4
- unexceptionalio-0.3.0
- unicode-transforms-0.2.1
- 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.1
- utf8-string-1.0.1.1
- uuid-types-1.0.3
- vector-0.11.0.0
- vector-algorithms-0.7.0.1
- vector-binary-instances-0.2.3.5
- void-0.7.2
- x509-1.6.5
- x509-store-1.6.2
- x509-system-1.6.4
- x509-validation-1.6.5
- yaml-0.8.22
- zip-archive-0.3.0.5
- zlib-0.6.1.2
- zlib-bindings-0.1.1.5
$ stack --version
Version 1.4.0 x86_64
Compiled with:
- Cabal-1.24.0.0
- Glob-0.7.14
- HUnit-1.6.0.0
- MonadRandom-0.5.1
- QuickCheck-2.9.2
- SHA-1.6.4.2
- StateVar-1.1.0.4
- aeson-1.0.2.1
- aeson-compat-0.3.6
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.6.2.3
- 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
- auto-update-0.1.4
- base-4.9.0.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.8.1.3
- blaze-markup-0.7.1.1
- byteable-0.1.1
- bytestring-0.10.8.1
- call-stack-0.1.0
- case-insensitive-1.2.0.9
- cereal-0.5.4.0
- clock-0.7.2
- comonad-5.0.1
- conduit-1.2.10
- conduit-extra-1.1.15
- 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.22
- cryptonite-conduit-0.2.0
- data-default-class-0.1.2.0
- deepseq-1.4.2.0
- digest-0.0.1.2
- directory-1.2.6.2
- distributive-0.5.2
- dlist-0.8.0.2
- easy-file-0.2.1
- ed25519-0.0.5.0
- either-4.4.1.1
- errors-2.1.3
- exceptions-0.8.3
- extra-1.5.2
- fast-logger-2.4.10
- file-embed-0.0.10
- filelock-0.1.0.1
- filepath-1.4.1.0
- foundation-0.0.7
- free-4.12.4
- fsnotify-0.2.1
- generic-deriving-1.11.2
- generics-sop-0.2.5.0
- ghc-boot-th-8.0.1
- ghc-prim-0.5.0.0
- gitrev-1.2.0
- hackage-security-0.5.2.2
- hashable-1.2.6.0
- hastache-0.6.1
- hinotify-0.3.9
- hit-0.6.3
- hourglass-0.2.10
- hpack-0.17.0
- hpc-0.6.0.3
- hspec-2.4.3
- hspec-core-2.4.3
- hspec-discover-2.4.3
- hspec-expectations-0.8.2
- hspec-smallcheck-0.4.2
- http-api-data-0.3.6
- http-client-0.5.6.1
- http-client-tls-0.3.4.1
- http-conduit-2.2.3.1
- http-types-0.9.1
- ieee754-0.8.0
- integer-gmp-1.0.0.1
- integer-logarithms-1.0.1
- lifted-async-0.9.1.1
- lifted-base-0.2.3.10
- logict-0.6.0.2
- memory-0.14.3
- microlens-0.4.8.0
- microlens-mtl-0.1.10.0
- microlens-th-0.4.1.1
- mime-types-0.1.0.7
- mmorph-1.0.9
- monad-control-1.0.1.0
- monad-logger-0.3.22
- monad-loops-0.4.3
- monad-unlift-0.2.0
- mono-traversable-1.0.2
- mtl-2.2.1
- network-2.6.3.1
- 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
- patience-0.1.1
- pem-0.2.2
- persistent-2.6.1
- persistent-sqlite-2.6.2
- persistent-template-2.5.2
- pid1-0.1.0.1
- prelude-extras-0.4.0.3
- pretty-1.1.3.3
- primitive-0.6.2.0
- process-1.4.2.0
- profunctors-5.2
- project-template-0.2.0
- quickcheck-io-0.1.4
- 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.14
- safe-exceptions-0.1.5.0
- scientific-0.3.4.12
- semigroupoids-5.1
- semigroups-0.18.3
- setenv-0.1.1.3
- silently-1.2.5
- smallcheck-1.1.1
- socks-0.5.5
- split-0.2.3.1
- stm-2.4.4.1
- stm-chans-3.0.0.4
- store-0.4.2
- store-core-0.4
- streaming-commons-0.1.17
- syb-0.6
- system-fileio-0.3.16.3
- system-filepath-0.4.13.4
- tagged-0.8.5
- tar-0.5.0.3
- template-haskell-2.11.0.0
- temporary-1.2.0.4
- text-1.2.2.1
- text-binary-0.2.1.1
- text-metrics-0.2.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.3
- th-reify-many-0.1.6
- th-utilities-0.2.0.1
- time-1.6.0.1
- time-locale-compat-0.1.1.3
- tls-1.3.10
- transformers-0.5.2.0
- transformers-base-0.4.4
- transformers-compat-0.5.1.4
- unexceptionalio-0.3.0
- unicode-transforms-0.2.1
- unix-2.7.2.0
- unix-compat-0.4.3.1
- unix-time-0.3.7
- unordered-containers-0.2.8.0
- uri-bytestring-0.2.3.1
- utf8-string-1.0.1.1
- 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.6.5
- x509-store-1.6.2
- x509-system-1.6.4
- x509-validation-1.6.5
- yaml-0.8.22
- zip-archive-0.3.0.5
- zlib-0.6.1.2
- zlib-bindings-0.1.1.5

The version 1.3.2 reported to work is:

$ stack --version
Version 1.3.2 x86_64
Compiled with:
- Cabal-1.24.0.0
- Glob-0.7.14
- 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.0.2.1
- aeson-compat-0.3.6
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.6.2.3
- 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
- attoparsec-0.13.1.0
- auto-update-0.1.4
- base-4.9.0.0
- base-compat-0.9.2
- base-orphans-0.5.4
- base16-bytestring-0.1.1.6
- base64-bytestring-1.0.0.1
- bifunctors-5.4.1
- 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.8.1.3
- blaze-markup-0.7.1.1
- byteable-0.1.1
- bytestring-0.10.8.1
- call-stack-0.1.0
- case-insensitive-1.2.0.8
- cereal-0.5.4.0
- clock-0.7.2
- comonad-5
- conduit-1.2.9
- conduit-extra-1.1.15
- connection-0.2.7
- constraints-0.9.1
- containers-0.5.7.1
- contravariant-1.4
- cookie-0.4.2.1
- cryptohash-0.11.9
- cryptohash-conduit-0.1.1
- cryptonite-0.22
- data-default-class-0.1.2.0
- deepseq-1.4.2.0
- digest-0.0.1.2
- directory-1.2.6.2
- distributive-0.5.2
- dlist-0.8.0.2
- easy-file-0.2.1
- either-4.4.1.1
- errors-2.1.3
- exceptions-0.8.3
- extra-1.5.1
- fast-logger-2.4.10
- file-embed-0.0.10
- filelock-0.1.0.1
- filepath-1.4.1.0
- free-4.12.4
- fsnotify-0.2.1
- generic-deriving-1.11.1
- generics-sop-0.2.4.0
- ghc-boot-th-8.0.1
- ghc-prim-0.5.0.0
- gitrev-1.2.0
- hashable-1.2.5.0
- hastache-0.6.1
- hinotify-0.3.9
- hit-0.6.3
- hourglass-0.2.10
- hpack-0.16.0
- hpc-0.6.0.3
- hspec-2.4.2
- hspec-core-2.4.2
- hspec-discover-2.4.2
- hspec-expectations-0.8.2
- hspec-smallcheck-0.4.2
- http-api-data-0.3.5
- http-client-0.5.6.1
- http-client-tls-0.3.4
- http-conduit-2.2.3.1
- http-types-0.9.1
- ieee754-0.7.9
- integer-gmp-1.0.0.1
- integer-logarithms-1.0.1
- lifted-async-0.9.1.1
- lifted-base-0.2.3.10
- logict-0.6.0.2
- memory-0.14.2
- microlens-0.4.8.0
- microlens-th-0.4.1.1
- mime-types-0.1.0.7
- mmorph-1.0.9
- monad-control-1.0.1.0
- monad-logger-0.3.21
- monad-loops-0.4.3
- monad-unlift-0.2.0
- mono-traversable-1.0.2
- mtl-2.2.1
- network-2.6.3.1
- 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.12
- path-io-1.2.2
- path-pieces-0.2.1
- patience-0.1.1
- pem-0.2.2
- persistent-2.6.1
- persistent-sqlite-2.6.2
- persistent-template-2.5.2
- pid1-0.1.0.1
- prelude-extras-0.4.0.3
- pretty-1.1.3.3
- primitive-0.6.1.0
- process-1.4.2.0
- profunctors-5.2
- project-template-0.2.0
- quickcheck-io-0.1.4
- 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.14
- safe-exceptions-0.1.5.0
- scientific-0.3.4.10
- semigroupoids-5.1
- semigroups-0.18.2
- setenv-0.1.1.3
- silently-1.2.5
- smallcheck-1.1.1
- socks-0.5.5
- split-0.2.3.1
- stm-2.4.4.1
- stm-chans-3.0.0.4
- store-0.3.1
- store-core-0.3
- streaming-commons-0.1.17
- syb-0.6
- system-fileio-0.3.16.3
- system-filepath-0.4.13.4
- tagged-0.8.5
- tar-0.5.0.3
- template-haskell-2.11.0.0
- temporary-1.2.0.4
- text-1.2.2.1
- text-binary-0.2.1.1
- text-metrics-0.2.0
- tf-random-0.5
- th-expand-syns-0.4.2.0
- th-lift-0.7.6
- th-lift-instances-0.1.11
- th-orphans-0.13.3
- th-reify-many-0.1.6
- th-utilities-0.2.0.1
- time-1.6.0.1
- time-locale-compat-0.1.1.3
- tls-1.3.10
- transformers-0.5.2.0
- transformers-base-0.4.4
- transformers-compat-0.5.1.4
- unexceptionalio-0.3.0
- unicode-transforms-0.2.1
- unix-2.7.2.0
- unix-compat-0.4.3.1
- unix-time-0.3.7
- unordered-containers-0.2.7.2
- uri-bytestring-0.2.3.1
- utf8-string-1.0.1.1
- uuid-types-1.0.3
- vector-0.11.0.0
- vector-algorithms-0.7.0.1
- vector-binary-instances-0.2.3.4
- void-0.7.1
- x509-1.6.5
- x509-store-1.6.2
- x509-system-1.6.4
- x509-validation-1.6.5
- yaml-0.8.22
- zip-archive-0.3.0.5
- zlib-0.6.1.2
- zlib-bindings-0.1.1.5

@silky
Copy link
Contributor

silky commented May 1, 2017

fwiw, i believe this can be reproduced faster with:

stack --nix build happy --fast

however, something very strange is going on, for me at least, when playing around with this, and i can only guess it's related to nix somehow

i somehow managed to get happy to build (and not be found to be missing subsequently; i just set up a empty project and just built happy as above, but pointed it at the same shell.nix) and now can't repro this at all, even though i've cleaned (i believe?) my nix db with:

nix-collect-garbage -d --option gc-keep-outputs false --option gc-keep-derivations false

nevertheless, i still get the following:

>stack --nix exec -- ghc-pkg list happy
/nix/store/shv5yba4ns4ax38gvrd36rfynm9yms4i-ghc-8.0.2/lib/ghc-8.0.2/package.conf.d
    (no packages)
/home/noon/.stack/snapshots/x86_64-linux-nix/lts-8.12/8.0.2/pkgdb
    (no packages)
/home/noon/dev/ext/cardano-sl-2/.stack-work/install/x86_64-linux-nix/lts-8.12/8.0.2/pkgdb
    (no packages)

my stack version:

>stack --version
Version 1.4.1, Git revision aaecb6a4bb17d3a17585a3d48b1a95b2837f8b73 x86_64 hpack-0.17.0

(note: i'm quite naive at nix; i've not used it much)

@volhovm
Copy link

volhovm commented May 7, 2017

I confirm the fact that issue is present on 1.4.0, but doesn't reproduce on 1.3.2.

@akegalj
Copy link

akegalj commented May 16, 2017

stack seems to build the same thing over and over again.

Looks like its building happy multiple times during the same build - if that was meant. That triggers other dependencies to be rebuild as well

EDIT Seems like its working ok on 1.3.2 as @volhovm pointed out

@W4RH4WK
Copy link

W4RH4WK commented May 19, 2017

Could this be somehow related to #3178?

@nh2
Copy link
Collaborator Author

nh2 commented Jun 22, 2017

OK, the problem here is the same with entropy:

The upstream packages are wrong because they do not list their setup-depends correctly.

entropy has a fix for this in master, but that version has not been released to Hackage yet.

A workaround is to simply put entropy-0.3.7 and happy-1.19.5 into the `extra-deps.

Why does this work? Because even though there hasn't been a Hackage release with the fix, there has been a Hackage revision that changes the package without changing the version number http://hackage.haskell.org/package/entropy-0.3.7/revisions/, thus triggering different behaviour even though the version is apparently the same.

In my opinion this practice of non-maintainers silently fixing up other people's packages is highly confusing. and has cost us lots of hours to figure out what would have taken 5 minutes if there had been a proper version bump.

For happy it's even worse: It too has a Hackage revision, but there is no upstream fix for it! Because it's patched up on Hackage, the upstream maintainers won't even notice that their package is broken. So with the next Hackage upload, it will be broken again.

This problem exists for all built tools that use Hackage, be it cabal or stack or via nix.

To me the solution is clear: We should stop silently fixing packages on Hackage, and instead make proper fixed upstream releases and Hackage uploads.

domenkozar added a commit to input-output-hk/cardano-sl that referenced this issue Jun 22, 2017
@domenkozar
Copy link
Contributor

domenkozar commented Jun 23, 2017

extra-deps workaround alone won't work due to #595, so additionally there needs to be another stack install happy call

@nh2
Copy link
Collaborator Author

nh2 commented Jun 23, 2017

extra-deps workaround won't work due to #595 so really the only way is to call a separate stack install happy

@domenkozar The wording might be slightly confusing for other readers:

  • You do need the extra-deps workaround so that the revised (Hackage revision) happy-1.19.5 gets pulled in (if you don't have extra-deps, you're using the Stackage snapshot, which doesn't have the setup-depends despite having the same version number, because Hackage revisions are a mutable modification of the package keeping the same version number)
  • You need to stack install happy in addition

@snoyberg
Copy link
Contributor

snoyberg commented Jul 5, 2017

The comment about ghc-pkg list happy is a bit of a red herring. Since happy is an executable-only package, it will never appear in the package database. Stack maintains metadata on which executables have been installed separately from the package database.

@snoyberg
Copy link
Contributor

snoyberg commented Jul 5, 2017

I've tested this repro with the new extensible-snapshots branch (PR #3249), and I no longer see the behavior of happy repeatedly rebuilding. Confirmation from others would be appreciated.

@snoyberg
Copy link
Contributor

Closing now that #3249 is merged.

mgsloan pushed a commit that referenced this issue Aug 20, 2017
Motivated from this build failure on HEAD:

  * https://travis-ci.org/commercialhaskell/stack/jobs/266365181

Related to #3178.

This fix is based on a comments from:

  * #3178 (comment)
  * #3151 (comment)
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

7 participants