[GHC] #7979: ./configure script does not properly detect missing header files

#7979: ./configure script does not properly detect missing header files -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Component: Build System Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- I was trying to compile GHC on a fresh installation of Debian Wheezy and I got this compilation error: {{{ CROSS_COMPILE="" "inplace/bin/ghc-cabal" configure --with-ghc="/dane/download/ghc-7.6.3/inplace/bin/ghc-stage1" --with-ghc-pkg="[9/1856] wnload/ghc-7.6.3/inplace/bin/ghc-pkg" --enable-library-profiling --enable-shared --enable-library-for-ghci --configure-option=CFLAGS=" -fno-stack-protector " --configure-option=LDFLAGS=" -Wl,--hash-size=31 -Wl,--reduce-memory-overheads " --configure-option=CPPFLAGS=" " --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc" --with-ar="/usr/bin/ar" --with-ranlib="true" --with-alex="/usr /bin/alex" --with-happy="/usr/bin/happy" -- dist-install libraries/terminfo Configuring terminfo-0.3.2.4... configure: WARNING: unrecognized options: --with-compiler, --with-gcc checking for gcc... /usr/bin/gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /usr/bin/gcc accepts -g... yes checking for /usr/bin/gcc option to accept ISO C89... none needed checking how to run the C preprocessor... /usr/bin/gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking ncurses.h usability... no checking ncurses.h presence... no checking for ncurses.h... no checking curses.h usability... no checking curses.h presence... no checking for curses.h... no configure: error: in `/dane/download/ghc-7.6.3/libraries/terminfo': configure: error: curses headers could not be found, so this package cannot be built See `config.log' for more details make[1]: *** [libraries/terminfo/dist-install/package-data.mk] Error 1 make: *** [all] Error 2 }}} Which means that `./configure` did not detect that ncurses header files are missing from the system. I think that in this situation `./configure` should fail and inform the user that required header files are missing. Also, I noticed that when Alex and Happy are missing from the system then `./configure` will also not complain. I admit I didn't try to build with these two binaries missing, but I suspect that building would fail. If so, then `./configure` script should also fail in this situation. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7979 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7979: ./configure script does not properly detect missing header files -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Component: Build System Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by emanuel): Replying to [ticket:7979 jstolarek]: {{{ ... checking ncurses.h usability... no checking ncurses.h presence... no checking for ncurses.h... no checking curses.h usability... no checking curses.h presence... no checking for curses.h... no configure: error: in `/dane/download/ghc-7.6.3/libraries/terminfo': configure: error: curses headers could not be found, so this package cannot be built ... }}} This is output from configure script. It detected correctly that ncurses is missing. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7979#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7979: ./configure script does not properly detect missing header files -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Component: Build System Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by jstolarek): Looks like you're right, but the problem is that despite detecting that header files are missing the script doesn't report that as an error. I am strongly convinced that it should - after all that's what configure script is for! -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7979#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Looks like you're right, but the problem is that despite detecting that
#7979: ./configure script does not properly detect missing header files -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Component: Build System Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by emanuel): Replying to [comment:2 jstolarek]: header files are missing the script doesn't report that as an error. I am strongly convinced that it should - after all that's what configure script is for! Please look at configure.ac in terminfo library, there you can find: {{{ ... AC_CHECK_HEADER(ncurses.h, CursesIncludes='ncurses.h', [AC_CHECK_HEADER(curses.h, CursesIncludes='curses.h', HaveCursesH=NO)]) ... if test "x$HaveCursesH" = xNO ; then AC_MSG_FAILURE([curses headers could not be found, so this package cannot be built]) else TERMINFO_INCLUDES="$CursesIncludes term.h" fi ... }}} It checks for headers (and then it checks for the library). If it fails, then you will see this error message: {{{ configure: error: curses headers could not be found, so this package cannot be built }}} Everything is fine here. You have your error message. The strange thing is, that you posted configure output with an error at the end, and you claim, that this error message doesn't exist. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7979#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7979: ./configure script does not properly detect missing header files -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Component: Build System Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by jstolarek): The error message I posted comes from the ./configure script of terminfo library required by GHC. This error is generated during the build, whereas I should get that error from the ./configure script of GHC, before I even attempt to build it. GHC ./configure should realize that one of the libraries it needs requires header files for ncurses. Currently it doesn't report that as an error. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7979#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7979: ./configure script does not properly detect missing header files -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Component: Build System Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by emanuel): Now it's clear. Yes, main configure script doesn't check for all requirements (from all sub-projects/libraries), but the build system just works that way. * all checks from all configure.ac files from all subdirectories can be duplicated in main configure script (very bad solution) * all configure scripts can be executed before main make (but I think there is a reason why the build system doesn't do that, this could create more problems that it resolves) * all checks can be separated from configure.ac, for example they can be placed in configure.checks and all configure.checks can be included in main configure script (a lot of boring work, changes everywhere) * all configure scripts can be executed at once, but they should only do the checking (is it possible?) Maybe some autotools expert could help here. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7979#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7979: ./configure script does not properly detect missing header files -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Component: Build System Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by thoughtpolice): I filed this ticket in #7570 which was closed as WONTFIX by Ian. The gist is roughly as you described. Several of those solutions won't work (libraries are built with stage1 for example, and you configure them with stage1, so it can't happen earlier than that.) Others are awful (code duplication.) There is maybe boring work that can be done, but as that requires synchronizing such checks against every library, it may not be feasible or as easy to do so, long term (as of the Core Libraries committee formation, we'll hopefully be maintaining less of these GHC HQ sponsored packages, I think.) I think the unfortunate reality is as Ian said: there is probably no cure which is better than the disease. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7979#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7979: ./configure script does not properly detect missing header files -----------------------------+---------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Component: Build System Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by jstolarek): This makes me think: do we have a "know bugs" page on the wiki or in the user documentation? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7979#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7979: ./configure script does not properly detect missing header files -------------------------------+-------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 7.6.3 Resolution: wontfix | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by igloo): * status: new => closed * difficulty: => Unknown * resolution: => wontfix Comment: There's http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs-and- infelicities.html But I don't think it's worth listing this. It's very minor, and it's unlikely that anyone would check there before filing a ticket or anything. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7979#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC