[GHC] #14919: python3-based GHC scripts don't work on my RHEL machine

GHC ghc-devs at haskell.org
Wed Mar 14 15:08:00 UTC 2018


#14919: python3-based GHC scripts don't work on my RHEL machine
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Build System   |           Version:  8.5
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Building GHC
  Unknown/Multiple                   |  failed
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I recently switched over machines to work on GHC stuff, but to my dismay,
 several `python3`-based scripts which glue GHC together do not work with
 my new machine. One of these is `boot`. If I run this, I am greeted with:

 {{{
 $ ./boot
 Traceback (most recent call last):
   File "./boot", line 193, in <module>
     check_for_url_rewrites()
   File "./boot", line 29, in check_for_url_rewrites
     subprocess.check_output('git config
 remote.origin.url'.split()).find(b'github.com') != -1 and \
   File "/l/python3/lib/python3.5/subprocess.py", line 626, in check_output
     **kwargs).stdout
   File "/l/python3/lib/python3.5/subprocess.py", line 693, in run
     with Popen(*popenargs, **kwargs) as process:
   File "/l/python3/lib/python3.5/subprocess.py", line 947, in __init__
     restore_signals, start_new_session)
   File "/l/python3/lib/python3.5/subprocess.py", line 1551, in
 _execute_child
     raise child_exception_type(errno_num, err_msg)
 FileNotFoundError: [Errno 2] No such file or directory: 'git'
 }}}

 One thing that's relevant here is that my `python3` installation is in an
 unusual location, `/usr/local/bin`. Most of my other executables are
 installed in `/usr/bin`, such as `git`, `sed`, `autoconf`, `python2`, etc.
 The fact that `python3` is located elsewhere seems important, because if I
 hack `boot` to use `python2`:

 {{{#!diff
 diff --git a/boot b/boot
 index f913724..995293a 100755
 --- a/boot
 +++ b/boot
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python3
 +#!/usr/bin/env python2

  import glob
  import os
 @@ -18,7 +18,7 @@ parser.add_argument('--hadrian', action='store_true',
 help='Do not assume the ma
  args = parser.parse_args()

  def print_err(s):
 -    print(dedent(s), file=sys.stderr)
 +    print dedent(s)

  def die(mesg):
      print_err(mesg)
 }}}

 Then it works. It seems that `subprocess.check_output` is //only// looking
 up executable names in the same directory as `python(3)`, for reasons that
 I don't fully understand.

 Other scripts based around `python3`, such as the test suite driver, also
 fail. If I run those, I also experience errors, such as:

 {{{
 $ make test TEST="T11311"
 <elided>
 /bin/sh: locale: command not found
 /bin/sh: grep: command not found
 /bin/sh: grep: command not found
 /bin/sh: locale: command not found
 /bin/sh: grep: command not found
 Timeout is 300
 Found 400 .T files...
 Beginning test run at Wed Mar 14 11:03:46 2018 EDT
 <elided>
 =====> T11311(normal) 1 of 1 [0, 0, 0]
 cd "./dependent/should_compile/T11311.run" &&
 "/nfs/nfs7/home/rgscott/Software/ghc/inplace/test   spaces/ghc-stage2" -c
 T11311.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-
 missed-specialisations -fshow-warning-groups -fdiagnostics-color=never
 -fno-diagnostics-show-caret -dno-debug-output
 Compile failed (exit code 1) errors were:

 <no location info>: error:
     Warning: Couldn't figure out C compiler information!
              Make sure you're using GNU gcc, or clang
 ghc-stage2: could not execute: gcc

 *** unexpected failure for T11311(normal)

 Unexpected results from:
 TEST="T11311"

 SUMMARY for test run started at Wed Mar 14 11:03:46 2018 EDT
  0:00:02 spent to go through
        1 total tests, which gave rise to
        3 test cases, of which
        2 were skipped

        0 had missing libraries
        0 expected passes
        0 expected failures

        0 caused framework failures
        0 caused framework warnings
        0 unexpected passes
        1 unexpected failures
        0 unexpected stat failures

 Unexpected failures:
    dependent/should_compile/T11311.run  T11311 [exit code non-0] (normal)

 make[1]: *** [test] Error 1
 make[1]: Leaving directory
 `/nfs/nfs7/home/rgscott/Software/ghc/testsuite/tests'
 make: *** [test] Error 2
 }}}

 I don't know a way to hack around this problem, unfortunately.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14919>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list