{"action":"created","issue":{"url":"https://api.github.com/repos/LLNL/spack/issues/869","repository_url":"https://api.github.com/repos/LLNL/spack","labels_url":"https://api.github.com/repos/LLNL/spack/issues/869/labels{/name}","comments_url":"https://api.github.com/repos/LLNL/spack/issues/869/comments","events_url":"https://api.github.com/repos/LLNL/spack/issues/869/events","html_url":"https://github.com/LLNL/spack/pull/869","id":151953052,"number":869,"title":"Feature/views","user":{"login":"brettviren","id":209537,"avatar_url":"https://avatars.githubusercontent.com/u/209537?v=3","gravatar_id":"","url":"https://api.github.com/users/brettviren","html_url":"https://github.com/brettviren","followers_url":"https://api.github.com/users/brettviren/followers","following_url":"https://api.github.com/users/brettviren/following{/other_user}","gists_url":"https://api.github.com/users/brettviren/gists{/gist_id}","starred_url":"https://api.github.com/users/brettviren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettviren/subscriptions","organizations_url":"https://api.github.com/users/brettviren/orgs","repos_url":"https://api.github.com/users/brettviren/repos","events_url":"https://api.github.com/users/brettviren/events{/privacy}","received_events_url":"https://api.github.com/users/brettviren/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-04-29T19:43:04Z","updated_at":"2016-05-06T00:32:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/LLNL/spack/pulls/869","html_url":"https://github.com/LLNL/spack/pull/869","diff_url":"https://github.com/LLNL/spack/pull/869.diff","patch_url":"https://github.com/LLNL/spack/pull/869.patch"},"body":"This PR provides a new Spack command called `view`.  A view is a directory hierarchy which is a union of directory hierarchies under the prefixes of all specs on which the view is based.  The installed files under the prefixes are symlinked into their corresponding locations in the view.\r\n\r\nThe `view` command provides actions driven by the concrete Spack DAG created from the given package specs.  Actions include linking in a set of packages, removing them or checking status.  By default the entire DAG is used but the `view` command can be limited by the user specifying to only consider the packages give or to explicitly exclude some packages.\r\n\r\nThe single-rooted view is then useful for providing easy environment setup for users and developers working outside of Spack.  Eg, only a single and easily located `bin/` directory need be added to `PATH`.\r\n\r\nA session giving trivial example:\r\n\r\n```bash\r\n$ spack install libelf\r\n\r\n$ spack view -p myview libelf\r\n==> link libelf\r\n\r\n$ ls -l myview/\r\ntotal 12\r\ndrwxrwxr-x 3 bviren bviren 4096 Apr 29 15:37 include\r\ndrwxrwxr-x 3 bviren bviren 4096 Apr 29 15:37 lib\r\ndrwxrwxr-x 3 bviren bviren 4096 Apr 29 15:37 share\r\n\r\n$ ls -l myview/include/libelf/libelf.h \r\nlrwxrwxrwx 1 bviren bviren 157 Apr 29 15:33 myview/include/libelf/libelf.h -> /home/bviren/projects/wire-cell/wire-cell-spack/spack/opt/spack/linux-x86_64/gcc-5.3.1/libelf-0.8.13-rdd4vrfzoey4wqxzqmkb6riuhon7y62f/include/libelf/libelf.h\r\n\r\n$ spack view -p myview -a status libelf\r\n==> status libelf\r\n==> Package added: libelf\r\n\r\n$ spack view -p myview -a remove libelf\r\n==> remove libelf\r\n\r\n$ spack view -p myview -a status libelf\r\n==> status libelf\r\n==> Package missing: libelf\r\n\r\n$ spack view -h\r\nusage: spack view [-h] [-e EXCLUDE] [-a {link,remove,status}]\r\n                  [--no-dependencies] -p PREFIX\r\n                  ...\r\n\r\npositional arguments:\r\n  specs                 specs of packages to expose in the view.\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -e EXCLUDE, --exclude EXCLUDE\r\n                        exclude any packages which the given re pattern\r\n  -a {link,remove,status}, --action {link,remove,status}\r\n                        what action to perform on the view\r\n  --no-dependencies     just operate on named packages and do not follow\r\n                        dependencies\r\n  -p PREFIX, --prefix PREFIX\r\n                        Path to a top-level directory to receive the view.\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/LLNL/spack/issues/comments/217318004","html_url":"https://github.com/LLNL/spack/pull/869#issuecomment-217318004","issue_url":"https://api.github.com/repos/LLNL/spack/issues/869","id":217318004,"user":{"login":"brettviren","id":209537,"avatar_url":"https://avatars.githubusercontent.com/u/209537?v=3","gravatar_id":"","url":"https://api.github.com/users/brettviren","html_url":"https://github.com/brettviren","followers_url":"https://api.github.com/users/brettviren/followers","following_url":"https://api.github.com/users/brettviren/following{/other_user}","gists_url":"https://api.github.com/users/brettviren/gists{/gist_id}","starred_url":"https://api.github.com/users/brettviren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettviren/subscriptions","organizations_url":"https://api.github.com/users/brettviren/orgs","repos_url":"https://api.github.com/users/brettviren/repos","events_url":"https://api.github.com/users/brettviren/events{/privacy}","received_events_url":"https://api.github.com/users/brettviren/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T00:32:11Z","updated_at":"2016-05-06T00:32:11Z","body":"> My point with PR #543 is that you probably shouldn't want the single tree for building other software. So then what will you want it for? I think the use cases are limited.\r\n\r\nBut, this is exactly what I do want.  When I develop software I absolutely do **not** want its native build mechanism to depend on Spack.  I also want to simplify my development environment in terms of telling my native build system where to find my software's dependencies.  \r\n\r\nI've already started enjoying to use `spack view`:\r\n\r\nhttps://github.com/wirecell/wire-cell-spack#using-spack-views\r\n\r\n(note, that readme has gotten slightly out of sync with the \"view\" code after trying to satisfy @trws's comments)"}}