{"action":"created","issue":{"url":"https://api.github.com/repos/copumpkin/nixpkgs/issues/51","labels_url":"https://api.github.com/repos/copumpkin/nixpkgs/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/copumpkin/nixpkgs/issues/51/comments","events_url":"https://api.github.com/repos/copumpkin/nixpkgs/issues/51/events","html_url":"https://github.com/copumpkin/nixpkgs/issues/51","id":57135529,"number":51,"title":"A pretty deep/annoying problem with multiple versions of the same thing","user":{"login":"copumpkin","id":2623,"avatar_url":"https://avatars.githubusercontent.com/u/2623?v=3","gravatar_id":"","url":"https://api.github.com/users/copumpkin","html_url":"https://github.com/copumpkin","followers_url":"https://api.github.com/users/copumpkin/followers","following_url":"https://api.github.com/users/copumpkin/following{/other_user}","gists_url":"https://api.github.com/users/copumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/copumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copumpkin/subscriptions","organizations_url":"https://api.github.com/users/copumpkin/orgs","repos_url":"https://api.github.com/users/copumpkin/repos","events_url":"https://api.github.com/users/copumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/copumpkin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-02-10T06:18:33Z","updated_at":"2015-02-10T17:19:40Z","closed_at":null,"body":"This one is going to take ingenuity. I've spotted evidence of it in various places so far, but the most recent is in libu2f-host. If you `echo foo | u2f-host -osendrecv`, you'll get an obscure segfault in `objc_msgSend` coming from a call to some CF functions from IOKit, which `libu2f-host` uses to talk to the HID device (it's a library for talking to a yubikey token).\r\n\r\nThe issue is that the final library is linking both against our own CF library (which maintains some global state of some sort that I haven't looked into yet), and via the impure IOKit, to the systemwide CF. Somehow the global state of the two CFs interferes somehow, and causes the resulting program to crash. If I relink the generated executable (and its library dependencies) to only the systemwide CF, everything works fine.\r\n\r\nI can think of three approaches to this problem:\r\n- We make the whole stdenv less pure and link to systemwide CF, its transitive dependencies, and in general, try to do more of that, at least for libraries with global state like that.\r\n- We figure out how the global state works, then see if there are ways we can make this less of a problem\r\n- We try to develop a broader solution to this sort of problem in nix: although this particular instance is due to CF and impurities, the problem is simply one of linking against two incompatible versions of the same library. If in linuxland, I had libfoo that needed libbar-3.5, and my program linked against libfoo as well as libbar-4.1, and libbar cared enough, I'd have similar issues. Ideally, we'd have a nixpkgs-native way to reason about such situations and force sets of packages to rebuild with consistent dependencies, without causing everything else to have to suffer as a result. Is there such a mechanism?\r\n\r\nAny thoughts/advice, @shlevy, @gridaphobe, @joelteon, @jwiegley?"},"comment":{"url":"https://api.github.com/repos/copumpkin/nixpkgs/issues/comments/73741448","html_url":"https://github.com/copumpkin/nixpkgs/issues/51#issuecomment-73741448","issue_url":"https://api.github.com/repos/copumpkin/nixpkgs/issues/51","id":73741448,"user":{"login":"copumpkin","id":2623,"avatar_url":"https://avatars.githubusercontent.com/u/2623?v=3","gravatar_id":"","url":"https://api.github.com/users/copumpkin","html_url":"https://github.com/copumpkin","followers_url":"https://api.github.com/users/copumpkin/followers","following_url":"https://api.github.com/users/copumpkin/following{/other_user}","gists_url":"https://api.github.com/users/copumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/copumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copumpkin/subscriptions","organizations_url":"https://api.github.com/users/copumpkin/orgs","repos_url":"https://api.github.com/users/copumpkin/repos","events_url":"https://api.github.com/users/copumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/copumpkin/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T17:19:40Z","updated_at":"2015-02-10T17:19:40Z","body":"Interesting! Have more details? Which FAQ is that?"}}