{"action":"created","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/838","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/838/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/838/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/838/events","html_url":"https://github.com/commercialhaskell/stack/issues/838","id":102649045,"number":838,"title":"stack build unnecessarily reinstalls packages from github","user":{"login":"ljli","id":10927795,"avatar_url":"https://avatars.githubusercontent.com/u/10927795?v=3","gravatar_id":"","url":"https://api.github.com/users/ljli","html_url":"https://github.com/ljli","followers_url":"https://api.github.com/users/ljli/followers","following_url":"https://api.github.com/users/ljli/following{/other_user}","gists_url":"https://api.github.com/users/ljli/gists{/gist_id}","starred_url":"https://api.github.com/users/ljli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljli/subscriptions","organizations_url":"https://api.github.com/users/ljli/orgs","repos_url":"https://api.github.com/users/ljli/repos","events_url":"https://api.github.com/users/ljli/events{/privacy}","received_events_url":"https://api.github.com/users/ljli/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-23T19:20:51Z","updated_at":"2015-08-24T10:54:23Z","closed_at":"2015-08-23T21:56:25Z","body":"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`\r\n\r\nI can reproduce this on OS X with the following .cabal and stack.yaml content:\r\nfoobar.cabal:\r\n````\r\nname:                foobar\r\nversion:             0.1.0.0\r\ncabal-version:       >=1.10\r\nbuild-type:          Simple\r\n\r\nlibrary\r\n  build-depends:\r\n    base,\r\n    HStringTemplate\r\n  default-language: Haskell2010\r\n````\r\nstack.yaml:\r\n````\r\npackages:\r\n- '.'\r\n- location:\r\n    git: https://github.com/factisresearch/HStringTemplate.git\r\n    commit: 033328ce078426733020a2c0d943332f37ffee05\r\n  extra-dep: true\r\n\r\nextra-deps: []\r\n\r\nresolver: lts-3.0\r\n````\r\n"},"comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments/134148607","html_url":"https://github.com/commercialhaskell/stack/issues/838#issuecomment-134148607","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/838","id":134148607,"user":{"login":"loisch","id":1087073,"avatar_url":"https://avatars.githubusercontent.com/u/1087073?v=3","gravatar_id":"","url":"https://api.github.com/users/loisch","html_url":"https://github.com/loisch","followers_url":"https://api.github.com/users/loisch/followers","following_url":"https://api.github.com/users/loisch/following{/other_user}","gists_url":"https://api.github.com/users/loisch/gists{/gist_id}","starred_url":"https://api.github.com/users/loisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loisch/subscriptions","organizations_url":"https://api.github.com/users/loisch/orgs","repos_url":"https://api.github.com/users/loisch/repos","events_url":"https://api.github.com/users/loisch/events{/privacy}","received_events_url":"https://api.github.com/users/loisch/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T10:54:23Z","updated_at":"2015-08-24T10:54:23Z","body":"I am disappointed that you are closing this issue.  It's not very reassuring having a build system that claims to be done but on the next call realises that it's it has still work to do.  The whole point of having a build system is for tracking dependencies and not having to rebuild everything.  I don't  really mind how often stack builds stuff internally - but I want it to end in a clean state and correctly detect if a rebuild is needed.  If you really need to build packages twice then it should be done in the the one 'stack build' call so that this call can end in a clean state.\r\nWe're a company and building our >150.000 LOC Haskell with all it's dependencies is time consuming.  We just switched to stack and we love it.  I can change my stack.yml or my Cabal file and the right things will be rebuilt.  It stop's being fun if I can't trust it to correctly track dependencies. I often call \"stack build\" just to be sure everything is consistent.  With this behavior I start wondering: what the heck changed?\r\nPlease consider reopening and fixing this issue - possibly by immediately rebuilding the \"dirty\" packages.  "}}