byorgey / BlogLiterately

Command-line tool for formatting and publishing blog posts.
GNU General Public License v3.0
19 stars 4 forks source link

Stack build / stack install issues #38

Closed chrissound closed 6 years ago

chrissound commented 6 years ago

Hello!

Many thanks for making this as well as releasing it as open source!

I've attempted to clone the repo down and build / install the project with stack however it seems there are some issues:

stack install
Couldn't find executable BlogLiterately in directory /home/chris/Projects/Haskell/BlogLiterately/.stack-work/install/x86_64-linux-nopie/lts-10.3/8.2.2/bin/
stack build --verbose                                                                   
Version 1.6.5, Git revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9 (5514 commits) x86_64 hpack-0.20.0
2018-03-18 21:44:05.033398: [debug] Checking for project config at: /home/chris/Projects/Haskell/BlogLiterately/stack.yaml
@(Stack/Config.hs:842:9)
2018-03-18 21:44:05.033757: [debug] Loading project config file stack.yaml
@(Stack/Config.hs:868:13)
2018-03-18 21:44:05.036944: [debug] Decoding build plan from: /home/chris/.stack/build-plan/lts-10.3.yaml
@(Stack/Snapshot.hs:150:5)
2018-03-18 21:44:05.037092: [debug] Trying to decode /home/chris/.stack/build-plan-cache/lts-10.3.cache
@(Data/Store/VersionTagged.hs:66:5)
2018-03-18 21:44:05.047706: [debug] Success decoding /home/chris/.stack/build-plan-cache/lts-10.3.cache
@(Data/Store/VersionTagged.hs:70:13)
2018-03-18 21:44:05.049928: [debug] Asking GHC for its version
@(Stack/Setup/Installed.hs:98:13)
2018-03-18 21:44:05.050494: [debug] Run process: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc --numeric-version
@(System/Process/Log.hs:37:3)
2018-03-18 21:44:05.051172: [debug] Getting Cabal package version
@(Stack/GhcPkg.hs:185:5)
2018-03-18 21:44:05.055908: [debug] Getting global package database location
@(Stack/GhcPkg.hs:46:5)
2018-03-18 21:44:05.056123: [debug] Run process: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Log.hs:37:3)
2018-03-18 21:44:05.056533: [debug] Run process: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Log.hs:37:3)
2018-03-18 21:44:05.074963: [debug] Process finished in 18ms: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Log.hs:44:3)
2018-03-18 21:44:05.081431: [debug] Process finished in 24ms: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Log.hs:44:3)
2018-03-18 21:44:05.089780: [debug] Process finished in 39ms: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc --numeric-version
@(System/Process/Log.hs:44:3)
2018-03-18 21:44:05.089893: [debug] GHC version is: ghc-8.2.2
@(Stack/Setup/Installed.hs:102:13)
2018-03-18 21:44:05.090048: [debug] Resolving package entries
@(Stack/Setup.hs:250:5)
2018-03-18 21:44:05.090242: [debug] Trying to decode /home/chris/.stack/loaded-snapshot-cache/x86_64-linux/ghc-8.2.2/lts-10.3.cache
@(Data/Store/VersionTagged.hs:66:5)
2018-03-18 21:44:05.158253: [debug] Success decoding /home/chris/.stack/loaded-snapshot-cache/x86_64-linux/ghc-8.2.2/lts-10.3.cache
@(Data/Store/VersionTagged.hs:70:13)
2018-03-18 21:44:05.158933: [debug] Starting to execute command inside EnvConfig
@(Stack/Runners.hs:170:18)
2018-03-18 21:44:05.158987: [debug] Parsing the targets
@(Stack/Build/Target.hs:460:3)
2018-03-18 21:44:05.161884: [debug] Trying to decode /home/chris/.stack/indices/Hackage/01-index.cache
@(Data/Store/VersionTagged.hs:66:5)
2018-03-18 21:44:05.332425: [debug] Success decoding /home/chris/.stack/indices/Hackage/01-index.cache
@(Data/Store/VersionTagged.hs:70:13)
2018-03-18 21:44:05.357518: [debug] Start: getPackageFiles /home/chris/Projects/Haskell/BlogLiterately/BlogLiterately.cabal
@(Stack/PrettyPrint.hs:134:16)
2018-03-18 21:44:05.370011: [debug] Finished in 12ms: getPackageFiles /home/chris/Projects/Haskell/BlogLiterately/BlogLiterately.cabal
@(Stack/PrettyPrint.hs:134:16)
2018-03-18 21:44:05.372625: [debug] Finding out which packages are already installed
@(Stack/Build/Installed.hs:60:5)
2018-03-18 21:44:05.372844: [debug] Run process: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
@(System/Process/Log.hs:37:3)
2018-03-18 21:44:05.407105: [debug] Process finished in 34ms: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
@(System/Process/Log.hs:44:3)
2018-03-18 21:44:05.407644: [debug] Ignoring package haskeline due to wanting version 0.7.4.2 instead of 0.7.4.0
@(Stack/Build/Installed.hs:190:5)
2018-03-18 21:44:05.408454: [debug] Ignoring package Cabal due to wanting version 2.0.1.1 instead of 2.0.1.0
@(Stack/Build/Installed.hs:190:5)
2018-03-18 21:44:05.408562: [debug] Run process: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /home/chris/.stack/snapshots/x86_64-linux-nopie/lts-10.3/8.2.2/pkgdb dump --expand-pkgroot
@(System/Process/Log.hs:37:3)
2018-03-18 21:44:05.578479: [debug] Process finished in 169ms: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /home/chris/.stack/snapshots/x86_64-linux-nopie/lts-10.3/8.2.2/pkgdb dump --expand-pkgroot
@(System/Process/Log.hs:44:3)
2018-03-18 21:44:05.583071: [debug] Run process: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /home/chris/Projects/Haskell/BlogLiterately/.stack-work/install/x86_64-linux-nopie/lts-10.3/8.2.2/pkgdb dump --expand-pkgroot
@(System/Process/Log.hs:37:3)
2018-03-18 21:44:05.608458: [debug] Process finished in 25ms: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /home/chris/Projects/Haskell/BlogLiterately/.stack-work/install/x86_64-linux-nopie/lts-10.3/8.2.2/pkgdb dump --expand-pkgroot
@(System/Process/Log.hs:44:3)
2018-03-18 21:44:05.609037: [debug] Constructing the build plan
@(Stack/Build/ConstructPlan.hs:180:5)
2018-03-18 21:44:05.615598: [debug] Checking if we are going to build multiple executables with the same name
@(Stack/Build.hs:177:5)
2018-03-18 21:44:05.615709: [debug] Executing the build plan
@(Stack/Build/Execute.hs:490:5)
2018-03-18 21:44:05.616428: [debug] Getting global package database location
@(Stack/GhcPkg.hs:46:5)
2018-03-18 21:44:05.616488: [debug] Run process: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Log.hs:37:3)
2018-03-18 21:44:05.639758: [debug] Process finished in 23ms: /home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Log.hs:44:3)
stack exec BlogLiterately                                                               
Executable named BlogLiterately not found on path: ["/home/chris/Projects/Haskell/BlogLiterately/.stack-work/install/x86_64-linux-nopie/lts-10.3/8.2.2/bin","/home/chris/.stack/snapshots/x86_64-linux-nopie/lts-10.3/8.2.2/bin","/home/chris/.stack/compiler-tools/x86_64-linux-nopie/ghc-8.2.2/bin","/home/chris/.stack/programs/x86_64-linux/ghc-nopie-8.2.2/bin","/usr/share/zsh/scripts/zplug/bin","/home/chris/.zplug/bin","/home/chris/.nix-profile/bin","/home/chris/.nix-profile/sbin","/nix/var/nix/profiles/default/bin","/nix/var/nix/profiles/default/sbin","/home/chris/.local/bin","/home/chris/.cabal/bin","/home/chris/ScriptsVcs/","/opt/google-cloud-sdk/bin","/usr/bin","/usr/local/sbin","/usr/local/bin","/usr/lib/jvm/default/bin","/usr/bin/site_perl","/usr/bin/vendor_perl","/usr/bin/core_perl"]

It seems it has actually been built however:

.stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/BlogLiterately/BlogLiterately --version
BlogLierately v0.8.6.1, (c) Robert Greayer 2008-2010, Brent Yorgey 2012-2013
For help, see http://byorgey.wordpress.com/blogliterately/
byorgey commented 6 years ago

Thanks for the report! That is very strange. Honestly I'm not really sure what is going on here. I can't reproduce the problem --- when I do a stack build it correctly finds and copies the built executable. Maybe try rm -rf .stack-work and stack build again? If that doesn't work I'd say it's a stack bug. What version of stack are you using?

chrissound commented 6 years ago

Removing .stack-work/ and doing the build again seems to have fixed it! Thanks!

The stack verison is: Version 1.6.5, Git revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9 (5514 commits) x86_64 hpack-0.20.0

byorgey commented 6 years ago

Great, glad that worked!