[GHC] #9465: configure: sed: illegal option -- r

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.8.3 Keywords: sed | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 | Type of failure: Building hour) | GHC failed Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- configure fails (but does not stop) as follows: {{{ : checking version of ghc... 7.8.3 checking whether bootstrap compiler is affected by bug 9439... yes checking build system type... x86_64-apple-darwin14.0.0 checking host system type... x86_64-apple-darwin14.0.0 checking target system type... x86_64-apple-darwin14.0.0 Build platform inferred as: x86_64-apple-darwin Host platform inferred as: x86_64-apple-darwin Target platform inferred as: x86_64-apple-darwin GHC build : x86_64-apple-darwin GHC host : x86_64-apple-darwin GHC target : x86_64-apple-darwin configure: Building in-tree ghc-pwd sed: illegal option -- r usage: sed script [-Ealn] [-i extension] [file ...] sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...] }}} The gnu sed manual page says -r --regexp-extended Use extended regular expressions rather than basic regular expressions. Extended regexps are those that egrep accepts; they can be clearer because they usually have less backslashes, but are a GNU extension and hence scripts that use them are not portable. See Extended regular expressions. So the fix is, presumably to add \ before () in the configure script at {{{ sed -r 's/(^| )([^ ])/\1-optl\2/g' }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Description changed by jrp: Old description:
configure fails (but does not stop) as follows: {{{ : checking version of ghc... 7.8.3 checking whether bootstrap compiler is affected by bug 9439... yes checking build system type... x86_64-apple-darwin14.0.0 checking host system type... x86_64-apple-darwin14.0.0 checking target system type... x86_64-apple-darwin14.0.0 Build platform inferred as: x86_64-apple-darwin Host platform inferred as: x86_64-apple-darwin Target platform inferred as: x86_64-apple-darwin GHC build : x86_64-apple-darwin GHC host : x86_64-apple-darwin GHC target : x86_64-apple-darwin configure: Building in-tree ghc-pwd sed: illegal option -- r usage: sed script [-Ealn] [-i extension] [file ...] sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...] }}}
The gnu sed manual page says
-r --regexp-extended Use extended regular expressions rather than basic regular expressions. Extended regexps are those that egrep accepts; they can be clearer because they usually have less backslashes, but are a GNU extension and hence scripts that use them are not portable. See Extended regular expressions.
So the fix is, presumably to add \ before () in the configure script at {{{ sed -r 's/(^| )([^ ])/\1-optl\2/g' }}}
New description: configure fails (but does not stop) as follows: {{{ : checking version of ghc... 7.8.3 checking whether bootstrap compiler is affected by bug 9439... yes checking build system type... x86_64-apple-darwin14.0.0 checking host system type... x86_64-apple-darwin14.0.0 checking target system type... x86_64-apple-darwin14.0.0 Build platform inferred as: x86_64-apple-darwin Host platform inferred as: x86_64-apple-darwin Target platform inferred as: x86_64-apple-darwin GHC build : x86_64-apple-darwin GHC host : x86_64-apple-darwin GHC target : x86_64-apple-darwin configure: Building in-tree ghc-pwd sed: illegal option -- r usage: sed script [-Ealn] [-i extension] [file ...] sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...] }}} The gnu sed manual page says -r --regexp-extended Use extended regular expressions rather than basic regular expressions. Extended regexps are those that egrep accepts; they can be clearer because they usually have less backslashes, but are a GNU extension and hence scripts that use them are not portable. See Extended regular expressions. So the fix is, presumably to remove the -r and add \ before () in the configure script at {{{ sed -r 's/(^| )([^ ])/\1-optl\2/g' }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): Thanks for the report, but, ... that would be exactly the opposite of the change in commit d39c434a9518b7376857be88503055ecb7d0fe1f "Make configure's sed(1) expression for GHC_LDFLAGS more BSD-friendly.", so I guess we will need some kind of autodetection or other way to do this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by jrp): I think that an answer could be to use -E instead of -r (http://www.freebsd.org/cgi/man.cgi?query=sed) although this will presumably not be compatible with gnu sed. Did the repvious version not work at all with BSD? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: pgj Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by pgj): * owner: => pgj Comment: I made the commit, assign to self. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

I think that an answer could be to use -E instead of -r (http://www.freebsd.org/cgi/man.cgi?query=sed) although this will
#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: pgj Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by pgj): Replying to [comment:3 jrp]: presumably not be compatible with gnu sed. For what it is worth, to my findings, GNU sed actually supports the {{{-E}}} flag, but it is not documented on its manual page.
Did the repvious version not work at all with BSD?
No, it did not work with FreeBSD. We had a solution in the Ports Collection for that, so I naively thought that it could be just put upstream, but apparently I was (quite) wrong. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: pgj Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by pgj): All right, I have rewritten the whole expression with perl. (Perl should be present at build time as it is required for booting.) Could you please the attached patch? Note that you shall run the {{{autoreconf}}} command in order have your {{{configure}}} script updated. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: pgj Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by jrp): Thanks. perl / awk were going to be my next suggestion! (Exercise for the reader: do it in bash scipt :-)) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: pgj Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by kgardas): Tested on Solaris 11. It runs fine and fixes exactly the same issue like on MacOSX. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9465: configure: sed: illegal option -- r
-------------------------------------+-------------------------------------
Reporter: jrp | Owner: pgj
Type: bug | Status: new
Priority: normal | Milestone:
Component: Build | Version: 7.8.3
System | Keywords: sed
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Easy (less than 1
Unknown/Multiple | hour)
Type of failure: Building | Blocked By:
GHC failed | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Gabor Pali

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: pgj Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by pgj): Replying to [comment:7 jrp]:
(Exercise for the reader: do it in bash script :-))
PPS: The patch executes OK. In an ideal world the test might come after
For what is worth, doing this in pure {{{sh}}} would not be much more complicated... I should have thought about this earlier :-) the configure script
tests for perl (although, as you point out, the check is (presumably) redundant as you would not have got that far without a perl boot.
Indeed. I have checked it without Perl being in the {{{PATH}}} and {{{configure}}} failed okay. That is, although it did not find Perl when it tried to evaluate the expression, but it will say {{{configure: perl not found}}} -- and then at the check for Perl it will stop and display the corresponding error message ({{{You must install perl before you can continue...}}}). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9465: configure: sed: illegal option -- r -------------------------------------+------------------------------------- Reporter: jrp | Owner: pgj Type: bug | Status: closed Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: sed Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Building | Blocked By: GHC failed | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9465#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC