Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#54908 closed defect (worksforme)

ghc @7.8.3_6: fails to build in trace mode on 10.11

Reported by: dliessi (Davide Liessi) Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: ghc

Description

Probably missing dependencies? See in particular the trace mode warnings regarding files provided by Haskell ports and gc.h.

Full log attached.

Terminal output:

$ sudo port -ts destroot ghc
--->  Computing dependencies for ghc
--->  Fetching distfiles for ghc
--->  Verifying checksums for ghc
--->  Extracting ghc
--->  Applying patches to ghc
--->  Configuring ghc
Warning: The following existing files were hidden from the build system by trace mode:
  /opt/local/bin/alex
  /opt/local/bin/gmake
  /opt/local/bin/gnutar
  /opt/local/bin/grep
  /opt/local/bin/gsed
  /opt/local/bin/happy
  /opt/local/share/xml/docbook/4.1.2/catalog.xml
  /opt/local/share/xml/docbook/4.2/catalog.xml
  /opt/local/share/xml/docbook/4.3/catalog.xml
  /opt/local/share/xml/docbook/4.4/catalog.xml
  /opt/local/share/xml/docbook/4.5/catalog.xml
  /opt/local/share/xml/docbook/5.0/catalog.xml
  /opt/local/share/xsl/docbook-xsl/catalog.xml
Warning: The following file inside the MacPorts prefix not installed by a port was accessed:
  /opt/local/etc/xml/catalog
--->  Building ghc
Warning: The following existing files were hidden from the build system by trace mode:
  /opt/local/bin/alex
  /opt/local/bin/grep
  /opt/local/bin/haddock
  /opt/local/bin/happy
  /opt/local/bin/hpc
  /opt/local/bin/pkg-config
  /opt/local/include/gc/gc.h
  /opt/local/include/mach-o/fat.h
  /opt/local/include/mach-o/loader.h
  /opt/local/include/mach-o/nlist.h
  /opt/local/include/mach-o/reloc.h
  /opt/local/include/mach-o/x86_64/reloc.h
Warning: The following file inside the MacPorts prefix not installed by a port was accessed:
  /opt/local/include/GC.h
Error: Failed to build ghc: command execution failed
Error: See /opt/local/var/macports/logs/_opt_macports-git_macports-ports_lang_ghc/ghc/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port ghc failed

Attachments (1)

main.log.bz2 (69.5 KB) - added by dliessi (Davide Liessi) 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by dliessi (Davide Liessi)

Attachment: main.log.bz2 added

comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: neverpanic removed
Owner: set to neverpanic
Status: newassigned
:info:build /opt/local/bin/clang-mp-4.0 -E -I/opt/local/include -m64 -DPROFILING -DTHREADED_RTS -DDEBUG -Irts/dist/build  -m64 -fno-stack-protector  -Wall -Wextra -Wstrict-prototypes  -Wmissing-prototypes  -Wmissing-declarations -Winline -Waggregate-return -Wpointer-arith -Wmissing-noreturn -Wnested-externs -Wredundant-decls  -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -fno-strict-aliasing -fno-common -DDTRACE        -O2 -fomit-frame-pointer -DRtsWay=\"rts_v\" -Wno-strict-prototypes -I/opt/local/lib/libffi-3.2.1/include   -DPARALLEL_GC -Irts/sm -MM -x c rts/dist/build/sm/Evac_thr.c -MF rts/dist/build/.depend-v-p-dyn-l-debug-thr-thr_debug-thr_l-thr_p-debug_dyn-thr_dyn-thr_debug_dyn-l_dyn-thr_l_dyn.c_asm.bit
:info:build rts/dist/build/sm/Evac_thr.c:19:10: warning: non-portable path to file '"gc.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
:info:build #include "GC.h"
:info:build          ^~~~~~
:info:build          "gc.h"
:info:build In file included from rts/dist/build/sm/Evac_thr.c:19:
:info:build /opt/local/include/GC.h:2:10: fatal error: 'gc/gc.h' file not found
:info:build #include <gc/gc.h>
:info:build          ^~~~~~~~~
:info:build 7 warnings and 1 error generated.

The #include wants to find a file in the ghc project called "GC.h". But because the build system incorrectly lists -I/opt/local/include first on the compile line, before any -I directives that specify the directory containing GC.h, and because you have installed a port such as boehmgc that provides the file /opt/local/include/gc.h, and because you have a case-insensitive filesystem, ghc finds /opt/local/include/gc.h instead of its own GC.h. The two files are not similar or interchangeable, hence the build failure.

I'm actually surprised MacPorts allowed it to get that far; I thought the whole point of trace mode was that it prevented access to files from ports that aren't dependencies, but that doesn't appear to have been prevented here.

The solution is to fix the order of the -I flags in the build system, or if that is too difficult, replace -I/opt/local/include with -isystem/opt/local/include; directories listed with -isystem are always searched after directories specified with -I, even if the -isystem directories appear earlier in the command line.

comment:2 Changed 5 years ago by neverpanic (Clemens Lang)

Resolution: worksforme
Status: assignedclosed

I'm assuming this is fixed with the recent update to GHC 8.6 as merged in https://github.com/macports/macports-ports/pull/4794.

Also, I'm no longer maintaining GHC as of https://github.com/macports/macports-ports/pull/5049, so should this still be a problem, this ticket should be assigned to the new maintainer.

comment:3 Changed 5 years ago by mf2k (Frank Schima)

NM

Last edited 5 years ago by mf2k (Frank Schima) (previous) (diff)
Note: See TracTickets for help on using tickets.