lang/ghc fails to install with: ===> Registering installation for ghc-7.10.2 pkg-static: Unable to access file /tmp/usr/ports/lang/ghc/work/stage/usr/local/bin/haddock-ghc-7.10.2: No such file or directory *** Error code 74 Portoptions are as follows: ===> The following configuration options are available for ghc-7.10.2: DOCS=off: Install HTML documentation DYNAMIC=on: Add support for dynamic linking LLVM=off: Add support for generating code via LLVM PROFILE=on: Add support for performance profiling ====> Options available for the single C_Compiler: you have to select exactly one of them GCC=on: Build with GCC (from ports) PCLANG=off: Build with Clang from ports BCLANG=off: Build with Clang from base ===> Use 'make config' to modify these settings
I can reproduce this. It looks like it happens when the DOCS knob is off.
I have a half-baked solution for the problem. Unfortunately, it is deeper than it looks at the first sight. We wanted to maintain the possibility that Haddock could be installed as a port when it was not installed along GHC -- but it is not going to work properly for some reason, unfortunately I do not remember the exact ones. Anyway, I will try not to solve all the entire problem together, just take care of this annoyance.
*** Bug 207658 has been marked as a duplicate of this bug. ***
This happens to me too. GHC fails in the package phase when the DOCS options is turned off. This is in a Poudriere FreeBSD 10.3/amd64 jail. See http://paste2.org/FIstBsV1 for the whole build log in case it helps. With DOCS=on the build finishes again.
Created attachment 185013 [details] lang/ghc: Unbreak packaging with DOCS=off I'm using the attached patch on ElectroBSD. This fix was tested by building textproc/hs-pandoc and it's dependencies with poudriere using the 2017Q3 branch with a global DOCS=off. Due to the post-install target the @exec and @unexec lines in the pkg-plist could probably be removed completely, but I haven't tested this. I'm not sure if this is the "half-baked solution" Gabor was referring to in #c2 but (probably like most people building lang/ghc) I only build it as a dependency for other Haskell ports and AFAICT the ones I'm using don't need haddock.
That is about the interaction with the devel/hs-haddock port. Even if you did not install lang/ghc with Haddock, there is a symlink-based solution for being able to add Haddock later by the devel/hs-haddock port. Once you delete the hs-haddock package the link to the original Haddock binary should be restored, but only if lang/ghc was installed with Haddock support. So that is why the solution is not that straightforward. I am hoping to resolve this issue as part of the upcoming update to lang/ghc [1]. Currently it looks like using the following lines in the pkg-plist file of devel/hs-haddock can do the trick, in addition to the change to lang/ghc you have suggested: ~~~~ @postexec /bin/ln -sf %%EXECUTABLE%% %%HADDOCK%% @postunexec [ -f %%GHC_HADDOCK_CMD%% ] && /bin/ln -sf %%GHC_HADDOCK_CMD%% %%HADDOCK%% || rm -f %%HADDOCK%% ~~~~ [1] https://reviews.freebsd.org/D11558
The port builds fine with DOCS=off currently, so I presume @pgj committed a proper fix for the issue. But I'd wait for his feedback.
Well, let's close this.
See comment7 and 8. Close here - fixed.