{"action":"created","issue":{"url":"https://api.github.com/repos/LLNL/spack/issues/2229","repository_url":"https://api.github.com/repos/LLNL/spack","labels_url":"https://api.github.com/repos/LLNL/spack/issues/2229/labels{/name}","comments_url":"https://api.github.com/repos/LLNL/spack/issues/2229/comments","events_url":"https://api.github.com/repos/LLNL/spack/issues/2229/events","html_url":"https://github.com/LLNL/spack/issues/2229","id":187032917,"number":2229,"title":"Inconsistent Specs for the Same Package","user":{"login":"citibeth","id":1924215,"avatar_url":"https://avatars.githubusercontent.com/u/1924215?v=3","gravatar_id":"","url":"https://api.github.com/users/citibeth","html_url":"https://github.com/citibeth","followers_url":"https://api.github.com/users/citibeth/followers","following_url":"https://api.github.com/users/citibeth/following{/other_user}","gists_url":"https://api.github.com/users/citibeth/gists{/gist_id}","starred_url":"https://api.github.com/users/citibeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citibeth/subscriptions","organizations_url":"https://api.github.com/users/citibeth/orgs","repos_url":"https://api.github.com/users/citibeth/repos","events_url":"https://api.github.com/users/citibeth/events{/privacy}","received_events_url":"https://api.github.com/users/citibeth/received_events","type":"User","site_admin":false},"labels":[{"id":73908754,"url":"https://api.github.com/repos/LLNL/spack/labels/bug","name":"bug","color":"fc2929","default":true},{"id":446623646,"url":"https://api.github.com/repos/LLNL/spack/labels/concretization","name":"concretization","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-11-03T11:19:47Z","updated_at":"2016-11-03T17:47:19Z","closed_at":null,"body":"@tgamblin @alalazo @adamjstewart \r\n\r\nI've had some problems with the same package being installed twice under different hashcodes, even though NOTHING relevant changed.  Certain packages seem to be \"hot spots\" for this behavior; for example, `py-numpy` in my case.  See:\r\n\r\n```\r\n$ ls -ltd py-numpy-*\r\ndrwxr-xr-x. 5 rpfische rpfische 4096 Nov  2 20:48 py-numpy-1.11.1-4x5i7jdcohqmmygrihehgstdrwhrh5xy\r\ndrwxr-xr-x. 5 rpfische rpfische 4096 Oct 12 14:59 py-numpy-1.11.1-gvcr5ncrxern5m7g67q5r5d3p3odbkq5\r\ndrwxr-xr-x. 5 rpfische rpfische 4096 Oct  6 13:31 py-numpy-1.11.1-5fjabod6muxily63zp3qjdczj6v3yowg\r\n```\r\nThe last change to my Spack was Oct 6, so why does it keep re-installing?  Let's look at the `.spack/spec.yaml` for each of them:\r\n\r\n[spec-4x5i7jdcohqmmygrihehgstdrwhrh5xy.yaml.txt](https://github.com/LLNL/spack/files/568735/spec-4x5i7jdcohqmmygrihehgstdrwhrh5xy.yaml.txt)\r\n[spec-gvcr5ncrxern5m7g67q5r5d3p3odbkq5.yaml.txt](https://github.com/LLNL/spack/files/568734/spec-gvcr5ncrxern5m7g67q5r5d3p3odbkq5.yaml.txt)\r\n[spec-5fjabod6muxily63zp3qjdczj6v3yowg.yaml.txt](https://github.com/LLNL/spack/files/568736/spec-5fjabod6muxily63zp3qjdczj6v3yowg.yaml.txt)\r\n\r\nLet's compare the most recent two (again, no relevant changes to my Spack in that time).  First of all, a quick look at `spec-gvc...` looks wrong, what is this `&id001` stuff?\r\n```\r\nspec:\r\n- py-numpy:\r\n    version: 1.11.1\r\n    compiler:\r\n      name: gcc\r\n      version: 4.9.3\r\n    namespace: builtin\r\n    parameters:\r\n      blas: true\r\n      lapack: true\r\n      cflags: &id001 []\r\n      cppflags: &id002 []\r\n      cxxflags: &id003 []\r\n      fflags: &id004 []\r\n      ldflags: &id005 []\r\n      ldlibs: &id006 []\r\n```\r\n\r\nSecond... the dependencies listed in these files are different, even though `py-numpy/packages.yaml` never changed!  For example, `spec-gv..` has `py-nose`, but `spec-5f..` does not.\r\n\r\nIn my work, from time to time I install the same package from different top-level `spack install` commands.  For example, both `spack setup icebin` and `spack install env-modele` ( https://github.com/citibeth/spack/blob/efischer/develop/var/spack/repos/builtin/packages/env-modele/package.py ) will result in `py-numpy` being installed.  But Spack is apparently installing them under different hash codes (this would be easier to prove directly with #2224).\r\n\r\nMy best guess about what's going on here... when I say `spack spec`, I get a tree in which every package is listed *exactly once*.  We all know that dependencies form a DAG, not a tree --- where a single dependency can appear along multiple paths from the root.  Spack converts the DAG to tree in an arbitrary way.  The result is that the set of dependencies for the same package will look different in the tree, depending on whether some of its dependencies were \"stolen\" by other packages elsewhere in the same tree.  Thus, the apparent dependencies of a package will differ depending on the top-level package in the DAG.\r\n\r\nIt had been my implicit assumption that Spack operated on a DAG, and was just showing it as a tree as a matter of practical convenience for the user when displying `spack spec`.  But... it appears that this tree, no the full DAG, is *actually* what's used in `spec.yaml` and in computing hashes.  That is *clearly* buggy behavior, and would explain a lot of the \"mysterious\" re-installs we've been experiencing.\r\n\r\nThis bug should be fixed; relying on already-installed packages, as oft-talked about, will likely not fix this bug.  If we have #2224, then I believe I could prepare a pair of `spack spec` statements that produce a different hash for the same package, thus nailing down an easy test case.  But even without #2224, I'm fairly confident I've figured out the root cause of this mysterious behavior.\r\n\r\n[For the record... I do all my install commands with \"clean\" command lines, i.e. no `^xxx` stuff.  See enclosed `packages.yaml` that controls the versions and variants of things that get installed: \r\n[packages.yaml.txt](https://github.com/LLNL/spack/files/568753/packages.yaml.txt) ]\r\n"},"comment":{"url":"https://api.github.com/repos/LLNL/spack/issues/comments/258220250","html_url":"https://github.com/LLNL/spack/issues/2229#issuecomment-258220250","issue_url":"https://api.github.com/repos/LLNL/spack/issues/2229","id":258220250,"user":{"login":"alalazo","id":4199709,"avatar_url":"https://avatars.githubusercontent.com/u/4199709?v=3","gravatar_id":"","url":"https://api.github.com/users/alalazo","html_url":"https://github.com/alalazo","followers_url":"https://api.github.com/users/alalazo/followers","following_url":"https://api.github.com/users/alalazo/following{/other_user}","gists_url":"https://api.github.com/users/alalazo/gists{/gist_id}","starred_url":"https://api.github.com/users/alalazo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alalazo/subscriptions","organizations_url":"https://api.github.com/users/alalazo/orgs","repos_url":"https://api.github.com/users/alalazo/repos","events_url":"https://api.github.com/users/alalazo/events{/privacy}","received_events_url":"https://api.github.com/users/alalazo/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T17:47:19Z","updated_at":"2016-11-03T17:47:19Z","body":"Have you tried to use the `fake` option of `install`?"}}
{"actor":{"display_login":"alalazo"}}