{"action":"reopened","issue":{"url":"https://api.github.com/repos/NixOS/nix/issues/849","repository_url":"https://api.github.com/repos/NixOS/nix","labels_url":"https://api.github.com/repos/NixOS/nix/issues/849/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nix/issues/849/comments","events_url":"https://api.github.com/repos/NixOS/nix/issues/849/events","html_url":"https://github.com/NixOS/nix/issues/849","id":140669755,"number":849,"title":"nix-shell concurrency issue symlinking nixpkgs tarballs","user":{"login":"gilligan","id":27668,"avatar_url":"https://avatars.githubusercontent.com/u/27668?v=3","gravatar_id":"","url":"https://api.github.com/users/gilligan","html_url":"https://github.com/gilligan","followers_url":"https://api.github.com/users/gilligan/followers","following_url":"https://api.github.com/users/gilligan/following{/other_user}","gists_url":"https://api.github.com/users/gilligan/gists{/gist_id}","starred_url":"https://api.github.com/users/gilligan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilligan/subscriptions","organizations_url":"https://api.github.com/users/gilligan/orgs","repos_url":"https://api.github.com/users/gilligan/repos","events_url":"https://api.github.com/users/gilligan/events{/privacy}","received_events_url":"https://api.github.com/users/gilligan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-03-14T13:13:26Z","updated_at":"2016-07-11T07:01:53Z","closed_at":null,"body":"Given the following default.nix:\r\n\r\n```nix\r\nwith import (builtins.fetchTarball \"https://github.com/NixOS/nixpkgs/tarball/27af419541a50c33d2bf0762c8740552794e5b1a\") {}; {\r\n  test = stdenv.mkDerivation {\r\n    name = \"test\";\r\n  };\r\n}\r\n```\r\n\r\nInvoking : `$ nix-shell & nix-shell` will fail with:\r\n```\r\nerror: creating symlink from ‘/Users/tpflug/.cache/nix/tarballs/.new_mm46xaz0wdh58q4smch92sw1r3q6gqys-27af419541a50c33d2bf0762c8740552794e5b1a-unpacked’ to ‘/nix/store/grx24c2nc5\r\n8a8gr4s7jq0a7rr8nn4zs6-27af419541a50c33d2bf0762c8740552794e5b1a’: File exists\r\n```\r\n\r\nThis happens since both nix-shells try to symlink the tarball not expecting that it might already be there. A possible fix would be to just use a symlink if it already exists with the expected name. \r\n\r\nObviously you would not start two nix-shells like in this minimal test case but for me it happens in a setup where some `nix-shell --command` are being executed in parallel. \r\n\r\nWould there be any reason to *not* use an expected symlink if it is already there ?"}}
{"actor":{"display_login":"gilligan"}}