#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}} { 103 103 build.pre_args 104 104 build.post_args [haskell_cabal.build_getjobsarg] 105 105 106 destroot.env CC=${configure.cc} \ 107 CXX=${configure.cxx} 106 108 destroot.cmd hadrian 107 109 destroot.target install 108 110 destroot.pre_args \
Attachments (2)
Change History (7)
Changed 2 years ago by larryv (Lawrence Velázquez)
Changed 2 years ago by larryv (Lawrence Velázquez)
Attachment: | config.log added |
---|
comment:1 follow-up: 3 Changed 2 years ago by essandess (Steve Smith)
Do you observe this issue only in destroot
and not in build
as well?
comment:2 Changed 2 years ago by Steve Smith <essandess@…>
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 Changed 2 years ago by larryv (Lawrence Velázquez)
Replying to essandess:
Do you observe this issue only in
destroot
and not inbuild
as well?
That's right; the build phase does not appear to call default compilers via PATH search.
comment:4 follow-up: 5 Changed 2 years ago by essandess (Steve Smith)
comment:5 Changed 2 years 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!
work/ghc-9.4.2/_build/bindist/ghc-9.4.2-x86_64-apple-darwin/config.log