Commit ba0aed2e authored by Alp Mestanogullari's avatar Alp Mestanogullari Committed by Alp Mestanogullari
Browse files

Hadrian: override $(ghc-config-mk), to prevent redundant config generation

This required making the 'ghc-config-mk' variable overridable in
testsuite/mk/, and then making use of this in hadrian
to point to '<build root>/test/ghcconfig' instead, which is where we
always put the test config.

Previously, we would build ghc-config and run it against the
GHC to be tested, a second time, while we're running the tests, because some
include testsuite/mk/ This was causing unexpected output
parent e172a6d1
Pipeline #5523 passed with stages
in 232 minutes and 42 seconds
......@@ -107,6 +107,9 @@ testRules = do
-- Shake can keep track of them, but it is not as easy as it seems
-- to get that to work.
liftIO $ do
-- Many of those env vars are used by Makefiles in the
-- test infrastructure, or from tests or their
-- Makefiles.
setEnv "MAKE" makePath
setEnv "PYTHON" pythonPath
setEnv "TEST_HC" ghcPath
......@@ -116,6 +119,11 @@ testRules = do
(top -/- root -/- checkApiAnnotationsProgPath)
-- This lets us bypass the need to generate a config
-- through Make, which happens in testsuite/mk/
-- which is in turn included by all test 'Makefile's.
setEnv "ghc-config-mk" (top -/- root -/- ghcConfigPath)
-- Execute the test target.
-- We override the verbosity setting to make sure the user can see
-- the test output:
......@@ -240,11 +240,13 @@ $(TOP)/mk/ghc-config : $(TOP)/mk/ghc-config.hs
space=$(empty) $(empty)
ifeq "$(ghc-config-mk)" ""
ghc-config-mk = $(TOP)/mk/ghcconfig$(subst $(space),_,$(subst :,_,$(subst /,_,$(subst \,_,$(TEST_HC))))).mk
$(ghc-config-mk) : $(TOP)/mk/ghc-config
$(TOP)/mk/ghc-config "$(TEST_HC)" >"$@"; if [ $$? != 0 ]; then $(RM) "$@"; exit 1; fi
# If the ghc-config fails, remove $@, and fail
# Note: $(CLEANING) is not defined in the testsuite.
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
Supports Markdown
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