Addded support for ./doc, ./lib files, added (pre|post)Install support.#466
Addded support for ./doc, ./lib files, added (pre|post)Install support.#466Davorak wants to merge 1 commit intoNixOS:masterfrom
Conversation
With this commit ghc-wrappers will add ghc's documentation to
./nix-profile. ${ghc.version} is appended to the default documenation
fold so multiple ghc versions will not clobber each other.
Added support for preInstall and postInstall hooks.
|
Good idea, I miss GHC's docs in my profile. Isn't it better to symlink the directories rather than copy them? IMO they're in closure anyway, so it's a waste of space (until nix-store --optimize). |
|
Yes, thank you for this patch (which should probably go to I, too, think that symlinking the documentation would be better than copying it. |
|
Does changing just the wrapper really affect so many builds? I thought it should only affect environments. If it does, maybe it would be sooner in master if we put this into x-updates. The thing is that stdenv-updates still needs a lot of fixing. This change (maybe) has the only problem that it affects a lot of packages. It might even be useful to have a branch for such changes, like master-stable (rare hash changes) and master-unstable (often hash changes); but maybe it would just complicate things... |
|
ghc-wrapper is used internally to build every Haskell package in Nix, so Generally speaking, I believe that This approach also makes all documentation available in the generated profile. |
|
Hmm, so why don't we make ghcWithPackages the default thing for user envs and add documentation only there... because for internal compilation it's useless anyway, right? |
|
I have wanted to switch The biggest advantage of ghc-wrapper is that it's very simple to use. |
|
OK, so I propose the following to do at the moment: split internal and user-env ghc-wrapper, and modify only the user-env one by this patch to include docs etc. |
|
Yes, that sounds like a good solution. |
|
So in the commit below I create an outer wrapper and system link the documentation and lib folders. This keeps the installation command for ghc the same and prevents needing to rebuild haskell packages. However it seems like there should be a better way of doing outer-wrapper.nix, if you could take a look and offer improvements I would appreciate it. |
|
You cannot change the |
|
I pushed an edited version of your changes in commit 3bf0d2b. Please let me know if there is any trouble. |
The freaky implementation was done that way in order to avoid unnecessary re-builds of all Haskell packages by changing the wrapper script used internally in those builds. See <NixOS/nixpkgs#466> for further details.
With this commit ghc-wrappers will add ghc's documentation to
./nix-profile. ${ghc.version} is appended to the default documenation
folder so multiple ghc versions will not clobber each other.
Added support for preInstall and postInstall hooks.