{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/1569","repository_url":"https://api.github.com/repos/ocaml/ocaml","labels_url":"https://api.github.com/repos/ocaml/ocaml/issues/1569/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/ocaml/issues/1569/comments","events_url":"https://api.github.com/repos/ocaml/ocaml/issues/1569/events","html_url":"https://github.com/ocaml/ocaml/pull/1569","id":288762413,"node_id":"MDExOlB1bGxSZXF1ZXN0MTYzMDczNzIz","number":1569,"title":"Tidy up installation-directory/lib/ocaml ","user":{"login":"sliquister","id":1274961,"node_id":"MDQ6VXNlcjEyNzQ5NjE=","avatar_url":"https://avatars3.githubusercontent.com/u/1274961?v=4","gravatar_id":"","url":"https://api.github.com/users/sliquister","html_url":"https://github.com/sliquister","followers_url":"https://api.github.com/users/sliquister/followers","following_url":"https://api.github.com/users/sliquister/following{/other_user}","gists_url":"https://api.github.com/users/sliquister/gists{/gist_id}","starred_url":"https://api.github.com/users/sliquister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sliquister/subscriptions","organizations_url":"https://api.github.com/users/sliquister/orgs","repos_url":"https://api.github.com/users/sliquister/repos","events_url":"https://api.github.com/users/sliquister/events{/privacy}","received_events_url":"https://api.github.com/users/sliquister/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-01-16T01:58:21Z","updated_at":"2018-07-02T10:30:26Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/1569","html_url":"https://github.com/ocaml/ocaml/pull/1569","diff_url":"https://github.com/ocaml/ocaml/pull/1569.diff","patch_url":"https://github.com/ocaml/ocaml/pull/1569.patch"},"body":"The way most libraries of the compiler distribution are installed right now is by putting all their files in $PREFIX/lib/ocaml, or $PREFIX/lib/ocaml/compiler-libs for the libraries of the compiler (the exceptions being threads, ocamldoc and before camlp4).\r\n\r\nThis is annoying because it's desirable for a build system to prevent a library foo from building against a library bar if foo doesn't declare a dependency on bar (by not putting bar in the search path). And this works great, except when bar is a compiler library like str or unix because they are in the search path and there's nothing the build system can do about it.\r\n\r\nThis results in link time errors instead of \"unbound module\" errors, both with the normal ocaml compilers and with js_of_ocaml, and potentially for a user of the bad library rather than an author of the bad library.\r\n\r\nThe same thing happens with compiler-libs, when declaring a dependency on ocamlcommon and using ocamltoplevel.\r\n\r\nI propose solving this by installing all libraries in their own subdirectory of $PREFIX/lib/ocaml (except stdlib). For backwards compatibility, the search path contains +unix, +str etc by default, which can be turned off with a new flag -nostdincludes which I would use.\r\n\r\nI didn't implement any compatibility for compiler-libs, as code that links with these libs tends to break on every new compiler version anyway.\r\n"},"comment":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/comments/401756399","html_url":"https://github.com/ocaml/ocaml/pull/1569#issuecomment-401756399","issue_url":"https://api.github.com/repos/ocaml/ocaml/issues/1569","id":401756399,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTc1NjM5OQ==","user":{"login":"gasche","id":426238,"node_id":"MDQ6VXNlcjQyNjIzOA==","avatar_url":"https://avatars2.githubusercontent.com/u/426238?v=4","gravatar_id":"","url":"https://api.github.com/users/gasche","html_url":"https://github.com/gasche","followers_url":"https://api.github.com/users/gasche/followers","following_url":"https://api.github.com/users/gasche/following{/other_user}","gists_url":"https://api.github.com/users/gasche/gists{/gist_id}","starred_url":"https://api.github.com/users/gasche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasche/subscriptions","organizations_url":"https://api.github.com/users/gasche/orgs","repos_url":"https://api.github.com/users/gasche/repos","events_url":"https://api.github.com/users/gasche/events{/privacy}","received_events_url":"https://api.github.com/users/gasche/received_events","type":"User","site_admin":false},"created_at":"2018-07-02T10:30:26Z","updated_at":"2018-07-02T10:30:26Z","author_association":"MEMBER","body":"> Could you explain why it doesn't seem satisfactory to you?\r\n\r\nI'm not saying it is not satisfactory, but I still get goosebumps thinking about compatibility, so I would like to get it tested.\r\n\r\n(Maybe once the Menhir thing has settled it would be time to get back to our project of merging the best parts of Fabrice and Damien's scripts to get an opam-checker for normal people.)"}}
{"actor":{"display_login":"gasche"}}