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

#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

#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 Resolution: | 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: | -------------------------------------+------------------------------------- Comment (by monoidal): What do you get as output of `import os; print(os.environ['PATH'])` in python 2 and 3? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14919#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | 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: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): For `python2`: {{{ $ python2 Python 2.7.5 (default, May 3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import os; print(os.environ['PATH']) /u/rgscott/Software/arcanist/bin:/u/rgscott/.cabal/bin:/u/rgscott/Software/haskell/ghc-8.2.2/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/u/rgscott/.cabal/bin:/opt/dell/srvadmin/bin:/u/rgscott/Software/hpx/bin:/u/rgscott/bin }}}
For `python3`: {{{ $ python3 Python 3.5.2 (default, Aug 19 2016, 07:40:05) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux Type "help", "copyright", "credits" or "license" for more information.
import os; print(os.environ['PATH']) /l/python3/bin }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14919#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14919: python3-based GHC scripts don't work on my RHEL machine -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: 8.5 Resolution: invalid | 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: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => invalid Comment: Never mind. It turns out that this is entirely an issue with how `python3` is installed on my machine: {{{ $ more /usr/local/bin/python3 export PATH=/l/python3/bin export LD_LIBRARY_PATH=/l/python3/lib export LD_RUN_PATH=/l/python3/lib export PKG_CONFIG_PATH=/l/python3/lib/pkgconfig exec /l/python3/bin/python3 ${1+"$@"} }}} Ugh. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14919#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC