[GHC] #11231: GHC's configure script does not honour CC env var
#11231: GHC's configure script does not honour CC env var -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- `./configure --help` tells us that: {{{ ... Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to <glasgow-haskell-bugs@haskell.org>. }}} However, neither - `CC=clang-3.8 ./configure`, nor - `./configure CC=clang-3.8` has any effect. `./configure` keeps using the `/usr/bin/gcc` in `$PATH`. The only invocation that has the desired effect is - `./configure --with-gcc=clang-3.8` However, this is utterly surprising and confusing to experienced developers who are used to Autoconf `./configure` scripts adhering to the conventions regarding `CC`, and contradicts the `--help` message. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11231> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11231: GHC's configure script does not honour CC env var -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9983 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by hvr): * related: => #9983 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11231#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11231: GHC's configure script does not honour CC env var -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9983 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Perhaps Phab:D1356 is relevant here? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11231#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11231: GHC's configure script does not honour CC env var -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9983 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"ffc802e8f617d11de9ece7bed438725bde0300b8/ghc" ffc802e8/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="ffc802e8f617d11de9ece7bed438725bde0300b8" Drop Xcode 4.1 hack and fix ignored CC var issue Xcode 4.1 was released back in 2011 for Mac OSX 10.6/10.7. However, OSX 10.7 reached EOL sometime around the end of 2014. So this `--with-gcc-4.2` hack shouldn't be needed anymore. Moreover, this patch changes ./configure to honor the CC env-var again (and thus fix #11231) while giving `--with-gcc=...` a higher priority over `CC=...`. So the following 3 invocations are equivalent now: CC=... ./configure ./configure CC=... ./configure --with-gcc=... Since `--with-{gcc,clang}=...` is a misnomer (as is made apparent by `--with-gcc=clang` or `--with-clang=gcc`), this would give us a neutral and idiomatic way to tell ./configure which C compiler to use. Moreover, `./configure --help` says at the end of its output: Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Consequently, by honoring CC=... (rather than ignoring it) we increase consistency and reduce user confusion. Ideally, CC=... would become the recommended way to set the C compiler, and `--with-{clang,gcc}=...` would be demoted to legacy aliases. Reviewed By: erikd, bgamari Differential Revision: https://phabricator.haskell.org/D2046 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11231#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11231: GHC's configure script does not honour CC env var -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9983 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by hvr): * status: new => merge * version: 7.11 => 7.10.3 * milestone: => 8.0.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11231#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11231: GHC's configure script does not honour CC env var -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9983 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): I think some of the other variables in that output you mention do not actually work either, so just fixing `CC` doesn't really reduce user confusion overall. This doesn't fix a real bug, so does it really make sense to merge this to 8.0? How much testing have you done in unusual configurations, e.g., cross-compiling? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11231#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11231: GHC's configure script does not honour CC env var -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9983 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by hvr): Replying to [comment:5 rwbarton]:
I think some of the other variables in that output you mention do not actually work either, so just fixing `CC` doesn't really reduce user confusion overall.
didn't notice that yet... will fix that as well *sigh*
This doesn't fix a real bug, so does it really make sense to merge this to 8.0?
Well it is a bug nonetheless... and it's easy to fix (fwiw, Cabal had a related bug which caused it to pass a non-standard --with-ghc to configure scripts rather than the standard CC= flag causing subtle problems on Win32) The idea is to switch to CC= as the recommended/documented way, and delaying merging this to 8.0 would mean that the confusion will continue for one year more than necessary. Also, 8.0 marks an easy to remember point in time where CC= became available. If this only starts working with 8.2 it becomes harder to remember.
How much testing have you done in unusual configurations, e.g., cross- compiling?
I actually did test crosscompiling to powerpc as well as checked whether `./validate` would pick it up. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11231#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11231: GHC's configure script does not honour CC env var -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9983 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged as 56eaed1d6c98febf2b3c2f80c0b1e08e13cb8c9f. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11231#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC