{"action":"created","issue":{"url":"https://api.github.com/repos/snowleopard/hadrian/issues/289","repository_url":"https://api.github.com/repos/snowleopard/hadrian","labels_url":"https://api.github.com/repos/snowleopard/hadrian/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/snowleopard/hadrian/issues/289/comments","events_url":"https://api.github.com/repos/snowleopard/hadrian/issues/289/events","html_url":"https://github.com/snowleopard/hadrian/issues/289","id":180463760,"number":289,"title":"Unnecessary rebuild and lint failure when changing the number of threads","user":{"login":"cocreature","id":1313584,"avatar_url":"https://avatars.githubusercontent.com/u/1313584?v=3","gravatar_id":"","url":"https://api.github.com/users/cocreature","html_url":"https://github.com/cocreature","followers_url":"https://api.github.com/users/cocreature/followers","following_url":"https://api.github.com/users/cocreature/following{/other_user}","gists_url":"https://api.github.com/users/cocreature/gists{/gist_id}","starred_url":"https://api.github.com/users/cocreature/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocreature/subscriptions","organizations_url":"https://api.github.com/users/cocreature/orgs","repos_url":"https://api.github.com/users/cocreature/repos","events_url":"https://api.github.com/users/cocreature/events{/privacy}","received_events_url":"https://api.github.com/users/cocreature/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/snowleopard/hadrian/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/snowleopard/hadrian/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-01T15:53:17Z","updated_at":"2016-10-01T23:50:03Z","closed_at":null,"body":"I encountered this issue on a completely clean build (i.e., fresh clone of ghc & hadrian).\r\n\r\n*Steps to reproduce*\r\n```\r\n./hadrian/build.cabal.sh --progress-info=Brief -j2 # build ghc once\r\n./hadrian/build.cabal.sh --progress-info=Brief -j8 # build again with a different threading level\r\n```\r\n\r\n*Error*\r\n```\r\nUp to date\r\n| Remove directory _build/stage1/libffi\r\n| Create directory _build/stage0\r\n| Remove directory _build/libffi-3.2.1\r\n| Run Tar (stage = Stage1, package = libffi): libffi-tarballs/libffi-3.2.1.tar.gz => _build\r\n| Move directory: _build/libffi-3.2.1 => _build/stage1/libffi\r\n| Fix _build/stage1/libffi/Makefile.in\r\n| Copy file: config.guess => _build/stage1/libffi/config.guess\r\n| Copy file: config.sub => _build/stage1/libffi/config.sub\r\n| Run Configure \"_build/stage1/libffi\" (stage = Stage1, package = libffi): _build/stage1/libffi/Makefile.in => _build/stage1/libffi/Makefile\r\n| Remove directory _build/stage1/gmp\r\n| No GMP library/framework detected; in tree GMP will be built\r\n| Run Tar (stage = Stage1, package = integer-gmp): libraries/integer-gmp/gmp/tarball/gmp-5.0.3-nodoc-patched.tar.bz2 => /tmp/extra-dir-13494059728288\r\n| Copy file: libraries/integer-gmp/gmp/gmpsrc.patch => /tmp/extra-dir-13494059728288/gmpsrc.patch\r\n| Apply patch /tmp/extra-dir-13494059728288/gmpsrc.patch\r\n| Copy file: libraries/integer-gmp/gmp/tarball/gmp-5.0.4.patch => /tmp/extra-dir-13494059728288/gmp-5.0.4.patch\r\n| Apply patch /tmp/extra-dir-13494059728288/gmp-5.0.4.patch\r\n| Move directory: /tmp/extra-dir-13494059728288/gmp-5.0.3 => _build/stage1/gmp\r\n| Run Configure \"_build/stage1/gmp\" (stage = Stage1, package = integer-gmp): _build/stage1/gmp/Makefile.in => _build/stage1/gmp/Makefile\r\n| Run Make \"_build/stage1/libffi\" (stage = Stage1, package = libffi): none => none\r\n/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')\r\n/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')\r\n| Copy file: _build/stage1/libffi/inst/lib/libffi-3.2.1/include/ffi.h => _build/stage1/rts/ffi.h\r\n| Copy file: _build/stage1/libffi/inst/lib/libffi-3.2.1/include/ffitarget.h => _build/stage1/rts/ffitarget.h\r\n| Copy file: _build/stage1/libffi/inst/lib/libffi.a => _build/stage1/rts/libCffi.a\r\n| Successfully built custom library 'libffi'\r\n| Run Make \"_build/stage1/gmp\" (stage = Stage1, package = integer-gmp): none => none\r\nrepl-vsnprintf.c:389:0: warning: ISO C forbids an empty translation unit [-Wpedantic]\r\n #endif /* ! HAVE_VSNPRINTF */\r\n \r\n| Create directory _build/stage1/gmp/include\r\n| Copy file: _build/stage1/gmp/gmp.h => _build/stage1/gmp/include/ghc-gmp.h\r\n| Copy file: _build/stage1/gmp/gmp.h => _build/stage1/gmp/include/gmp.h\r\n| Move file: _build/stage1/gmp/.libs/libgmp.a => _build/stage1/gmp/libgmp.a\r\n| Create directory _build/stage1/gmp/objs\r\n| Run Ar (stage = Stage1, package = integer-gmp): _build/stage1/gmp/libgmp.a => _build/stage1/gmp/objs\r\n| Run Ranlib (_build/stage1/gmp/libgmp.a)\r\n| Successfully built custom library 'gmp'\r\nshakeArgsWith                        0.000s    0%                           \r\nFunction shake                       0.212s    0%                           \r\nDatabase read                        1.188s    3%  =                        \r\nWith database                        0.062s    0%                           \r\nRunning rules                       28.263s   94%  =========================\r\nPool finished (1094 threads, 8 max)  0.009s    0%                           \r\nLint checking                        0.147s    0%                           \r\nTotal                               29.882s  100%                           \r\nLint checking error - value has changed since being depended upon:\r\n  Key:  _build/stage1/gmp/configure\r\n  Old:  File {mod=0xDF76ED72,size=0xF3432,digest=0x7F0F05CD}\r\n  New:  File {mod=0xE290CE2B,size=0xF3432,digest=0x7F0F05CD}\r\n```\r\nIt is not rebuilding if I use the same number of threads. If I run the same command again after this lint error it exits cleanly. Switching back to `-j2` after that reproduces the error (and switching back and forth).\r\n\r\nI am building on an up2date Archlinux 64bit installation with `cabal 1.24`. I’m happy to provide more information so just tell me what you need."},"comment":{"url":"https://api.github.com/repos/snowleopard/hadrian/issues/comments/250944772","html_url":"https://github.com/snowleopard/hadrian/issues/289#issuecomment-250944772","issue_url":"https://api.github.com/repos/snowleopard/hadrian/issues/289","id":250944772,"user":{"login":"snowleopard","id":675286,"avatar_url":"https://avatars.githubusercontent.com/u/675286?v=3","gravatar_id":"","url":"https://api.github.com/users/snowleopard","html_url":"https://github.com/snowleopard","followers_url":"https://api.github.com/users/snowleopard/followers","following_url":"https://api.github.com/users/snowleopard/following{/other_user}","gists_url":"https://api.github.com/users/snowleopard/gists{/gist_id}","starred_url":"https://api.github.com/users/snowleopard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snowleopard/subscriptions","organizations_url":"https://api.github.com/users/snowleopard/orgs","repos_url":"https://api.github.com/users/snowleopard/repos","events_url":"https://api.github.com/users/snowleopard/events{/privacy}","received_events_url":"https://api.github.com/users/snowleopard/received_events","type":"User","site_admin":false},"created_at":"2016-10-01T23:50:02Z","updated_at":"2016-10-01T23:50:02Z","body":"@cocreature @ndmitchell There is one other point to discuss: are we doing the right thing by simply passing `shakeThreads` to Make via `-j` flag? \r\n\r\nIf a user runs Hadrian with `-j4` then we will end up running Make with `-j4` **plus potentially three other threads in Shake itself**, hence resulting in something like `-j7`.\r\n\r\nIdeally, we should be running Make `withThreads 4 $ ...` when using `-j4`. @ndmitchell Can we do this in Shake? I don't think we can at the moment. Whether we should be that accurate is also unclear.\r\n\r\n/cc @michalt"}}
{"actor":{"display_login":"snowleopard"}}