[MacPorts] #65899: ghc @9.4.2_1: destroot does not use the right compiler

MacPorts noreply at macports.org
Sun Sep 25 02:16:59 UTC 2022

#65899: ghc @9.4.2_1: destroot does not use the right compiler
 Reporter:  larryv  |      Owner:  essandess
     Type:  defect  |     Status:  assigned
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  ghc
 The destroot phase runs a configure script (???) but allows it to use the
 default `gcc` instead of forcing it to [UsingTheRightCompiler use the
 right compiler].  This fails for me because my MacPorts installation is
 [UsingTheRightCompiler#testing set up to catch it], but I expect it
 "succeeds" for most users.

 - `main.log` excerpt:
 :info:destroot Command line: sh configure
 :info:destroot ===> Command failed with error code: 77
 :info:destroot configure: error: in
 :info:destroot configure: error: C compiler cannot create executables
 :info:destroot See `config.log' for more details
 - `work/ghc-9.4.2/_build/bindist/ghc-9.4.2-x86_64-apple-darwin/config.log`
 configure:4465: checking for gcc
 configure:4486: found /opt/local/libexec/no_default_gcc/gcc
 configure:4497: result: gcc
 configure:4528: checking for C compiler version
 configure:4537: gcc --version >&5
 gcc --version
 gcc: Error: You should be using ${configure.cc}
 See https://trac.macports.org/wiki/UsingTheRightCompiler
 configure:4548: $? = 1

 The following change does force the right compiler to be found, but the
 `ghc` port is so complex that I don't know whether it is correct, let
 alone the best possible fix.
 diff --git a/lang/ghc/Portfile b/lang/ghc/Portfile
 index 8f3ca39313b..56593c87cc7 100644
 --- a/lang/ghc/Portfile
 +++ b/lang/ghc/Portfile
 @@ -103,6 +103,8 @@ if {${name} eq ${subport}} {
      build.post_args [haskell_cabal.build_getjobsarg]

 +    destroot.env    CC=${configure.cc} \
 +                    CXX=${configure.cxx}
      destroot.cmd    hadrian
      destroot.target install
      destroot.pre_args \

Ticket URL: <https://trac.macports.org/ticket/65899>
MacPorts <https://www.macports.org/>
Ports system for macOS

More information about the macports-tickets mailing list