Ticket #7333 (closed bug: fixed)

Opened 7 months ago

Last modified 6 months ago

python2

Reported by: michalt Owned by:
Priority: normal Milestone:
Component: Build System Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Currently GHC assumes that the python command defaults to Python 2.x, but on some systems (e.g., Arch Linux) it's already Python 3.x. This breaks the testsuite completely. According to  http://www.python.org/dev/peps/pep-0394/ on *nix systems one should prefer python2 command. I'm not very familiar with the build system of GHC but my quick solution is to:

  • make configure.ac check for python2
  • make the testsuite also try python2 first
  • remove the shebang line from calibrate (testsuite/timeout) since make already calls it with the value of PYTHON variable
  • change the shebang in timeout.py (in testsuite/timeout) to use python2, which should be safe on Unix like systems (and on Windows we don't actually use timeout.py)

Btw is the PythonCmd (defined by configure.ac) actually used somewhere -- I can't seem to find where...

Attachments

0001-configure-check-for-python2-first.patch Download (0.7 KB) - added by michalt 7 months ago.
patch for GHC
0001-mk-timeout-use-python2-when-possible.patch Download (1.2 KB) - added by michalt 7 months ago.
patch for testsuite

Change History

Changed 7 months ago by michalt

patch for GHC

Changed 7 months ago by michalt

patch for testsuite

Changed 7 months ago by michalt

  • status changed from new to patch

Changed 6 months ago by igloo

  • status changed from patch to closed
  • difficulty set to Unknown
  • resolution set to fixed

I don't have python2 here on Debian.

I've applied the part of the patch that uses python2 if it exists, but I haven't removed the hash-bangs as they don't do any harm AFAICS.

I've also removed the python detection from the ghc configure script. Thanks for pointing that out.

Note: See TracTickets for help on using tickets.