This is what happens: root@packager /usr/ports/lang/ghc # make [...] ===> Configuring for ghc-8.8.3_1 cp -f /usr/ports/lang/ghc/work/build.mk /usr/ports/lang/ghc/work/ghc-8.8.3/mk/build.mk configure: loading site script /usr/ports/Templates/config.site [...] checking for ghc... /usr/local/bin/ghc checking version of ghc... unknown configure: error: Cannot determine the version of /usr/local/bin/ghc. Is it really GHC? ===> Script "configure" failed unexpectedly. [...] *** Error code 1 Stop. make: stopped in /usr/ports/lang/ghc I detected that GHC=/usr/local/bin/ghc is added to the ./configure arguments list. Then I gave up. I removed the port and package because a previous build failed and I wanted to finish all other updates before solving this problem.
Please, show output of # make showconfig
Aarrrgh! It says: ====> Bootsrap using installed ghc BOOT=on: Use installed GHC for bootstrapping In this case, the bug is that the option does not read "Use installed GHC _if_ _installed_." Or at least a message should be shown that the option was turned on. The build is currently running and I'm optimistic. Thanks so far.
Well, I find it obvious that you can't install GHC while you are building it.
Then, why does the port try to do that and afterwards wants to make me believe it was my mistake?
The port tries to use installed GHC, just as option's description says. It fails, because you did not provide GHC. It doesn't say that it will try to obtain GHC for you in some magic way.
> The port tries to use installed GHC, just as option's description says. It > fails, because you did not provide GHC. It doesn't say that it will try to > obtain GHC for you in some magic way. The port detects that ghc is not installed. It would be no more than one line of code to inform the user that this clashes with the option that was selected. There is no need to obtain it in this situation. I cannot remember all 2k options I selected in any port since I first installed FreeBSD. We have machines to do the things that we're not capable of, and we have machines to do the things that are obvious and that are repetitive. This behaviour is definitely a bug.
Makes sense. Would following change be helpful? Index: lang/ghc/Makefile =================================================================== --- lang/ghc/Makefile (revision 536651) +++ lang/ghc/Makefile (working copy) @@ -254,6 +254,11 @@ .if empty(PORT_OPTIONS:MBOOT) cd ${BOOT_DIR} && ${CONFIGURE_ENV} ${CONFIGURE_CMD} --prefix=${BOOT_DIR} cd ${BOOT_DIR} && PACKAGES='' ${MAKE_CMD} install +.else +# otherwise, make sure we have "ghc" in PATH + if ! ${WHICH} -s ghc ; then \ + echo "No 'ghc' executable is found in your PATH! Turn off BOOT option." ; false ; \ + fi .endif # If DOCS are set, install HsColour in-place .if ${PORT_OPTIONS:MDOCS}
Works fine. Thanks!
A commit references this bug: Author: arrowd Date: Thu May 28 12:58:56 UTC 2020 New revision: 536766 URL: https://svnweb.freebsd.org/changeset/ports/536766 Log: lang/ghc: Print a error message if BOOT option is enabled, but the user has no "ghc" in PATH. PR: 246800 Submitted by: software@bertram-scharpf.de Changes: head/lang/ghc/Makefile
Thanks for bringing this up.