Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#65899 closed defect (fixed)

ghc @9.4.2_1: destroot does not use the right compiler

Reported by: larryv (Lawrence Velázquez) Owned by: essandess (Steve Smith)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: ghc

Description

The destroot phase runs a configure script (???) but allows it to use the default gcc instead of forcing it to use the right compiler. This fails for me because my MacPorts installation is set up to catch it, but I expect it "succeeds" for most users.

  • main.log excerpt:
    :info:destroot Command line: sh configure --prefix=/opt/local/var/macports/build/_Users_larryv_Code_MacPorts_ports_lang_ghc/ghc/work/destroot/opt/local
    :info:destroot ===> Command failed with error code: 77
    :info:destroot configure: error: in `/opt/local/var/macports/build/_Users_larryv_Code_MacPorts_ports_lang_ghc/ghc/work/ghc-9.4.2/_build/bindist/ghc-9.4.2-x86_64-apple-darwin':
    :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 excerpt:
    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.

  • lang/ghc/Portfile

    diff --git a/lang/ghc/Portfile b/lang/ghc/Portfile
    index 8f3ca39313b..56593c87cc7 100644
    a b if {${name} eq ${subport}} { 
    103103    build.pre_args
    104104    build.post_args [haskell_cabal.build_getjobsarg]
    105105
     106    destroot.env    CC=${configure.cc} \
     107                    CXX=${configure.cxx}
    106108    destroot.cmd    hadrian
    107109    destroot.target install
    108110    destroot.pre_args \

Attachments (2)

main.log (1.4 MB) - added by larryv (Lawrence Velázquez) 19 months ago.
config.log (11.4 KB) - added by larryv (Lawrence Velázquez) 19 months ago.
work/ghc-9.4.2/_build/bindist/ghc-9.4.2-x86_64-apple-darwin/config.log

Download all attachments as: .zip

Change History (7)

Changed 19 months ago by larryv (Lawrence Velázquez)

Attachment: main.log added

Changed 19 months ago by larryv (Lawrence Velázquez)

Attachment: config.log added

work/ghc-9.4.2/_build/bindist/ghc-9.4.2-x86_64-apple-darwin/config.log

comment:1 Changed 19 months ago by essandess (Steve Smith)

Do you observe this issue only in destroot and not in build as well?

comment:2 Changed 19 months ago by Steve Smith <essandess@…>

Resolution: fixed
Status: assignedclosed

In ce58ed87dd5e3902321103209d2a557490090c57/macports-ports (master):

ghc: use correct compiler

comment:3 in reply to:  1 Changed 19 months ago by larryv (Lawrence Velázquez)

Replying to essandess:

Do you observe this issue only in destroot and not in build as well?

That's right; the build phase does not appear to call default compilers via PATH search.

comment:5 in reply to:  4 Changed 19 months ago by larryv (Lawrence Velázquez)

Replying to essandess:

In c4955daea49bcd389b2daee486bf1e678bc4dd8d/macports-ports (master):

Just confirming that the previous commit didn't fix the issue, but this one did. Thank you!

Note: See TracTickets for help on using tickets.