Commit 011e39d7 authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski Committed by Ben Gamari

Fix GhostScript detection (Trac #15856)

The option `confdir` (used in GhostScript test) was set correctly
via `--config` in `test.mk` and incorrectly via `config/ghc`.
AFAICT, some time ago this was working because the
incorrect assignment was done first, and later it broke.

Hardian doesn't pass `confdir`. I removed `confdir` and use
`config.top` to determine the directory of the
`good.ps` and `bad.ps` files. This is simpler.

I also removed some redundant assignments in `config/ghc`.

Test Plan: manually set config.have_profiling and make test

Reviewers: bgamari

Subscribers: rwbarton, carter

GHC Trac Issues: #15856

Differential Revision: https://phabricator.haskell.org/D5298
parent 13bb4bf4
......@@ -4,15 +4,8 @@ import re
#
# This file is Python source
#
config.compiler = 'ghc'
config.compiler_always_flags = ghc_compiler_always_flags.split()
config.haddock = 'haddock'
config.hp2ps = 'hp2ps'
config.hpc = 'hpc'
config.gs = 'gs'
config.confdir = '.'
# By default, the 'normal' and 'hpc' ways are enabled. In addition, certain
# ways are enabled automatically if this GHC supports them. Ways that fall in
# this group are 'optasm', 'optllvm', 'profasm', 'threaded1', 'threaded2',
......
......@@ -1921,9 +1921,9 @@ global gs_working
gs_working = False
if config.have_profiling:
if config.gs != '':
resultGood = runCmd(genGSCmd(config.confdir + '/good.ps'));
resultGood = runCmd(genGSCmd(config.top + '/config/good.ps'));
if resultGood == 0:
resultBad = runCmd(genGSCmd(config.confdir + '/bad.ps') +
resultBad = runCmd(genGSCmd(config.top + '/config/bad.ps') +
' >/dev/null 2>&1')
if resultBad != 0:
print("GhostScript available for hp2ps tests")
......
......@@ -25,8 +25,7 @@ export MAKE
RUNTESTS = $(TOP)/driver/runtests.py
COMPILER = ghc
CONFIGDIR = $(TOP)/config
CONFIG = $(CONFIGDIR)/$(COMPILER)
CONFIG = $(TOP)/config/$(COMPILER)
ifeq "$(GhcUnregisterised)" "YES"
# Otherwise C backend generates many warnings about
......@@ -243,7 +242,6 @@ endif
RUNTEST_OPTS += \
--rootdir=. \
--config-file=$(CONFIG) \
-e 'config.confdir="$(CONFIGDIR)"' \
-e 'config.platform="$(TARGETPLATFORM)"' \
-e 'config.os="$(TargetOS_CPP)"' \
-e 'config.arch="$(TargetARCH_CPP)"' \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment