{"action":"created","issue":{"url":"https://api.github.com/repos/vim-jp/issues/issues/301","labels_url":"https://api.github.com/repos/vim-jp/issues/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/vim-jp/issues/issues/301/comments","events_url":"https://api.github.com/repos/vim-jp/issues/issues/301/events","html_url":"https://github.com/vim-jp/issues/issues/301","id":10486086,"number":301,"title":"Debian系のLinuxでPython 2.xと3.xが同時利用できない問題の原因と対策","user":{"login":"koron","id":468368,"avatar_url":"https://avatars.githubusercontent.com/u/468368?v=3","gravatar_id":"","url":"https://api.github.com/users/koron","html_url":"https://github.com/koron","followers_url":"https://api.github.com/users/koron/followers","following_url":"https://api.github.com/users/koron/following{/other_user}","gists_url":"https://api.github.com/users/koron/gists{/gist_id}","starred_url":"https://api.github.com/users/koron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koron/subscriptions","organizations_url":"https://api.github.com/users/koron/orgs","repos_url":"https://api.github.com/users/koron/repos","events_url":"https://api.github.com/users/koron/events{/privacy}","received_events_url":"https://api.github.com/users/koron/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vim-jp/issues/labels/kind/discuss","name":"kind/discuss","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/vim-jp/issues/milestones/2","html_url":"https://github.com/vim-jp/issues/milestones/Near%20Future","labels_url":"https://api.github.com/repos/vim-jp/issues/milestones/2/labels","id":40102,"number":2,"title":"Near Future","description":"なるべく早く手をつけたほうが良いんじゃないか、という内容。","creator":{"login":"koron","id":468368,"avatar_url":"https://avatars.githubusercontent.com/u/468368?v=3","gravatar_id":"","url":"https://api.github.com/users/koron","html_url":"https://github.com/koron","followers_url":"https://api.github.com/users/koron/followers","following_url":"https://api.github.com/users/koron/following{/other_user}","gists_url":"https://api.github.com/users/koron/gists{/gist_id}","starred_url":"https://api.github.com/users/koron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koron/subscriptions","organizations_url":"https://api.github.com/users/koron/orgs","repos_url":"https://api.github.com/users/koron/repos","events_url":"https://api.github.com/users/koron/events{/privacy}","received_events_url":"https://api.github.com/users/koron/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":19,"state":"open","created_at":"2011-09-24T12:16:11Z","updated_at":"2015-08-04T20:12:38Z","due_on":null,"closed_at":null},"comments":68,"created_at":"2013-01-31T02:40:58Z","updated_at":"2015-11-03T16:44:49Z","closed_at":null,"body":"Ubuntuを始めDebian系のLinuxでPython 2.xと3.xが同時利用できません。\r\n\r\n直接の原因はPythonがstatic linkで作られるのと同時に.soも提供されているからです。\r\nPythonが利用するモジュールはstatic linkでPythonに繋がるのに、\r\nVimは.soのほうに繋がるのでdlopenにRTLD_GLOBALが設定されてないと、\r\nそれらのモジュールを正しくロードできずに落ちてしまいます。\r\n過去のvim-devの議論によれば「 [落ちるよりは使えないほうがマシ](http://www.mail-archive.com/vim_dev@googlegroups.com/msg10769.html) 」と結論され\r\n現在に至ったようです。\r\n\r\n一番簡単な解決方法は、Pythonと関連モジュール一式を --enable-shared でコンパイルし直すことです。\r\nデメリットは [x86(32ビット)系で遅くなる](https://twitter.com/methane/status/296797638425198592) ことですが、どうやら [64ビットではそのデメリットは無さそう](https://twitter.com/methane/status/296797754187988994) です。\r\n\r\nで本Issueのポイントは以下のとおりです:\r\n\r\n  * このあたりの事情と対策が知られていないことが問題: ちゃんと解説をまとめておきたい\r\n  * Debian方面に --enable-shared するように働きかけられないだろうか検討したい"},"comment":{"url":"https://api.github.com/repos/vim-jp/issues/issues/comments/153411617","html_url":"https://github.com/vim-jp/issues/issues/301#issuecomment-153411617","issue_url":"https://api.github.com/repos/vim-jp/issues/issues/301","id":153411617,"user":{"login":"splhack","id":81904,"avatar_url":"https://avatars.githubusercontent.com/u/81904?v=3","gravatar_id":"","url":"https://api.github.com/users/splhack","html_url":"https://github.com/splhack","followers_url":"https://api.github.com/users/splhack/followers","following_url":"https://api.github.com/users/splhack/following{/other_user}","gists_url":"https://api.github.com/users/splhack/gists{/gist_id}","starred_url":"https://api.github.com/users/splhack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splhack/subscriptions","organizations_url":"https://api.github.com/users/splhack/orgs","repos_url":"https://api.github.com/users/splhack/repos","events_url":"https://api.github.com/users/splhack/events{/privacy}","received_events_url":"https://api.github.com/users/splhack/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T16:44:49Z","updated_at":"2015-11-03T16:44:49Z","body":"ありがとうございます。しかし、考えてみると、どのsoファイルが読み込まれるかわからないのではないかという結論に達しました(dlopenがどのdylibを読むかわからない(DYLD_FRAMEWORK_PATHとか使ってdlopenの挙動を再実装するとか)、dylibが特定できてもどのsoファイルを読みに行くかわからない(いろいろやればできなくもないでしょうけど))。MacVimはconfigureいじって、PY*_NO_RTLD_GLOBAL=0になるようにしてしまいます。"}}