commercialhaskell/stack

stack myfile.hs throw error: ghc-pkg: cannot find package

Open

#5,099 建立於 2019年11月25日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Haskell (4,060 star) (848 fork)batch import
further investigation requiredhelp wantedtype: discuss

描述

Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2

AppM is my local dir, I add extra-deps in glboal-project/stack.yaml

packages: []
extra-deps: 
- /Users/diqye/hs/AppM
resolver: lts-14.13

run command stack myfile.hs

myfile.hs is

-- stack --resolver lts-14.13 runhaskell  --package AppM -v

main = do 
  putStrLn "hello"

output:

Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
2019-11-27 16:25:49.183175: [debug] Checking for project config at: /Users/diqye/hs/scripts/stack.yaml
2019-11-27 16:25:49.183553: [debug] Checking for project config at: /Users/diqye/hs/stack.yaml
2019-11-27 16:25:49.183604: [debug] Checking for project config at: /Users/diqye/stack.yaml
2019-11-27 16:25:49.183681: [debug] Checking for project config at: /Users/stack.yaml
2019-11-27 16:25:49.183946: [debug] Checking for project config at: /stack.yaml
2019-11-27 16:25:49.184017: [debug] No project config file found, using defaults.
2019-11-27 16:25:49.191427: [debug] SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2019-11-26 08:25:49.191258 UTC]
2019-11-27 16:25:49.192588: [debug] Run from outside a project, using implicit global project config
2019-11-27 16:25:49.193716: [debug] Using resolver: lts-14.13 from implicit global project's config file: /Users/diqye/.stack/global-project/stack.yaml
2019-11-27 16:25:49.193930: [debug] Using package location completions from a lock file
2019-11-27 16:25:49.361579: [debug] Running hpack on /Users/diqye/hs/AppM/package.yaml
2019-11-27 16:25:49.365526: [debug] hpack output unchanged in /Users/diqye/hs/AppM/AppM.cabal
2019-11-27 16:25:49.369123: [debug] Asking for a supported GHC version
2019-11-27 16:25:49.369404: [debug] Installed tools: 
 - ghc-8.6.5
2019-11-27 16:25:49.369547: [debug] Potential GHC builds: standard
2019-11-27 16:25:49.369626: [debug] Found already installed GHC builds: standard
2019-11-27 16:25:49.370045: [debug] SELECT "id","actual_version","arch","ghc_path","ghc_size","ghc_modified","ghc_pkg_path","runghc_path","haddock_path","cabal_version","global_db","global_db_cache_size","global_db_cache_modified","info","global_dump" FROM "compiler_cache" WHERE "ghc_path"=?; [PersistText "/Users/diqye/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc-8.6.5"]
2019-11-27 16:25:49.433140: [debug] Loaded compiler information from cache
2019-11-27 16:25:49.433312: [debug] Asking for a supported GHC version
2019-11-27 16:25:49.433651: [debug] Resolving package entries
2019-11-27 16:25:49.433737: [debug] Parsing the targets
2019-11-27 16:25:49.437016: [debug] Checking flags
2019-11-27 16:25:49.437110: [debug] SourceMap constructed
2019-11-27 16:25:49.449842: [debug] Starting to execute command inside EnvConfig
2019-11-27 16:25:49.452397: [debug] Finding out which packages are already installed
2019-11-27 16:25:49.452678: [debug] Run process: /Users/diqye/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc-pkg-8.6.5 --global --no-user-package-db dump --expand-pkgroot
2019-11-27 16:25:49.538157: [debug] Process finished in 85ms: /Users/diqye/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc-pkg-8.6.5 --global --no-user-package-db dump --expand-pkgroot
2019-11-27 16:25:49.540779: [debug] Ignoring package haskeline due to wanting version 0.7.5.0 instead of 0.7.4.3
2019-11-27 16:25:49.541812: [debug] Ignoring package Cabal due to wanting version 2.4.1.0 instead of 2.4.0.1
2019-11-27 16:25:49.542041: [debug] Ignoring package parsec due to wanting version 3.1.14.0 instead of 3.1.13.0
2019-11-27 16:25:49.542667: [debug] Run process: /Users/diqye/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /Users/diqye/.stack/snapshots/x86_64-osx/423eadda4e7ac58238591a195496406a4f457235c434119aa89fdb16acde51d1/8.6.5/pkgdb dump --expand-pkgroot
2019-11-27 16:25:49.732887: [debug] Process finished in 190ms: /Users/diqye/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /Users/diqye/.stack/snapshots/x86_64-osx/423eadda4e7ac58238591a195496406a4f457235c434119aa89fdb16acde51d1/8.6.5/pkgdb dump --expand-pkgroot
2019-11-27 16:25:49.738835: [debug] Run process: /Users/diqye/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /Users/diqye/.stack/global-project/.stack-work/install/x86_64-osx/423eadda4e7ac58238591a195496406a4f457235c434119aa89fdb16acde51d1/8.6.5/pkgdb dump --expand-pkgroot
2019-11-27 16:25:49.812759: [debug] Process finished in 74ms: /Users/diqye/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /Users/diqye/.stack/global-project/.stack-work/install/x86_64-osx/423eadda4e7ac58238591a195496406a4f457235c434119aa89fdb16acde51d1/8.6.5/pkgdb dump --expand-pkgroot
2019-11-27 16:25:49.813114: [debug] Constructing the build plan
2019-11-27 16:25:49.816247: [debug] Checking if we are going to build multiple executables with the same name
2019-11-27 16:25:49.816378: [debug] Executing the build plan
2019-11-27 16:25:49.817862: [debug] SELECT "id","directory","type","pkg_src","active","path_env_var","haddock" FROM "config_cache" WHERE "directory"=? AND "type"=?; [PersistText "/Users/diqye/hs/AppM/",PersistText "config"]
2019-11-27 16:25:49.818327: [debug] SELECT "id", "config_cache_id", "index", "option" FROM "config_cache_dir_option" WHERE ("config_cache_id"=?) ORDER BY "index"; [PersistInt64 1]
2019-11-27 16:25:49.818664: [debug] SELECT "id", "config_cache_id", "index", "option" FROM "config_cache_no_dir_option" WHERE ("config_cache_id"=?) ORDER BY "index"; [PersistInt64 1]
2019-11-27 16:25:49.818890: [debug] SELECT "id", "config_cache_id", "ghc_pkg_id" FROM "config_cache_dep" WHERE ("config_cache_id"=?); [PersistInt64 1]
2019-11-27 16:25:49.819081: [debug] SELECT "id", "config_cache_id", "component" FROM "config_cache_component" WHERE ("config_cache_id"=?); [PersistInt64 1]
2019-11-27 16:25:49.819818: [debug] Start: getPackageFiles /Users/diqye/hs/AppM/AppM.cabal
2019-11-27 16:25:49.825598: [debug] Finished in 6ms: getPackageFiles /Users/diqye/hs/AppM/AppM.cabal
2019-11-27 16:25:49.828251: [info] AppM> build (lib + exe)
2019-11-27 16:25:49.828551: [debug] Run process within /Users/diqye/hs/AppM/: /Users/diqye/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 build lib:AppM exe:AppM-exe --ghc-options " -fdiagnostics-color=always"
2019-11-27 16:25:49.970224: [info] AppM> Preprocessing library for AppM-0.1.0.0..
2019-11-27 16:25:49.970408: [info] AppM> Building library for AppM-0.1.0.0..
2019-11-27 16:25:50.890598: [info] AppM> Preprocessing executable 'AppM-exe' for AppM-0.1.0.0..
2019-11-27 16:25:50.890720: [info] AppM> Building executable 'AppM-exe' for AppM-0.1.0.0..
2019-11-27 16:25:51.767229: [debug] Process finished in 1939ms: /Users/diqye/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 build lib:AppM exe:AppM-exe --ghc-options " -fdiagnostics-color=always"
2019-11-27 16:25:51.767338: [debug] Start: getPackageFiles /Users/diqye/hs/AppM/AppM.cabal
2019-11-27 16:25:51.772122: [debug] Finished in 5ms: getPackageFiles /Users/diqye/hs/AppM/AppM.cabal
2019-11-27 16:25:51.773404: [info] AppM> copy/register
2019-11-27 16:25:51.773675: [debug] Run process within /Users/diqye/hs/AppM/: /Users/diqye/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 copy
2019-11-27 16:25:51.911564: [info] AppM> Installing library in /Users/diqye/hs/AppM/.stack-work/install/x86_64-osx/1ff37833aae7c94f69e44adc1b5c083b179234b2aede8da2b27dd03a0c9d1610/8.6.5/lib/x86_64-osx-ghc-8.6.5/AppM-0.1.0.0-CViVS8S33MBGAX58SRa5Mc
2019-11-27 16:25:51.911689: [info] AppM> Installing executable AppM-exe in /Users/diqye/hs/AppM/.stack-work/install/x86_64-osx/1ff37833aae7c94f69e44adc1b5c083b179234b2aede8da2b27dd03a0c9d1610/8.6.5/bin
2019-11-27 16:25:51.911821: [warn] AppM> Warning: The directory
2019-11-27 16:25:51.911910: [warn] AppM> /Users/diqye/hs/AppM/.stack-work/install/x86_64-osx/1ff37833aae7c94f69e44adc1b5c083b179234b2aede8da2b27dd03a0c9d1610/8.6.5/bin
2019-11-27 16:25:51.911988: [warn] AppM> is not in the system search path.
2019-11-27 16:25:51.993495: [debug] Process finished in 220ms: /Users/diqye/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 copy
2019-11-27 16:25:51.994345: [debug] Run process within /Users/diqye/hs/AppM/: /Users/diqye/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 register
2019-11-27 16:25:52.357897: [info] AppM> Registering library for AppM-0.1.0.0..
2019-11-27 16:25:52.368701: [debug] Process finished in 374ms: /Users/diqye/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 register
2019-11-27 16:25:52.368984: [debug] Run process: /Users/diqye/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /Users/diqye/.stack/global-project/.stack-work/install/x86_64-osx/423eadda4e7ac58238591a195496406a4f457235c434119aa89fdb16acde51d1/8.6.5/pkgdb describe --simple-output AppM --expand-pkgroot
2019-11-27 16:25:52.446089: [error] Received ExitFailure 1 when running
Raw command: /Users/diqye/.stack/programs/x86_64-osx/ghc-8.6.5/bin/ghc-pkg-8.6.5 --user --no-user-package-db --package-db /Users/diqye/.stack/global-project/.stack-work/install/x86_64-osx/423eadda4e7ac58238591a195496406a4f457235c434119aa89fdb16acde51d1/8.6.5/pkgdb describe --simple-output AppM --expand-pkgroot
Standard error:

ghc-pkg: cannot find package AppM

stack build is ok in standard stack project

貢獻者指南