[GHC] #10382: Template Haskell (non-quasi) quotes should work with stage 1 compiler

GHC ghc-devs at haskell.org
Tue Nov 24 09:58:34 UTC 2015


#10382: Template Haskell (non-quasi) quotes should work with stage 1 compiler
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Template Haskell  |              Version:  7.11
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D876
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by thomie):

 Replying to [comment:20 ezyang]:
 > We also need a way to force the test suite to run stage1 in some cases,
 so we can catch this regression next time.

 I see three options:

 * Option 1 (change validate)
   - create a directory with tests that should be tested with the stage1
 compiler.
   - In ./validate, add something like `make -C
 testsuite/tests/stage1-tests stage=1` (The full command would also
 include: `$MAKE_TEST_TARGET $BINDIST $TEST_VERBOSITY THREADS=$threads
 SUMMARY_FILE=...)`
   - Make sure the grepping for results in testsuite_summary.txt still does
 the right thing (bit fiddly)
   - Minor point: define target synonyms `fasttest` and `slowtest` in
 `testsuite/Makefile` and `testsuite/mk/test.mk`)

 * Option 2 (driver support)
   - add a new setup function to testsuite/driver/testlib.py: something
 like `def stage(n)` or `def stage1()`
   - assign the `STAGE1_GHC` variable from testsuite/mk/boilerplate.mk
 should to a new option config.stage1 (add `--config 'stage1=$(call
 quote_path,$(STAGE1_GHC))'` to RUNTEST_OPTS in testsuite/mk/test.mk, and
 change testsuite/driver/runtests.py and testsuite/driver/testglobals.py.
   - add a `compiler` field to TestOptions
 (testsuite/driver/testglobals.py). By default it should contain
 config.compiler (do so in `def test` in testsuite/driver/testlib.py, not
 sure..)
   - the setup function `stage1()` sets opts.compiler to config.stage1, but
 only when the stage1 compiler is available. When TEST_HC is specified or
 when TEST_HC is implied to be an installed compiler, STAGE1_GHC won't be
 defined.
   - change all uses of config.compiler to opts.compiler (grep also for
 '{compiler}').

 * Option 3 (Makefile)
   - define the test in a Makefile. Refer to `STAGE1_GHC` instead of
 `TEST_HC`. Skip if empty.

 The drawback of option 1 is that a failing validate might confuse GHC
 developers, because they can't reproduce the test failure when running the
 test locally (they'd have to specify make stage=1, which isn't obvious).
 Many questions on IRC/Phabricator/mail.

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


More information about the ghc-tickets mailing list