{"action":"created","issue":{"url":"https://api.github.com/repos/LLNL/spack/issues/586","repository_url":"https://api.github.com/repos/LLNL/spack","labels_url":"https://api.github.com/repos/LLNL/spack/issues/586/labels{/name}","comments_url":"https://api.github.com/repos/LLNL/spack/issues/586/comments","events_url":"https://api.github.com/repos/LLNL/spack/issues/586/events","html_url":"https://github.com/LLNL/spack/issues/586","id":142142716,"number":586,"title":"temporary build folder and logs","user":{"login":"davydden","id":8023934,"avatar_url":"https://avatars.githubusercontent.com/u/8023934?v=3","gravatar_id":"","url":"https://api.github.com/users/davydden","html_url":"https://github.com/davydden","followers_url":"https://api.github.com/users/davydden/followers","following_url":"https://api.github.com/users/davydden/following{/other_user}","gists_url":"https://api.github.com/users/davydden/gists{/gist_id}","starred_url":"https://api.github.com/users/davydden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davydden/subscriptions","organizations_url":"https://api.github.com/users/davydden/orgs","repos_url":"https://api.github.com/users/davydden/repos","events_url":"https://api.github.com/users/davydden/events{/privacy}","received_events_url":"https://api.github.com/users/davydden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-20T09:02:27Z","updated_at":"2016-03-20T09:14:27Z","closed_at":null,"body":"Currently the temporary folder where a package is build can be quite elaborated: `/private/var/folders/5k/sqpp24tx3ylds4fgm13pfht00000gn/T/davydden/spack-stage/spack-stage-k7EHWk/trilinos-12.4.2-Source`. That makes debugging build errors more difficult than it should. I think something like `/private/tmp/trilinos-12.4.2-<hash>` would be better.\r\n\r\nI would also suggest keeping build logs in some folder, i.e. `skack/logs` (separated for configure and build). The rationale is as follows: if the build is successful, the temporary folder gets deleted. But successful build does not yet mean correct build. Sometimes it is convenient to check configure stage of a package to see, say, what parts of the library were enabled/disabled. Good example is trilinos."},"comment":{"url":"https://api.github.com/repos/LLNL/spack/issues/comments/198878082","html_url":"https://github.com/LLNL/spack/issues/586#issuecomment-198878082","issue_url":"https://api.github.com/repos/LLNL/spack/issues/586","id":198878082,"user":{"login":"tgamblin","id":299842,"avatar_url":"https://avatars.githubusercontent.com/u/299842?v=3","gravatar_id":"","url":"https://api.github.com/users/tgamblin","html_url":"https://github.com/tgamblin","followers_url":"https://api.github.com/users/tgamblin/followers","following_url":"https://api.github.com/users/tgamblin/following{/other_user}","gists_url":"https://api.github.com/users/tgamblin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgamblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgamblin/subscriptions","organizations_url":"https://api.github.com/users/tgamblin/orgs","repos_url":"https://api.github.com/users/tgamblin/repos","events_url":"https://api.github.com/users/tgamblin/events{/privacy}","received_events_url":"https://api.github.com/users/tgamblin/received_events","type":"User","site_admin":false},"created_at":"2016-03-20T09:14:27Z","updated_at":"2016-03-20T09:14:27Z","body":"The location for temporary directories on Mac OS X comes from the value of `$TMPDIR`... which is indeed set to something more convoluted than on other systems:\r\n\r\nMy mac:\r\n```bash\r\n(atala):~$ env | grep TMP\r\nTMPDIR=/var/folders/0s/q_y0zhfj6xdd5n7rn780zz6h001qr7/T/\r\n```\r\nLLNL RHEL6:\r\n```bash\r\n(cab688):~$ env |grep TMP\r\nTMPDIR=/var/tmp/gamblin2\r\nTMP=/var/tmp/gamblin2\r\n```\r\nI'm inclined to stick with a default of whatever the OS / site recommends via `TMPDIR`, since that's what `TMPDIR` is for.  On OS X, `$TMPDIR` is actually more secure than other options b/c it's only accessible to your user.  Of course, I suspect most OS X users are on single-user laptops, so I'm not sure how much that really matters...\r\n\r\nYou can, of course, customize this in `lib/spack/spack/__init__.py`.  That will soon move to a more convenient config file, so hopefully that will make things easier.\r\n\r\nYou can get to the stage directory very easily if you source Spack's `setup-env.sh`:\r\n\r\n```bash\r\n    spack install foo@1.0 %gcc  # ... build fails\r\n    spack cd foo@1.0 %gcc    # go directly to the stage directory for this spec.\r\n```\r\n\r\nWhen the build is successful, the build log is preserved in `$prefix/.spack/build.out`.  So are the build environment (`$prefix/.spack/build.env)` and all `package.py` files and patches used to build the package and its dependencies (`$prefix/.spack/repos`)."}}