{"action":"opened","issue":{"url":"https://api.github.com/repos/ocaml/opam/issues/2374","labels_url":"https://api.github.com/repos/ocaml/opam/issues/2374/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/opam/issues/2374/comments","events_url":"https://api.github.com/repos/ocaml/opam/issues/2374/events","html_url":"https://github.com/ocaml/opam/issues/2374","id":120236340,"number":2374,"title":"`opam pin add .` doesn't preserve symlinks","user":{"login":"jvillard","id":1083541,"avatar_url":"https://avatars.githubusercontent.com/u/1083541?v=3","gravatar_id":"","url":"https://api.github.com/users/jvillard","html_url":"https://github.com/jvillard","followers_url":"https://api.github.com/users/jvillard/followers","following_url":"https://api.github.com/users/jvillard/following{/other_user}","gists_url":"https://api.github.com/users/jvillard/gists{/gist_id}","starred_url":"https://api.github.com/users/jvillard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvillard/subscriptions","organizations_url":"https://api.github.com/users/jvillard/orgs","repos_url":"https://api.github.com/users/jvillard/repos","events_url":"https://api.github.com/users/jvillard/events{/privacy}","received_events_url":"https://api.github.com/users/jvillard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-03T18:20:06Z","updated_at":"2015-12-03T18:20:06Z","closed_at":null,"body":"Some of the executables in [this repository](https://github.com/facebook/infer) are python scripts that rely on being symlinked to the location where a specific python module lives. The structure looks like this:\r\n\r\n```\r\nbin/infer -> ../lib/python/infer\r\nlib/python/infer\r\nlib/python/inferlib/\r\n```\r\n\r\nand infer imports the inferlib module.\r\n\r\nAfter `opam pin add .`, however, `.opam/4.02.2/build/.../bin/infer` is a regular file and thus running `infer` crashes as it cannot find the inferlib python module.\r\n\r\nYou can reproduce the problem by running:\r\n```sh\r\ngit clone https://github.com/facebook/infer\r\ncd infer/\r\nopam pin add .\r\n```\r\n\r\nThe compilation error is then:\r\n```\r\n### stderr ###\r\n# Traceback (most recent call last):\r\n#   File \"/home/jul/.opam/4.02.2/build/infer.0.4.0/infer/bin/infer\", line 12, in <module>\r\n#     from inferlib import analyze, config, utils\r\n# ImportError: cannot import name analyze\r\n```\r\n\r\nWould it be possible for opam to preserve these symlinks?"}}