{"action":"closed","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/1982","repository_url":"https://api.github.com/repos/commercialhaskell/stack","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/1982/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/1982/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/1982/events","html_url":"https://github.com/commercialhaskell/stack/issues/1982","id":145230521,"number":1982,"title":"extra-source-files outside the package directory don't trigger a rebuild","user":{"login":"mtolly","id":1427698,"avatar_url":"https://avatars.githubusercontent.com/u/1427698?v=3","gravatar_id":"","url":"https://api.github.com/users/mtolly","html_url":"https://github.com/mtolly","followers_url":"https://api.github.com/users/mtolly/followers","following_url":"https://api.github.com/users/mtolly/following{/other_user}","gists_url":"https://api.github.com/users/mtolly/gists{/gist_id}","starred_url":"https://api.github.com/users/mtolly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtolly/subscriptions","organizations_url":"https://api.github.com/users/mtolly/orgs","repos_url":"https://api.github.com/users/mtolly/repos","events_url":"https://api.github.com/users/mtolly/events{/privacy}","received_events_url":"https://api.github.com/users/mtolly/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/commercialhaskell/stack/labels/awaiting%20pr","name":"awaiting pr","color":"fef2c0"},{"url":"https://api.github.com/repos/commercialhaskell/stack/labels/type:%20bug","name":"type: bug","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/commercialhaskell/stack/milestones/6","html_url":"https://github.com/commercialhaskell/stack/milestones/P2:%20Should","labels_url":"https://api.github.com/repos/commercialhaskell/stack/milestones/6/labels","id":1191309,"number":6,"title":"P2: Should","description":"Arbitrary date chosen, just to get the milestones to order nicely","creator":{"login":"snoyberg","id":49415,"avatar_url":"https://avatars.githubusercontent.com/u/49415?v=3","gravatar_id":"","url":"https://api.github.com/users/snoyberg","html_url":"https://github.com/snoyberg","followers_url":"https://api.github.com/users/snoyberg/followers","following_url":"https://api.github.com/users/snoyberg/following{/other_user}","gists_url":"https://api.github.com/users/snoyberg/gists{/gist_id}","starred_url":"https://api.github.com/users/snoyberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoyberg/subscriptions","organizations_url":"https://api.github.com/users/snoyberg/orgs","repos_url":"https://api.github.com/users/snoyberg/repos","events_url":"https://api.github.com/users/snoyberg/events{/privacy}","received_events_url":"https://api.github.com/users/snoyberg/received_events","type":"User","site_admin":false},"open_issues":123,"closed_issues":200,"state":"open","created_at":"2015-07-02T18:20:49Z","updated_at":"2016-05-15T13:06:54Z","due_on":"2016-12-31T08:00:00Z","closed_at":null},"comments":2,"created_at":"2016-04-01T16:56:24Z","updated_at":"2016-05-15T13:06:54Z","closed_at":"2016-05-15T13:06:54Z","body":"**Steps to reproduce:**\r\n\r\nClone https://github.com/mtolly/stack-extra - basically it is a repo with files:\r\n\r\n* `stack.yaml`\r\n* `extra1`\r\n* `stack-extra/stack-extra.cabal`\r\n* `stack-extra/extra2`\r\n* `stack-extra/src/Main.hs`\r\n\r\nThe cabal package references the two `extra` files as `extra-source-files`, and then uses them in `Main.hs` via `file-embed`.\r\n\r\n**Expected:**\r\n\r\nModifiying either `extra1` or `stack-extra/extra2` should trigger a rebuild of the package.\r\n\r\n**Actual:**\r\n\r\n```\r\n╭─mtolly@metal  ~/g/stack-extra  <master>\r\n╰─$ stack --version\r\nVersion 1.0.5, Git revision 32406d106f46625e03b8495317abc21abc3a1674 x86_64\r\n╭─mtolly@metal  ~/g/stack-extra  <master>\r\n╰─$ stack build\r\nstack-extra-0.1.0.0: configure\r\nConfiguring stack-extra-0.1.0.0...\r\nWarning: 'extra-src-files: ../extra1' is a relative path outside of the source\r\ntree. This will not work when generating a tarball with 'sdist'.\r\nstack-extra-0.1.0.0: build\r\nPreprocessing executable 'stack-extra' for stack-extra-0.1.0.0...\r\n[1 of 1] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/stack-extra/stack-extra-tmp/Main.o )\r\nLinking .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/stack-extra/stack-extra ...\r\nstack-extra-0.1.0.0: copy/register\r\nInstalling executable(s) in\r\n/Users/mtolly/git/stack-extra/.stack-work/install/x86_64-osx/lts-5.10/7.10.3/bin\r\n╭─mtolly@metal  ~/g/stack-extra  <master>\r\n╰─$ echo changed > extra1\r\n╭─mtolly@metal  ~/g/stack-extra  <master*>\r\n╰─$ stack build\r\n╭─mtolly@metal  ~/g/stack-extra  <master*>\r\n╰─$ echo changed > stack-extra/extra2\r\n╭─mtolly@metal  ~/g/stack-extra  <master*>\r\n╰─$ stack build\r\nstack-extra-0.1.0.0: build\r\nPreprocessing executable 'stack-extra' for stack-extra-0.1.0.0...\r\n[1 of 1] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/stack-extra/stack-extra-tmp/Main.o ) [extra2 changed]\r\nLinking .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/stack-extra/stack-extra ...\r\nstack-extra-0.1.0.0: copy/register\r\nInstalling executable(s) in\r\n/Users/mtolly/git/stack-extra/.stack-work/install/x86_64-osx/lts-5.10/7.10.3/bin\r\n```\r\n\r\n[Here](http://pastebin.com/mBusQ5GF) is the verbose output from the 2nd `stack build` command (the one that doesn't rebuild).\r\n\r\nWhat I assume is the same issue:\r\n\r\n```\r\n╭─mtolly@metal  ~/g/stack-extra  <master*>\r\n╰─$ stack build --file-watch\r\nExitSuccess\r\nType help for available commands. Press enter to force a rebuild.\r\nwatched\r\n/Users/mtolly/git/stack-extra/stack-extra/extra2\r\n/Users/mtolly/git/stack-extra/stack-extra/src/Main.hs\r\n/Users/mtolly/git/stack-extra/stack-extra/stack-extra.cabal\r\n/Users/mtolly/git/stack-extra/stack.yaml\r\n```"}}