{"action":"created","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/614","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/614/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/614/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/614/events","html_url":"https://github.com/commercialhaskell/stack/issues/614","id":95544197,"number":614,"title":"Strange `ld` errors when running `stack test --coverage` on stack","user":{"login":"mgsloan","id":22570,"avatar_url":"https://avatars.githubusercontent.com/u/22570?v=3","gravatar_id":"","url":"https://api.github.com/users/mgsloan","html_url":"https://github.com/mgsloan","followers_url":"https://api.github.com/users/mgsloan/followers","following_url":"https://api.github.com/users/mgsloan/following{/other_user}","gists_url":"https://api.github.com/users/mgsloan/gists{/gist_id}","starred_url":"https://api.github.com/users/mgsloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgsloan/subscriptions","organizations_url":"https://api.github.com/users/mgsloan/orgs","repos_url":"https://api.github.com/users/mgsloan/repos","events_url":"https://api.github.com/users/mgsloan/events{/privacy}","received_events_url":"https://api.github.com/users/mgsloan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mgsloan","id":22570,"avatar_url":"https://avatars.githubusercontent.com/u/22570?v=3","gravatar_id":"","url":"https://api.github.com/users/mgsloan","html_url":"https://github.com/mgsloan","followers_url":"https://api.github.com/users/mgsloan/followers","following_url":"https://api.github.com/users/mgsloan/following{/other_user}","gists_url":"https://api.github.com/users/mgsloan/gists{/gist_id}","starred_url":"https://api.github.com/users/mgsloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgsloan/subscriptions","organizations_url":"https://api.github.com/users/mgsloan/orgs","repos_url":"https://api.github.com/users/mgsloan/repos","events_url":"https://api.github.com/users/mgsloan/events{/privacy}","received_events_url":"https://api.github.com/users/mgsloan/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/commercialhaskell/stack/milestones/5","html_url":"https://github.com/commercialhaskell/stack/milestones/0.2.0.0","labels_url":"https://api.github.com/repos/commercialhaskell/stack/milestones/5/labels","id":1166824,"number":5,"title":"0.2.0.0","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":8,"closed_issues":126,"state":"open","created_at":"2015-06-16T14:23:31Z","updated_at":"2015-08-06T19:16:03Z","due_on":"2015-08-31T07:00:00Z","closed_at":null},"comments":6,"created_at":"2015-07-16T22:25:39Z","updated_at":"2015-08-07T21:27:46Z","closed_at":null,"body":"First run I got\r\n\r\n```\r\n[37 of 61] Compiling Stack.PackageIndex ( src/Stack/PackageIndex.hs, .stack-work/dist/x86_64-linux/Cabal-1.18.1.5/build/Stack/PackageIndex.o )\r\n/usr/bin/ld: .stack-work/dist/x86_64-linux/Cabal-1.18.1.5/build/Stack/Types/Image.dyn_o: relocation R_X86_64_PC32 against undefined symbol `_hpc_tickboxes_stackzm0zi1zi2zi1_DataziAesonziExtended_hpc' can not be used when making a shared object; recompile with -fPIC\r\n/usr/bin/ld: final link failed: Bad value\r\ncollect2: error: ld returned 1 exit status\r\n```\r\n\r\nPuzzlingly, next run it got further\r\n\r\n```\r\n[40 of 61] Compiling Stack.Docker     ( src/Stack/Docker.hs, .stack-work/dist/x86_64-linux/Cabal-1.18.1.5/build/Stack/Docker.o )\r\n/usr/bin/ld: .stack-work/dist/x86_64-linux/Cabal-1.18.1.5/build/Stack/Constants.dyn_o: relocation R_X86_64_PC32 against undefined symbol `_hpc_tickboxes_stackzm0zi1zi2zi1_StackziTypesziConfig_hpc' can not be used when making a shared object; recompile with -fPIC\r\n/usr/bin/ld: final link failed: Bad value\r\ncollect2: error: ld returned 1 exit status\r\n```\r\n\r\nThen, the third run finished compilation and successfully ran the tests!  Very weird.\r\n\r\nNext actions:\r\n\r\n1) Report or find GHC bug\r\n2) Have `test --coverage` imply `-fPIC`, as a workaround?\r\n3) Use static linking when doing `test --coverage` \r\n4) An undesireable workaround would be to automatically rerun `stack test` when such an error occurs.  Yuck!"},"comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments/128837468","html_url":"https://github.com/commercialhaskell/stack/issues/614#issuecomment-128837468","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/614","id":128837468,"user":{"login":"drwebb","id":178769,"avatar_url":"https://avatars.githubusercontent.com/u/178769?v=3","gravatar_id":"","url":"https://api.github.com/users/drwebb","html_url":"https://github.com/drwebb","followers_url":"https://api.github.com/users/drwebb/followers","following_url":"https://api.github.com/users/drwebb/following{/other_user}","gists_url":"https://api.github.com/users/drwebb/gists{/gist_id}","starred_url":"https://api.github.com/users/drwebb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drwebb/subscriptions","organizations_url":"https://api.github.com/users/drwebb/orgs","repos_url":"https://api.github.com/users/drwebb/repos","events_url":"https://api.github.com/users/drwebb/events{/privacy}","received_events_url":"https://api.github.com/users/drwebb/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T21:27:46Z","updated_at":"2015-08-07T21:27:46Z","body":"@mgsloan did you test on ghc HEAD? If it's working, we should close this. I can write the FAQ entry in the wiki."}}