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 build --profile is broken? #4275

Closed
waddlaw opened this issue Aug 31, 2018 · 15 comments
Closed

stack build --profile is broken? #4275

waddlaw opened this issue Aug 31, 2018 · 15 comments

Comments

@waddlaw
Copy link
Contributor

waddlaw commented Aug 31, 2018

Steps to reproduce

$ git clone https://github.com/commercialhaskell/stack.git
$ cd stack

$ stack build --profile
...

tar-conduit-0.2.4: configure
tar-conduit-0.2.4: build
tar-conduit-0.2.4: copy/register
store-0.4.3.1: copy/register
pantry-0.1.0.0: configure (lib)
pantry-0.1.0.0: build (lib)
Log files have been written to: /home/bm12/Desktop/repo/upstream/stack/.stack-work/logs/
Progress 3/5

--  While building package pantry-0.1.0.0 using:
      /home/bm12/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build lib:pantry --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/bm12/Desktop/repo/upstream/stack/.stack-work/logs/pantry-0.1.0.0.log

    Configuring pantry-0.1.0.0...
    Preprocessing library for pantry-0.1.0.0..
    Building library for pantry-0.1.0.0..
    [ 5 of 14] Compiling Pantry.Storage
    ghc: ^^ Could not load 'pantryzm0zi1zi0zi0zm8s9oA1YK90kFEZZRvFo8aqE_PantryziTypes_zdfPersistFieldSqlFileSizze1_closure', dependency unresolved. See top entry above.


    ByteCodeLink.lookupCE
    During interactive linking, GHCi couldn't find the following symbol:
      pantryzm0zi1zi0zi0zm8s9oA1YK90kFEZZRvFo8aqE_PantryziTypes_zdfPersistFieldSqlFileSizze1_closure
    This may be due to you not asking GHCi to load extra object files,
    archives or DLLs needed by your current session.  Restart GHCi, specifying
    the missing library using the -L/path/to/object/dir and -lmissinglibname
    flags, or simply by naming the relevant files on the GHCi command line.
    Alternatively, this link failure might indicate a bug in GHCi.
    If you suspect the latter, please send a bug report to:
      glasgow-haskell-bugs@haskell.org

stack build is working fine.

Stack version

$ stack --version
Version 1.10.0, Git revision 60302c98b6cd29f222d1dba349978e3a1f9ffb67 (dirty) (6417 commits) x86_64 hpack-0.29.6
@snoyberg
Copy link
Contributor

snoyberg commented Sep 2, 2018

@waddlaw Please try running stack clean and retrying the build. If that doesn't work, try stack clean --full and try the build one more time.

@waddlaw
Copy link
Contributor Author

waddlaw commented Sep 3, 2018

@snoyberg Thanks for advice. But, problem isn't resolved yet...

stack build --profile -v after stack clean

$  stack clean
Using archive from https://github.com/fpco/store/archive/8ff486ea5a16665c7fd279963344ac8ef99b6e2a.tar.gz without a specified cryptographic hash
Cached hash is 18849d0766d9b4b4fd73ade6fe742b15b2e9d8c69ac00a3ca9e67b1e9044eaa9, file size 56404
For security and reproducibility, please add a hash and file size to your configuration
Using archive from https://github.com/snoyberg/tar-conduit/archive/fd03a66110f7d0feff6fe7eb1cc9ca1a56b38fea.tar.gz without a specified cryptographic hash
Cached hash is 70a45871b1f95a5d13d1195ac7ba1c20844eedd2ddfcadf709b5a12a10bf3c9f, file size 3193692
For security and reproducibility, please add a hash and file size to your configuration

$ stack build --profile -v
Version 1.10.0, Git revision 60302c98b6cd29f222d1dba349978e3a1f9ffb67 (dirty) (6417 commits) x86_64 hpack-0.29.6
2018-09-03 14:16:36.434342: [debug] Checking for project config at: /usr/local/share/stack/stack.yaml
2018-09-03 14:16:36.434658: [debug] Loading project config file stack.yaml
2018-09-03 14:16:36.613519: [debug] Run process: /sbin/ldconfig -p
2018-09-03 14:16:36.616774: [debug] Process finished in 3ms: /sbin/ldconfig -p
2018-09-03 14:16:36.617286: [debug] Found shared library libtinfo.so.5 in 'ldconfig -p' output
2018-09-03 14:16:36.617876: [debug] Did not find shared library libtinfo.so.6
2018-09-03 14:16:36.618006: [debug] Did not find shared library libncursesw.so.6
2018-09-03 14:16:36.618107: [debug] Found shared library libgmp.so.10 in 'ldconfig -p' output
2018-09-03 14:16:36.618224: [debug] Did not find shared library libgmp.so.3
2018-09-03 14:16:36.618281: [debug] Potential GHC builds: standard
2018-09-03 14:16:36.618345: [debug] Found already installed GHC builds: standard
2018-09-03 14:16:36.618957: [debug] Getting global package database location
2018-09-03 14:16:36.619144: [debug] Run process: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --no-user-package-db list --global
2018-09-03 14:16:36.619765: [debug] Asking GHC for its version
2018-09-03 14:16:36.620138: [debug] Getting Cabal package version
2018-09-03 14:16:36.620245: [debug] Run process: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc --numeric-version
2018-09-03 14:16:36.620722: [debug] Run process: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
2018-09-03 14:16:36.640934: [debug] Process finished in 22ms: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --no-user-package-db list --global
2018-09-03 14:16:36.646002: [debug] Process finished in 25ms: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
2018-09-03 14:16:36.662792: [debug] Process finished in 42ms: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc --numeric-version
2018-09-03 14:16:36.662951: [debug] GHC version is: ghc-8.2.2
2018-09-03 14:16:36.663489: [debug] Resolving package entries
2018-09-03 14:16:36.663692: [debug] Trying to decode /home/bm12/.stack/loaded-snapshot-cache/x86_64-linux/ghc-8.2.2/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc.cache
2018-09-03 14:16:36.883373: [debug] Success decoding /home/bm12/.stack/loaded-snapshot-cache/x86_64-linux/ghc-8.2.2/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc.cache
2018-09-03 14:16:36.884220: [debug] Starting to execute command inside EnvConfig
2018-09-03 14:16:36.884298: [debug] Parsing the targets
2018-09-03 14:16:36.884438: [debug] Running hpack on /usr/local/share/stack/package.yaml
2018-09-03 14:16:36.905322: [debug] hpack output unchanged in /usr/local/share/stack/stack.cabal
2018-09-03 14:16:36.935060: [debug] Running hpack on /usr/local/share/stack/subs/pantry/package.yaml
2018-09-03 14:16:36.939657: [debug] hpack output unchanged in /usr/local/share/stack/subs/pantry/pantry.cabal
2018-09-03 14:16:36.941857: [debug] Running hpack on /usr/local/share/stack/subs/curator/package.yaml
2018-09-03 14:16:36.943717: [debug] hpack output unchanged in /usr/local/share/stack/subs/curator/curator.cabal
2018-09-03 14:16:36.944571: [debug] Parsing cabal file for Archive from https://github.com/fpco/store/archive/8ff486ea5a16665c7fd279963344ac8ef99b6e2a.tar.gz in subdir store
2018-09-03 14:16:36.945080: [warn] Using archive from https://github.com/fpco/store/archive/8ff486ea5a16665c7fd279963344ac8ef99b6e2a.tar.gz without a specified cryptographic hash
2018-09-03 14:16:36.945151: [warn] Cached hash is 18849d0766d9b4b4fd73ade6fe742b15b2e9d8c69ac00a3ca9e67b1e9044eaa9, file size 56404
2018-09-03 14:16:36.945223: [warn] For security and reproducibility, please add a hash and file size to your configuration
2018-09-03 14:16:36.951798: [debug] Parsing cabal file for Archive from https://github.com/snoyberg/tar-conduit/archive/fd03a66110f7d0feff6fe7eb1cc9ca1a56b38fea.tar.gz
2018-09-03 14:16:36.952185: [warn] Using archive from https://github.com/snoyberg/tar-conduit/archive/fd03a66110f7d0feff6fe7eb1cc9ca1a56b38fea.tar.gz without a specified cryptographic hash
2018-09-03 14:16:36.952251: [warn] Cached hash is 70a45871b1f95a5d13d1195ac7ba1c20844eedd2ddfcadf709b5a12a10bf3c9f, file size 3193692
2018-09-03 14:16:36.952326: [warn] For security and reproducibility, please add a hash and file size to your configuration
2018-09-03 14:16:36.979762: [warn] Using archive from https://github.com/fpco/store/archive/8ff486ea5a16665c7fd279963344ac8ef99b6e2a.tar.gz without a specified cryptographic hash
2018-09-03 14:16:36.979901: [warn] Cached hash is 18849d0766d9b4b4fd73ade6fe742b15b2e9d8c69ac00a3ca9e67b1e9044eaa9, file size 56404
2018-09-03 14:16:36.979984: [warn] For security and reproducibility, please add a hash and file size to your configuration
2018-09-03 14:16:36.980988: [warn] Using archive from https://github.com/snoyberg/tar-conduit/archive/fd03a66110f7d0feff6fe7eb1cc9ca1a56b38fea.tar.gz without a specified cryptographic hash
2018-09-03 14:16:36.981059: [warn] Cached hash is 70a45871b1f95a5d13d1195ac7ba1c20844eedd2ddfcadf709b5a12a10bf3c9f, file size 3193692
2018-09-03 14:16:36.981127: [warn] For security and reproducibility, please add a hash and file size to your configuration
2018-09-03 14:16:36.983201: [debug] Finding out which packages are already installed
2018-09-03 14:16:36.983341: [debug] Trying to decode /usr/local/share/stack/.stack-work/installed-cache.bin
2018-09-03 14:16:36.983504: [debug] Success decoding /usr/local/share/stack/.stack-work/installed-cache.bin
2018-09-03 14:16:36.984346: [debug] Run process: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
2018-09-03 14:16:37.018000: [debug] Process finished in 34ms: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
2018-09-03 14:16:37.018292: [debug] Ignoring package haskeline due to wanting version 0.7.4.3 instead of 0.7.4.0
2018-09-03 14:16:37.018394: [debug] Ignoring package Cabal due to wanting version 2.2.0.1 instead of 2.0.1.0
2018-09-03 14:16:37.019022: [debug] Run process: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /home/bm12/.stack/snapshots/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/pkgdb dump --expand-pkgroot
2018-09-03 14:16:37.146920: [debug] Process finished in 128ms: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /home/bm12/.stack/snapshots/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/pkgdb dump --expand-pkgroot
2018-09-03 14:16:37.149175: [debug] Run process: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/pkgdb dump --expand-pkgroot
2018-09-03 14:16:37.172414: [debug] Process finished in 23ms: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/pkgdb dump --expand-pkgroot
2018-09-03 14:16:37.172655: [debug] Encoding /usr/local/share/stack/.stack-work/installed-cache.bin
2018-09-03 14:16:37.172955: [debug] Finished writing /usr/local/share/stack/.stack-work/installed-cache.bin
2018-09-03 14:16:37.173583: [debug] Constructing the build plan
2018-09-03 14:16:37.181355: [debug] Checking if we are going to build multiple executables with the same name
2018-09-03 14:16:37.181590: [debug] Executing the build plan
2018-09-03 14:16:37.182114: [debug] Getting global package database location
2018-09-03 14:16:37.182217: [debug] Run process: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --no-user-package-db list --global
2018-09-03 14:16:37.203997: [debug] Process finished in 22ms: /home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --no-user-package-db list --global
2018-09-03 14:16:37.204936: [debug] Exception ignored when attempting to load /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-config-cache: /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-config-cache: openBinaryFile: does not exist (No such file or directory)
2018-09-03 14:16:37.205249: [debug] Exception ignored when attempting to load /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-cabal-mod: /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-cabal-mod: openBinaryFile: does not exist (No such file or directory)
2018-09-03 14:16:37.205457: [info] pantry-0.1.0.0: configure (lib)
2018-09-03 14:16:37.206393: [debug] Run process within /usr/local/share/stack/subs/pantry/: /home/bm12/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 configure --with-ghc=/home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc --with-ghc-pkg=/home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/bm12/.stack/snapshots/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/pkgdb --package-db=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/pkgdb --libdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/lib --bindir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/bin --datadir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/share --libexecdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/libexec --sysconfdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/etc --docdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/doc/pantry-0.1.0.0 --htmldir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/doc/pantry-0.1.0.0 --haddockdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/doc/pantry-0.1.0.0 --dependency=Cabal=Cabal-2.2.0.1-Lb1cHHHfWsEGsk1Mv9Htjy --dependency=aeson=aeson-1.2.4.0-JGif0DufqrUIKpKBERMqRh --dependency=base=base-4.10.1.0 --dependency=bytestring=bytestring-0.10.8.2 --dependency=conduit=conduit-1.3.0.3-IvOaPgGbzp92k2zxh8sXfB --dependency=conduit-extra=conduit-extra-1.3.0-Kgipel7uEvx5wMqZSJ4iLh --dependency=containers=containers-0.5.10.2 --dependency=cryptonite=cryptonite-0.25-1ewBOskaKusHIlbi8dAS5S --dependency=cryptonite-conduit=cryptonite-conduit-0.2.2-GZ5wS6xeI73F69I0AI6rvf --dependency=digest=digest-0.0.1.2-J7cjlUazOWnIwNGrU2CIF8 --dependency=generic-deriving=generic-deriving-1.12.2-2uHoUqlZfExFvKD5udg9ZU --dependency=hackage-security=hackage-security-0.5.3.0-DfzsoYuDFhA8ggvKwTe6n1 --dependency=hpack=hpack-0.30.0-6AWMwd7e3Y6DyYgi8wu1WT --dependency=http-client=http-client-0.5.13.1-IMtl18fqOyFcRiXB9qJib --dependency=http-client-tls=http-client-tls-0.3.5.3-GPQhBEuTj8pLahHrBWt054 --dependency=http-conduit=http-conduit-2.3.2-H3NQqYTD6OSB8ivcJTLKY9 --dependency=http-types=http-types-0.12.1-20NLDWrYorfCy3zUNrIMsI --dependency=memory=memory-0.14.16-LNR4cyVvGAB2552PJyZmbr --dependency=network-uri=network-uri-2.6.1.0-EYywkSTD8HiCwSdvhz21Tw --dependency=path=path-0.6.1-3o5rX0AdGGABj9TU7FAMPY --dependency=path-io=path-io-1.3.3-HYMEXSNdQLEBkjA5ySIKYG --dependency=persistent=persistent-2.8.2-GNQvlIsv2EW2GbXt3I2mQe --dependency=persistent-sqlite=persistent-sqlite-2.8.2-IghFkgyfWRQ1sAAnWFN7vI --dependency=persistent-template=persistent-template-2.5.4-AIuX1hkSIeVBw9RoUMwtkq --dependency=primitive=primitive-0.6.4.0-kK2x3tDWKdAgEjt22m9eJ --dependency=resource-pool=resource-pool-0.2.3.2-4caQkNQi7k1CLkuXQ8ojSH --dependency=resourcet=resourcet-1.2.1-ot7hNUCbsMCJNDK69Q1Is --dependency=rio=rio-0.1.4.0-KpxBVIbHihC3GmxRbzgwl3 --dependency=rio-orphans=rio-orphans-0.1.1.0-HZOG4bnTqYz85VDRSfs3WZ --dependency=store=store-0.4.3.1-44zIqyHPWwAL0DagfxVMQs --dependency=tar-conduit=tar-conduit-0.2.4-9UeBmnU1ZmnJE58R79kF0X --dependency=text=text-1.2.3.0-8nD60G3tOYT3Qi8GaESeB5 --dependency=text-metrics=text-metrics-0.3.0-w02EXzcH4R9ji163GV4OI --dependency=time=time-1.8.0.2 --dependency=transformers=transformers-0.5.2.0 --dependency=unix-compat=unix-compat-0.5.0.1-AtNnJ204ySI1W22dRbQG6f --dependency=unliftio=unliftio-0.2.7.0-1Q5tCL94rVs5v7v6Em3tvf --dependency=unordered-containers=unordered-containers-0.2.9.0-AID53f8BSxj1wBLxJT9npu --dependency=vector=vector-0.12.0.1-81HFvG2McTgAiNXCyGXulK --dependency=yaml=yaml-0.10.1.1-E9qRYo7j7EhHf1fhAPj7fN --dependency=zip-archive=zip-archive-0.3.3-FlwYvKSMdZEHnRa96RTAf0 --enable-library-profiling --enable-profiling --ghc-options -fhide-source-paths --ghc-options -fprof-auto --ghc-options -fprof-cafs --enable-benchmarks
2018-09-03 14:16:38.340470: [debug] Process finished in 1133ms: /home/bm12/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 configure --with-ghc=/home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc --with-ghc-pkg=/home/bm12/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/bm12/.stack/snapshots/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/pkgdb --package-db=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/pkgdb --libdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/lib --bindir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/bin --datadir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/share --libexecdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/libexec --sysconfdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/etc --docdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/doc/pantry-0.1.0.0 --htmldir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/doc/pantry-0.1.0.0 --haddockdir=/usr/local/share/stack/.stack-work/install/x86_64-linux/27523eb2a48b886b1e751e2daf98ec613f454fd1bddbaf07b8af3346e78d5ccc/8.2.2/doc/pantry-0.1.0.0 --dependency=Cabal=Cabal-2.2.0.1-Lb1cHHHfWsEGsk1Mv9Htjy --dependency=aeson=aeson-1.2.4.0-JGif0DufqrUIKpKBERMqRh --dependency=base=base-4.10.1.0 --dependency=bytestring=bytestring-0.10.8.2 --dependency=conduit=conduit-1.3.0.3-IvOaPgGbzp92k2zxh8sXfB --dependency=conduit-extra=conduit-extra-1.3.0-Kgipel7uEvx5wMqZSJ4iLh --dependency=containers=containers-0.5.10.2 --dependency=cryptonite=cryptonite-0.25-1ewBOskaKusHIlbi8dAS5S --dependency=cryptonite-conduit=cryptonite-conduit-0.2.2-GZ5wS6xeI73F69I0AI6rvf --dependency=digest=digest-0.0.1.2-J7cjlUazOWnIwNGrU2CIF8 --dependency=generic-deriving=generic-deriving-1.12.2-2uHoUqlZfExFvKD5udg9ZU --dependency=hackage-security=hackage-security-0.5.3.0-DfzsoYuDFhA8ggvKwTe6n1 --dependency=hpack=hpack-0.30.0-6AWMwd7e3Y6DyYgi8wu1WT --dependency=http-client=http-client-0.5.13.1-IMtl18fqOyFcRiXB9qJib --dependency=http-client-tls=http-client-tls-0.3.5.3-GPQhBEuTj8pLahHrBWt054 --dependency=http-conduit=http-conduit-2.3.2-H3NQqYTD6OSB8ivcJTLKY9 --dependency=http-types=http-types-0.12.1-20NLDWrYorfCy3zUNrIMsI --dependency=memory=memory-0.14.16-LNR4cyVvGAB2552PJyZmbr --dependency=network-uri=network-uri-2.6.1.0-EYywkSTD8HiCwSdvhz21Tw --dependency=path=path-0.6.1-3o5rX0AdGGABj9TU7FAMPY --dependency=path-io=path-io-1.3.3-HYMEXSNdQLEBkjA5ySIKYG --dependency=persistent=persistent-2.8.2-GNQvlIsv2EW2GbXt3I2mQe --dependency=persistent-sqlite=persistent-sqlite-2.8.2-IghFkgyfWRQ1sAAnWFN7vI --dependency=persistent-template=persistent-template-2.5.4-AIuX1hkSIeVBw9RoUMwtkq --dependency=primitive=primitive-0.6.4.0-kK2x3tDWKdAgEjt22m9eJ --dependency=resource-pool=resource-pool-0.2.3.2-4caQkNQi7k1CLkuXQ8ojSH --dependency=resourcet=resourcet-1.2.1-ot7hNUCbsMCJNDK69Q1Is --dependency=rio=rio-0.1.4.0-KpxBVIbHihC3GmxRbzgwl3 --dependency=rio-orphans=rio-orphans-0.1.1.0-HZOG4bnTqYz85VDRSfs3WZ --dependency=store=store-0.4.3.1-44zIqyHPWwAL0DagfxVMQs --dependency=tar-conduit=tar-conduit-0.2.4-9UeBmnU1ZmnJE58R79kF0X --dependency=text=text-1.2.3.0-8nD60G3tOYT3Qi8GaESeB5 --dependency=text-metrics=text-metrics-0.3.0-w02EXzcH4R9ji163GV4OI --dependency=time=time-1.8.0.2 --dependency=transformers=transformers-0.5.2.0 --dependency=unix-compat=unix-compat-0.5.0.1-AtNnJ204ySI1W22dRbQG6f --dependency=unliftio=unliftio-0.2.7.0-1Q5tCL94rVs5v7v6Em3tvf --dependency=unordered-containers=unordered-containers-0.2.9.0-AID53f8BSxj1wBLxJT9npu --dependency=vector=vector-0.12.0.1-81HFvG2McTgAiNXCyGXulK --dependency=yaml=yaml-0.10.1.1-E9qRYo7j7EhHf1fhAPj7fN --dependency=zip-archive=zip-archive-0.3.3-FlwYvKSMdZEHnRa96RTAf0 --enable-library-profiling --enable-profiling --ghc-options -fhide-source-paths --ghc-options -fprof-auto --ghc-options -fprof-cafs --enable-benchmarks
2018-09-03 14:16:38.340729: [debug] Encoding /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-config-cache
2018-09-03 14:16:38.341473: [debug] Finished writing /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-config-cache
2018-09-03 14:16:38.341588: [debug] Encoding /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-cabal-mod
2018-09-03 14:16:38.341893: [debug] Finished writing /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-cabal-mod
2018-09-03 14:16:38.342105: [debug] Start: getPackageFiles /usr/local/share/stack/subs/pantry/pantry.cabal
2018-09-03 14:16:38.349100: [debug] Finished in 7ms: getPackageFiles /usr/local/share/stack/subs/pantry/pantry.cabal
2018-09-03 14:16:38.349417: [debug] Exception ignored when attempting to load /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-build-caches/lib: /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-build-caches/lib: openBinaryFile: does not exist (No such file or directory)
2018-09-03 14:16:38.351473: [debug] Encoding /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-build-caches/lib
2018-09-03 14:16:38.351877: [debug] Finished writing /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-build-caches/lib
2018-09-03 14:16:38.351955: [info] pantry-0.1.0.0: build (lib)
2018-09-03 14:16:38.352114: [debug] Run process within /usr/local/share/stack/subs/pantry/: /home/bm12/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build lib:pantry --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
2018-09-03 14:19:21.475104: [debug] Start: getPackageFiles /usr/local/share/stack/subs/pantry/pantry.cabal
2018-09-03 14:19:21.503901: [debug] Finished in 29ms: getPackageFiles /usr/local/share/stack/subs/pantry/pantry.cabal
2018-09-03 14:19:21.504226: [debug] Encoding /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-build-caches/lib
2018-09-03 14:19:21.504643: [debug] Finished writing /usr/local/share/stack/subs/pantry/.stack-work/dist/x86_64-linux/Cabal-2.0.1.0/stack-build-caches/lib
2018-09-03 14:19:21.505132: [info] Log files have been written to: /usr/local/share/stack/.stack-work/logs/
Progress 1/3

--  While building package pantry-0.1.0.0 using:
      /home/bm12/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build lib:pantry --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /usr/local/share/stack/.stack-work/logs/pantry-0.1.0.0.log

    Configuring pantry-0.1.0.0...
    Preprocessing library for pantry-0.1.0.0..
    Building library for pantry-0.1.0.0..
    [ 1 of 14] Compiling Data.Aeson.Extended
    [ 2 of 14] Compiling Pantry.Internal.StaticBytes
    [ 3 of 14] Compiling Pantry.SHA256
    [ 4 of 14] Compiling Pantry.Types
    [ 5 of 14] Compiling Pantry.Storage
    [ 6 of 14] Compiling Pantry.Tree
    [ 7 of 14] Compiling Pantry.Internal
    [ 8 of 14] Compiling Pantry.HTTP
    [ 9 of 14] Compiling Hackage.Security.Client.Repository.HttpLib.HttpClient
    [10 of 14] Compiling Pantry.Archive
    [11 of 14] Compiling Pantry.Repo
    [12 of 14] Compiling Pantry.Hackage
    [13 of 14] Compiling Pantry
    [14 of 14] Compiling Paths_pantry
    [ 1 of 14] Compiling Data.Aeson.Extended
    [ 2 of 14] Compiling Pantry.Internal.StaticBytes
    [ 3 of 14] Compiling Pantry.SHA256
    [ 4 of 14] Compiling Pantry.Types
    [ 5 of 14] Compiling Pantry.Storage
    ghc: ^^ Could not load 'pantryzm0zi1zi0zi0zmKdylfgftpdrFajQXv5VfSy_PantryziTypes_zdfPersistFieldSqlFileSizze1_closure', dependency unresolved. See top entry above.


    ByteCodeLink.lookupCE
    During interactive linking, GHCi couldn't find the following symbol:
      pantryzm0zi1zi0zi0zmKdylfgftpdrFajQXv5VfSy_PantryziTypes_zdfPersistFieldSqlFileSizze1_closure
    This may be due to you not asking GHCi to load extra object files,
    archives or DLLs needed by your current session.  Restart GHCi, specifying
    the missing library using the -L/path/to/object/dir and -lmissinglibname
    flags, or simply by naming the relevant files on the GHCi command line.
    Alternatively, this link failure might indicate a bug in GHCi.
    If you suspect the latter, please send a bug report to:
      glasgow-haskell-bugs@haskell.org

stack clean --full is also fails...

@snoyberg
Copy link
Contributor

snoyberg commented Sep 3, 2018

Thanks for confirming. If you don't mind, please try out one more repro attempt: does this bug occur when using Stack 1.7.1 (the latest official release) to perform the build?

@waddlaw
Copy link
Contributor Author

waddlaw commented Sep 3, 2018

Stack 1.7.1 also build fails.

command log

upgrade to latest (stable) stack.

$ stack upgrade --binary-version 1.7.1
Current Stack version: 1.10.0, available download version: 1.7.1
Forcing binary upgrade
Querying for archive location for platform: linux-x86_64-static
Querying for archive location for platform: linux-x86_64
Downloading from: https://github.com/commercialhaskell/stack/releases/download/v1.7.1/stack-1.7.1-linux-x86_64.tar.gz
Download complete, testing executable
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
New stack executable available at /home/bm12/.local/bin/stack
Also copying stack executable to /home/bm12/.local/bin/stack (deleted)
Stack executable copied successfully!

$ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2

remove cabal files.

$ rm stack.cabal 
$ rm subs/pantry/pantry.cabal
$ rm subs/curator/curator.cabal

run stack clean and stack clean -full

$ stack clean

Warning: /usr/local/share/stack/.stack-work/downloaded/mIdc3NsFFMd2/store-8ff486ea5a16665c7fd279963344ac8ef99b6e2a/store/store.cabal was modified manually. Ignoring
         /usr/local/share/stack/.stack-work/downloaded/mIdc3NsFFMd2/store-8ff486ea5a16665c7fd279963344ac8ef99b6e2a/store/package.yaml in favor of the cabal file. If you want to use the package.yaml
         file instead of the cabal file, then please delete the cabal file.

$ stack clean --full

Warning: /usr/local/share/stack/.stack-work/downloaded/mIdc3NsFFMd2/store-8ff486ea5a16665c7fd279963344ac8ef99b6e2a/store/store.cabal was modified manually. Ignoring
         /usr/local/share/stack/.stack-work/downloaded/mIdc3NsFFMd2/store-8ff486ea5a16665c7fd279963344ac8ef99b6e2a/store/package.yaml in favor of the cabal file. If you want to use the package.yaml
         file instead of the cabal file, then please delete the cabal file.

run stack build --profile

$ stack build --profile
...

Configuring pantry-0.1.0.0...
    Preprocessing library for pantry-0.1.0.0..
    Building library for pantry-0.1.0.0..
    [ 1 of 14] Compiling Data.Aeson.Extended
    [ 2 of 14] Compiling Pantry.Internal.StaticBytes
    [ 3 of 14] Compiling Pantry.SHA256
    [ 4 of 14] Compiling Pantry.Types
    [ 5 of 14] Compiling Pantry.Storage
    [ 6 of 14] Compiling Pantry.Tree
    [ 7 of 14] Compiling Pantry.Internal
    [ 8 of 14] Compiling Pantry.HTTP
    [ 9 of 14] Compiling Hackage.Security.Client.Repository.HttpLib.HttpClient
    [10 of 14] Compiling Pantry.Archive
    [11 of 14] Compiling Pantry.Repo
    [12 of 14] Compiling Pantry.Hackage
    [13 of 14] Compiling Pantry
    [14 of 14] Compiling Paths_pantry
    [ 1 of 14] Compiling Data.Aeson.Extended
    [ 2 of 14] Compiling Pantry.Internal.StaticBytes
    [ 3 of 14] Compiling Pantry.SHA256
    [ 4 of 14] Compiling Pantry.Types
    [ 5 of 14] Compiling Pantry.Storage
    ghc: ^^ Could not load 'pantryzm0zi1zi0zi0zmKdylfgftpdrFajQXv5VfSy_PantryziTypes_zdfPersistFieldSqlFileSizze1_closure', dependency unresolved. See top entry above.


    ByteCodeLink.lookupCE
    During interactive linking, GHCi couldn't find the following symbol:
      pantryzm0zi1zi0zi0zmKdylfgftpdrFajQXv5VfSy_PantryziTypes_zdfPersistFieldSqlFileSizze1_closure
    This may be due to you not asking GHCi to load extra object files,
    archives or DLLs needed by your current session.  Restart GHCi, specifying
    the missing library using the -L/path/to/object/dir and -lmissinglibname
    flags, or simply by naming the relevant files on the GHCi command line.
    Alternatively, this link failure might indicate a bug in GHCi.
    If you suspect the latter, please send a bug report to:
      glasgow-haskell-bugs@haskell.org

Is there any other way?

@snoyberg
Copy link
Contributor

snoyberg commented Sep 3, 2018

Interesting. Thanks for going through all of those steps. That looks like a bug in either Cabal or, more likely, GHC, but it's possible that either (1) there's a bug in how Stack is configuring Cabal, or (2) there's something in the Pantry package that's causing this to happen. I'll have a look, but I'm not terribly familiar with the profiling build pipeline.

@snoyberg
Copy link
Contributor

snoyberg commented Sep 3, 2018

More in line with it being a GHC bug, there's https://ghc.haskell.org/trac/ghc/ticket/14210.

@snoyberg
Copy link
Contributor

snoyberg commented Sep 3, 2018

One possible alternative: you could try the command stack build --profile --stack-yaml stack-nightly.yaml and see if the bug is still there with GHC 8.4.3. I don't have time to run that on my system right now.

@waddlaw
Copy link
Contributor Author

waddlaw commented Sep 3, 2018

Unfortunately, it didn't work out :(

$ stack clean --full
$ stack build --profile --stack-yaml stack-nightly.yaml
...

--  While building custom Setup.hs for package pantry-0.1.0.0 using:
      /home/bm12/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.2.0.1 build lib:pantry --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/bm12/Desktop/repo/upstream/stack/.stack-work/logs/pantry-0.1.0.0.log

    Configuring pantry-0.1.0.0...
    Preprocessing library for pantry-0.1.0.0..
    Building library for pantry-0.1.0.0..
    [ 1 of 14] Compiling Data.Aeson.Extended
    [ 2 of 14] Compiling Pantry.Internal.StaticBytes
    [ 3 of 14] Compiling Pantry.SHA256
    [ 4 of 14] Compiling Pantry.Types
    [ 5 of 14] Compiling Pantry.Storage
    [ 6 of 14] Compiling Pantry.Tree
    [ 7 of 14] Compiling Pantry.Internal
    [ 8 of 14] Compiling Pantry.HTTP
    [ 9 of 14] Compiling Hackage.Security.Client.Repository.HttpLib.HttpClient
    [10 of 14] Compiling Pantry.Archive
    [11 of 14] Compiling Pantry.Repo
    [12 of 14] Compiling Pantry.Hackage
    [13 of 14] Compiling Pantry
    [14 of 14] Compiling Paths_pantry
    [ 1 of 14] Compiling Data.Aeson.Extended
    [ 2 of 14] Compiling Pantry.Internal.StaticBytes
    [ 3 of 14] Compiling Pantry.SHA256
    [ 4 of 14] Compiling Pantry.Types
    [ 5 of 14] Compiling Pantry.Storage
    ghc: ^^ Could not load 'pantryzm0zi1zi0zi0zmA9yWaNaa2bk93b550QHp2ZZ_PantryziTypes_zdfPersistFieldSqlFileSizze1_closure', dependency unresolved. See top entry above.


    ByteCodeLink.lookupCE
    During interactive linking, GHCi couldn't find the following symbol:
      pantryzm0zi1zi0zi0zmA9yWaNaa2bk93b550QHp2ZZ_PantryziTypes_zdfPersistFieldSqlFileSizze1_closure
    This may be due to you not asking GHCi to load extra object files,
    archives or DLLs needed by your current session.  Restart GHCi, specifying
    the missing library using the -L/path/to/object/dir and -lmissinglibname
    flags, or simply by naming the relevant files on the GHCi command line.
    Alternatively, this link failure might indicate a bug in GHCi.
    If you suspect the latter, please send a bug report to:
      glasgow-haskell-bugs@haskell.org

@k-bx
Copy link
Contributor

k-bx commented Oct 5, 2018

@snoyberg profiling-build is broken in a smiliar way on my work project. How confident are you that it's related to https://ghc.haskell.org/trac/ghc/ticket/14210 ? What can I do to put more info and bump it in priority? Seems like a quite a serious issue to not have a profiling build working, unlike the "low" priority GHC bug.

@k-bx
Copy link
Contributor

k-bx commented Oct 5, 2018

Side-note: our project builds with profiling fine if optimizations are turned off (-O0), but that kind of defeats the purpose.

edit: also with mentioning, we're on nightly-2018-06-06

@qrilka
Copy link
Contributor

qrilka commented Oct 5, 2018

This looks to be a problem described (documented bug is a feature?) in the Haskell User Guide - https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#using-template-haskell-with-profiling
In https://github.com/qrilka/lookupCE-error I've created a minimal reproduction, also please a note that using Bar2 with manually defined (with no GeneralizedNewtypeDeriving) instances for PersistField and PersistFieldSql makes this error disappear.
Also a recipe from the user guide with -osufix p_o looks to work but Stack doesn't pass GHC options when running GHC with -ddump-hi

@k-bx
Copy link
Contributor

k-bx commented Oct 6, 2018

@qrilka thanks a lot for digging into this! Adding -fexternal-interpreter seems to help. I wonder if it'd be a good idea if stack --profile would imply that flag.

@qrilka
Copy link
Contributor

qrilka commented Oct 6, 2018

it's great to hear that it did help you @k-bx I thought that it could be good to have such an option but for me stack build --profile --ghc-options="-fexternal-interpreter" fails with

    [ 53 of 127] Compiling Stack.Types.Build
    [ 54 of 127] Compiling Stack.StoreTH
    ghc-iserv: /home/qrilka/.stack/snapshots/x86_64-linux-tinfo6/custom-snapshot-for-building-stack-with-ghc-8.2.2-pCszpsbxTIK6/8.2.2/lib/x86_64-linux-ghc-8.2.2/persistent-sqlite-2.8.2-IghFkgyfWRQ1sAAnWFN7vI/libHSpersistent-sqlite-2.8.2-IghFkgyfWRQ1sAAnWFN7vI.a: unknown symbol `stat64'
    ghc-iserv: /home/qrilka/.stack/snapshots/x86_64-linux-tinfo6/custom-snapshot-for-building-stack-with-ghc-8.2.2-pCszpsbxTIK6/8.2.2/lib/x86_64-linux-ghc-8.2.2/persistent-sqlite-2.8.2-IghFkgyfWRQ1sAAnWFN7vI/libHSpersistent-sqlite-2.8.2-IghFkgyfWRQ1sAAnWFN7vI.a: unknown symbol `sqlite3_finalize'
    ghc-iserv: /home/qrilka/ws/h/stack/.stack-work/install/x86_64-linux-tinfo6/custom-snapshot-for-building-stack-with-ghc-8.2.2-pCszpsbxTIK6/8.2.2/lib/x86_64-linux-ghc-8.2.2/pantry-0.1.0.0-FPvzZ5vpXIZAuvnpmUlbhm/libHSpantry-0.1.0.0-FPvzZ5vpXIZAuvnpmUlbhm.a: unknown symbol `persistentzmsqlitezm2zi8zi2zmIghFkgyfWRQ1sAAnWFN7vI_DatabaseziPersistziSqlite_zdwopenzq_info'
    ghc-iserv: /home/qrilka/ws/h/stack/.stack-work/install/x86_64-linux-tinfo6/custom-snapshot-for-building-stack-with-ghc-8.2.2-pCszpsbxTIK6/8.2.2/lib/x86_64-linux-ghc-8.2.2/pantry-0.1.0.0-FPvzZ5vpXIZAuvnpmUlbhm/libHSpantry-0.1.0.0-FPvzZ5vpXIZAuvnpmUlbhm.a: unknown symbol `pantryzm0zi1zi0zi0zmFPvzzZZ5vpXIZZAuvnpmUlbhm_PantryziStorage_zdscreateSqlitePoolFromInfo2_closure'
    ghc-iserv: /home/qrilka/ws/h/stack/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.0.1.0/build/Stack/Types/Config.o: unknown symbol `pantryzm0zi1zi0zi0zmFPvzzZZ5vpXIZZAuvnpmUlbhm_Pantry_gpdVersion_closure'

So either it doesn't resolve the problem for all of the cases or there's something else in Stack which gets triggered.

@qrilka
Copy link
Contributor

qrilka commented Oct 6, 2018

Looks like it's about https://ghc.haskell.org/trac/ghc/ticket/12932 and probably we stumble upon the fact of experimental nature of this -fexternal-interpreter flag
Maybe it's worth to mention issues with TH+profiling in stack docs so people could be warned about the situation

@snoyberg
Copy link
Contributor

Closing as an upstream issue.

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

5 participants