Opened 3 years ago

Closed 3 years ago

#12077 closed bug (fixed)

DYNAMIC_GHC_PROGRAMS=NO: T8761 is failing (Make pattern synonyms work with Template Haskell)

Reported by: thomie Owned by: simonmar
Priority: normal Milestone: 8.2.1
Component: Template Haskell Version: 8.1
Keywords: Cc: bollmann
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: th/T8761
Blocked By: Blocking:
Related Tickets: #8761 Differential Rev(s):
Wiki Page:

Description (last modified by thomie)

First failure: https://travis-ci.org/ghc/ghc/builds/129738012

Actual stderr output differs from expected:
--- ./th/T8761.stderr.normalised	2016-05-12 15:08:16.512921981 +0000
+++ ./th/T8761.comp.stderr.normalised	2016-05-12 15:08:16.512921981 +0000
@@ -1,7 +1,3 @@
-pattern Q1 x1_0 x2_1 x3_2 <- ((x1_0, x2_1), [x3_2], _, _)
-pattern x1_0 Q2 x2_1 = ((x1_0, x2_1))
-pattern Q3 {qx3, qy3, qz3} <- ((qx3, qy3), [qz3]) where
-                                  Q3 qx3 qy3 qz3 = ((qx3, qy3), [qz3])
 T8761.hs:(15,1)-(38,13): Splicing declarations
     do { [qx1, qy1, qz1] <- mapM
                               (/ i -> newName $ "x" ++ show i) [1, 2, 3];
@@ -123,30 +119,6 @@
     pattern Pup x <- MkUnivProv x
     pattern Puep :: forall a. forall b. Show b => a -> b -> (ExProv, a)
     pattern Puep x y <- (MkExProv y, x)
-pattern T8761.P :: GHC.Types.Bool
-pattern T8761.Pe :: () => forall (a0_0 :: *) . a0_0 -> T8761.Ex
-pattern T8761.Pu :: forall (a0_0 :: *) . a0_0 -> a0_0
-pattern T8761.Pue :: forall (a0_0 :: *) . () => forall (b0_1 :: *) .
-                                                a0_0 -> b0_1 -> (a0_0, T8761.Ex)
-pattern T8761.Pur :: forall (a0_0 :: *) . (GHC.Num.Num a0_0,
-                                           GHC.Classes.Eq a0_0) =>
-                     a0_0 -> [a0_0]
-pattern T8761.Purp :: forall (a0_0 :: *) (b0_1 :: *) . (GHC.Num.Num a0_0,
-                                                        GHC.Classes.Eq a0_0) =>
-                      GHC.Show.Show b0_1 => a0_0 -> b0_1 -> ([a0_0], T8761.UnivProv b0_1)
-pattern T8761.Pure :: forall (a0_0 :: *) . (GHC.Num.Num a0_0,
-                                            GHC.Classes.Eq a0_0) =>
-                      forall (b0_1 :: *) . a0_0 -> b0_1 -> ([a0_0], T8761.Ex)
-pattern T8761.Purep :: forall (a0_0 :: *) . (GHC.Num.Num a0_0,
-                                             GHC.Classes.Eq a0_0) =>
-                       forall (b0_1 :: *) . GHC.Show.Show b0_1 =>
-                       a0_0 -> b0_1 -> ([a0_0], T8761.ExProv)
-pattern T8761.Pep :: () => forall (a0_0 :: *) . GHC.Show.Show a0_0 =>
-                           a0_0 -> T8761.ExProv
-pattern T8761.Pup :: forall (a0_0 :: *) . () => GHC.Show.Show a0_0 =>
-                                                a0_0 -> T8761.UnivProv a0_0
-pattern T8761.Puep :: forall (a0_0 :: *) . () => forall (b0_1 :: *) . GHC.Show.Show b0_1 =>
-                                                 a0_0 -> b0_1 -> (T8761.ExProv, a0_0)
 T8761.hs:(107,1)-(111,25): Splicing declarations
     do { infos <- mapM
                     reify
*** unexpected failure for T8761(normal)

@bollmann added the test in c079de3c43704ea88f592e441389e520313e30ad.

Change History (10)

comment:1 Changed 3 years ago by Thomas Miedema <thomasmiedema@…>

In 8e92974/ghc:

Testsuite: mark T8761 expect_broken #12077

comment:2 Changed 3 years ago by thomie

Description: modified (diff)
Summary: T8761 (Make pattern synonyms work with Template Haskell) is failing on TravisDYNAMIC_GHC_PROGRAMS=NO: T8761 is failing (Make pattern synonyms work with Template Haskell)
Test Case: th/T8761

comment:3 Changed 3 years ago by bollmann

hmm, it seems as if doing IO during compilation isn't supported with DYNAMIC_GHC_PROGRAMS=NO enabled? Where do I set this option to be able to verify this behavior on my local machine? Is it in mk/build.mk somewhere? It'd be great if anyone could tell me so, that I can take a deeper look at a fix.

comment:4 Changed 3 years ago by thomie

Where do I set this option to be able to verify this behavior on my local machine? Is it in mk/build.mk somewhere?

Yes. When DYNAMIC_GHC_PROGRAMS=NO, GHCi uses the Runtime System linker (rts/Linker.c) instead of the system installed dynamic linker.

Thanks for looking into it. It might be a known issue with the Runtime System Linker, I'm not sure.

comment:5 Changed 3 years ago by bollmann

hmm, putting DYNAMIC_GHC_PROGRAMS=NO into mk/build.mk and then running ./boot && ./configure && make results in an error:

Configuring ghc-prim-0.5.0.0...
ghc-cabal: Cannot find the program 'ghc'. User-specified path
'/home/dominik/ghc/inplace/bin/ghc-stage1' does not refer to an executable and
the program is not on the system path.
libraries/ghc-prim/ghc.mk:4: recipe for target 'libraries/ghc-prim/dist-install/package-data.mk' failed
make[1]: *** [libraries/ghc-prim/dist-install/package-data.mk] Error 1
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

I don't really understand what's happening here.

comment:6 Changed 3 years ago by thomie

Remove stage=2 from mk/build.mk.

comment:7 Changed 3 years ago by simonmar

Milestone: 8.0.2
Owner: set to simonmar

This is just a buffering issue. GHC does hSetBuffering stdout LineBuffering, but that only applies to the interpreter's stdout when GHC is dynamic, because there GHC and the interpreter share a stdout. In other configurations, GHC and the interpreter have different stdout Handles, and the interpreter's stdout will be block-buffered by default when output goes to a file, as it does in the testsuite.

There's no easy fix that makes this just work. I'm going to make the test do hFlush stdout explicitly instead.

comment:8 Changed 3 years ago by Simon Marlow <marlowsd@…>

In 0bab375/ghc:

Fix T8761  (#12219, #12077)

comment:9 Changed 3 years ago by simonmar

Status: newmerge

comment:10 Changed 3 years ago by bgamari

Milestone: 8.0.28.2.1
Resolution: fixed
Status: mergeclosed
Version: 8.0.18.1

This test doesn't exist on ghc-8.0 as TH support for pattern synonyms (#8761) wasn't yet merged.

Note: See TracTickets for help on using tickets.