When the stack.yaml includes a dependency from github and doing stack build twice, the second command isn't a no-op despite the first command being successful. If doing stack build a third time it is, however. During the second stack build run, stack unregisters the github package saying "local file changes" and reinstalls them again. Diffing the package folder in .stack-work/downloaded before and after the second command reveals that only one file changed: downloaded/<package>/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/stack-build-cache
I can reproduce this on OS X with the following .cabal and stack.yaml content:
foobar.cabal:
name: foobar
version: 0.1.0.0
cabal-version: >=1.10
build-type: Simple
library
build-depends:
base,
HStringTemplate
default-language: Haskell2010
stack.yaml:
packages:
- '.'
- location:
git: https://github.com/factisresearch/HStringTemplate.git
commit: 033328ce078426733020a2c0d943332f37ffee05
extra-dep: true
extra-deps: []
resolver: lts-3.0
When the stack.yaml includes a dependency from github and doing
stack buildtwice, the second command isn't a no-op despite the first command being successful. If doingstack builda third time it is, however. During the secondstack buildrun, stack unregisters the github package saying "local file changes" and reinstalls them again. Diffing the package folder in .stack-work/downloaded before and after the second command reveals that only one file changed:downloaded/<package>/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/stack-build-cacheI can reproduce this on OS X with the following .cabal and stack.yaml content:
foobar.cabal:
stack.yaml: