{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/cabal/issues/3982","repository_url":"https://api.github.com/repos/haskell/cabal","labels_url":"https://api.github.com/repos/haskell/cabal/issues/3982/labels{/name}","comments_url":"https://api.github.com/repos/haskell/cabal/issues/3982/comments","events_url":"https://api.github.com/repos/haskell/cabal/issues/3982/events","html_url":"https://github.com/haskell/cabal/pull/3982","id":183038857,"number":3982,"title":"Store interfaces files separately from library object files ","user":{"login":"christiaanb","id":93169,"avatar_url":"https://avatars.githubusercontent.com/u/93169?v=3","gravatar_id":"","url":"https://api.github.com/users/christiaanb","html_url":"https://github.com/christiaanb","followers_url":"https://api.github.com/users/christiaanb/followers","following_url":"https://api.github.com/users/christiaanb/following{/other_user}","gists_url":"https://api.github.com/users/christiaanb/gists{/gist_id}","starred_url":"https://api.github.com/users/christiaanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christiaanb/subscriptions","organizations_url":"https://api.github.com/users/christiaanb/orgs","repos_url":"https://api.github.com/users/christiaanb/repos","events_url":"https://api.github.com/users/christiaanb/events{/privacy}","received_events_url":"https://api.github.com/users/christiaanb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-10-14T12:34:37Z","updated_at":"2016-10-16T11:32:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/haskell/cabal/pulls/3982","html_url":"https://github.com/haskell/cabal/pull/3982","diff_url":"https://github.com/haskell/cabal/pull/3982.diff","patch_url":"https://github.com/haskell/cabal/pull/3982.patch"},"body":"These two flags indicate where the two distinct aspects of a\r\nHaskell library end up.\r\n\r\n--commonlibdir: The subdirectory of --libdir where the object\r\n                library files (.so/.a/.dll/.dylib) get installed.\r\n--hidir:        The directory where the interface files (.hi)\r\n                get installed.\r\n\r\nThe reason we want to do this is because we want dynamic libraries\r\nto all end up in a shared directory to reduce start-up times of\r\nthe run-time linker. However, we still want the .hi to end up\r\nin one directory per package.\r\n\r\nWe cannot repurpose --libsubdir to take over the role of what\r\n--commonlibdir is doing because then we would run into trouble\r\nwith Setup.hs files build against an older Cabal. If we were\r\nto repurpose --libsubdir, then all the object and interface\r\nfiles would end up in a single shared directory for all\r\npackages when using an older Cabal.\r\n\r\nAfter several attempts (#3955,#3968,#3979), this should be the definitive solution for: https://ghc.haskell.org/trac/ghc/ticket/12479"},"comment":{"url":"https://api.github.com/repos/haskell/cabal/issues/comments/254041569","html_url":"https://github.com/haskell/cabal/pull/3982#issuecomment-254041569","issue_url":"https://api.github.com/repos/haskell/cabal/issues/3982","id":254041569,"user":{"login":"dcoutts","id":1339423,"avatar_url":"https://avatars.githubusercontent.com/u/1339423?v=3","gravatar_id":"","url":"https://api.github.com/users/dcoutts","html_url":"https://github.com/dcoutts","followers_url":"https://api.github.com/users/dcoutts/followers","following_url":"https://api.github.com/users/dcoutts/following{/other_user}","gists_url":"https://api.github.com/users/dcoutts/gists{/gist_id}","starred_url":"https://api.github.com/users/dcoutts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcoutts/subscriptions","organizations_url":"https://api.github.com/users/dcoutts/orgs","repos_url":"https://api.github.com/users/dcoutts/repos","events_url":"https://api.github.com/users/dcoutts/events{/privacy}","received_events_url":"https://api.github.com/users/dcoutts/received_events","type":"User","site_admin":false},"created_at":"2016-10-16T11:32:42Z","updated_at":"2016-10-16T11:32:42Z","body":"This is to help me understand...\r\n\r\nSo the original layout scheme was:\r\n```\r\nlibdir=$prefix/lib\r\nlibsubdir=$abi/$libname\r\nincludedir=$libdir/$libsubdir/include\r\n```\r\nThe .hi files and the .a .so .dll .dynlib files all get installed under `$libdir/$libsubdir`.\r\n\r\nThe `$abi` is like `x86_64-linux-ghc-7.10.1`, while the `$libname` is things like `tar-0.4.2.1-3r9cNWLCzNmJa5oTzjaqTP`.\r\n\r\nNote that the libname is the package id plus a hash that is unique locally to a linked app/lib. The hash includes the names and versions of all deps, but no more. It is not a nix hash including sources and configuration.\r\n\r\nThe layout proposed in this patch (and please correct me if I'm wrong) is:\r\n```\r\nlibdir=$prefix/lib\r\nlibsubdir=$abi/$libname\r\ncommonlibdir=$abi\r\nhidir=$libname\r\nincludedir=$hidir/include\r\n```\r\nThe .hi files get installed under `$hidir`. The .a .so .dll .dynlib files all get installed under `$libdir/$commonlibdir`.\r\n\r\nSo this introduces both `commonlibdir` and `hidir` and changes the default location for both .hi files and .a .so .dll .dynlib files. The .hi files move from `$prefix/lib/$abi/$libname` to `$prefix/lib/$libname`, ie dropping the `$abi` (it's not clear if this is intentional). The .a .so .dll .dynlib files move from `$prefix/lib/$abi/$libname` to `$prefix/lib/$abi`, i.e. dropping the `$libname` (which is the original motivation of the patch). The `$libsubdir` and `--libsubdir` remains but they are now not used for anything at all.\r\n\r\nSo a few things I'm concerned about:\r\n\r\n * I'm still not clear why we should introduce a new `$commonlibdir` and leave `$libsubdir` unused.\r\n * The hidir should be *explicitly* relative to something like `$libdir`, not implicitly. The tradition (going back to classic gnu `./configure`) is that the default for all these variables are relative to each other, and ultimately relative to `$prefix`. The only reason we have `$libsubdir` is as a hack because distros are used to using `--libdir=/usr/lib` and we needed a way to implicitly re-interpret that. But we don't need to do that for any other new vars, so we can use the normal explicitly-relative default scheme.\r\n * We still don't have any way to control the location of dynamic libs vs static libs. The scheme we want (I think) still places the static libs in the versioned dirs. This is relevant because we do not currently (afaik) use the `$libname` hash in the names of the static libs."}}
{"actor":{"display_login":"dcoutts"}}